forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathany.h
More file actions
60 lines (44 loc) · 1.11 KB
/
Copy pathany.h
File metadata and controls
60 lines (44 loc) · 1.11 KB
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
#ifndef BST_ANY_H
#define BST_ANY_H
// Provide bst::any, etc. using either std:: or boost:: symbols
// C++17 feature test macro: __has_include(<any>), __cpp_lib_any
#if !defined(BST_ANY_STD) && !defined(BST_ANY_BOOST)
#if defined(__GNUC__)
// std::any is available from GCC 7.1, with -std=c++17
//#if __GNUC__ > 7 || (__GNUC__ == 7 && __GNUC_MINOR__ >= 1)
#if __cplusplus >= 201703L
#define BST_ANY_STD
#else
#define BST_ANY_BOOST
#endif
#elif defined(_MSC_VER)
#if _MSC_VER >= 1910
// From VS2017, /std:c++17 switch is introduced, but this is only indicated in __cplusplus if /Zc:__cplusplus is also specified
#if __cplusplus >= 201703L
#define BST_ANY_STD
#else
#define BST_ANY_BOOST
#endif
#else
// Earlier
#define BST_ANY_BOOST
#endif
#else
// Default to C++17
#define BST_ANY_STD
#endif
#endif
#if defined(BST_ANY_STD)
#include <any>
namespace bst_any = std;
#elif defined(BST_ANY_BOOST)
#include <boost/any.hpp>
namespace bst_any = boost;
#endif
namespace bst
{
// Note that Boost.Any does not provide make_any or the in-place any constructors
using bst_any::any;
using bst_any::any_cast;
}
#endif