3 // Copyright Michael Park, 2015-2017
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
8 #ifndef MPARK_CONFIG_HPP
9 #define MPARK_CONFIG_HPP
11 // MSVC 2015 Update 3.
12 #if __cplusplus < 201103L && (!defined(_MSC_VER) || _MSC_FULL_VER < 190024210)
13 #error "MPark.Variant requires C++11 support."
17 #define __has_builtin(x) 0
21 #define __has_include(x) 0
25 #define __has_feature(x) 0
28 #if __has_builtin(__builtin_addressof) || \
29 (defined(__GNUC__) && __GNUC__ >= 7) || defined(_MSC_VER)
30 #define MPARK_BUILTIN_ADDRESSOF
33 #if __has_builtin(__builtin_unreachable)
34 #define MPARK_BUILTIN_UNREACHABLE
37 #if __has_builtin(__type_pack_element)
38 #define MPARK_TYPE_PACK_ELEMENT
41 #if defined(__cpp_constexpr) && __cpp_constexpr >= 201304
42 #define MPARK_CPP14_CONSTEXPR
45 #if __has_feature(cxx_exceptions) || defined(__cpp_exceptions) || \
46 (defined(_MSC_VER) && defined(_CPPUNWIND))
47 #define MPARK_EXCEPTIONS
50 #if defined(__cpp_generic_lambdas) || defined(_MSC_VER)
51 #define MPARK_GENERIC_LAMBDAS
54 #if defined(__cpp_lib_integer_sequence)
55 #define MPARK_INTEGER_SEQUENCE
58 #if defined(__cpp_return_type_deduction) || defined(_MSC_VER)
59 #define MPARK_RETURN_TYPE_DEDUCTION
62 #if defined(__cpp_lib_transparent_operators) || defined(_MSC_VER)
63 #define MPARK_TRANSPARENT_OPERATORS
66 #if defined(__cpp_variable_templates) || defined(_MSC_VER)
67 #define MPARK_VARIABLE_TEMPLATES
70 #if !defined(__GLIBCXX__) || __has_include(<codecvt>) // >= libstdc++-5
71 #define MPARK_TRIVIALITY_TYPE_TRAITS
74 #endif // MPARK_CONFIG_HPP