-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathany-main.t.hpp
63 lines (44 loc) · 1.52 KB
/
any-main.t.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// Copyright (c) 2016-2018 Martin Moene
//
// https://github.com/martinmoene/any-lite
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#ifndef TEST_ANY_LITE_H_INCLUDED
#define TEST_ANY_LITE_H_INCLUDED
#include "nonstd/any.hpp"
// Compiler warning suppression for usage of lest:
#ifdef __clang__
# pragma clang diagnostic ignored "-Wstring-conversion"
# pragma clang diagnostic ignored "-Wunused-parameter"
# pragma clang diagnostic ignored "-Wunused-template"
# pragma clang diagnostic ignored "-Wunused-function"
# pragma clang diagnostic ignored "-Wunused-member-function"
#elif defined __GNUC__
# pragma GCC diagnostic ignored "-Wunused-parameter"
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "lest_cpp03.hpp"
#define CASE( name ) lest_CASE( specification(), name )
// Attribute externally visible for -fwhole-program:
#if defined(__GNUC__) && !defined(__clang__)
# define any_ATTRIBUTE_EXT_VIS __attribute__((externally_visible))
#else
# define any_ATTRIBUTE_EXT_VIS
#endif
extern lest::tests & specification() any_ATTRIBUTE_EXT_VIS;
namespace nonstd {
// use oparator<< instead of to_string() overload;
// see http://stackoverflow.com/a/10651752/437272
inline std::ostream & operator<<( std::ostream & os, nonstd::any const & /*v*/ )
{
return os << "[any:]";
}
}
namespace lest {
using ::nonstd::operator<<;
} // namespace lest
#endif // TEST_ANY_LITE_H_INCLUDED
// end of file