| 1 | // Copyright (C) 2020 T. Zachary Laine |
| 2 | // |
| 3 | // Distributed under the Boost Software License, Version 1.0. (See |
| 4 | // accompanying file LICENSE_1_0.txt or copy at |
| 5 | // http://www.boost.org/LICENSE_1_0.txt) |
| 6 | #ifndef BOOST_STL_INTERFACES_CONFIG_HPP |
| 7 | #define BOOST_STL_INTERFACES_CONFIG_HPP |
| 8 | |
| 9 | // Included for definition of __cpp_lib_concepts. |
| 10 | #include <iterator> |
| 11 | |
| 12 | |
| 13 | #if defined(__cpp_lib_concepts) && defined(__cpp_lib_ranges) && \ |
| 14 | !defined(BOOST_STL_INTERFACES_DISABLE_CONCEPTS) |
| 15 | #define BOOST_STL_INTERFACES_USE_CONCEPTS 1 |
| 16 | #else |
| 17 | #define BOOST_STL_INTERFACES_USE_CONCEPTS 0 |
| 18 | #endif |
| 19 | |
| 20 | #if defined(__cpp_explicit_this_parameter) && \ |
| 21 | BOOST_STL_INTERFACES_USE_CONCEPTS && \ |
| 22 | !defined(BOOST_STL_INTERFACES_DISABLE_DEDUCED_THIS) |
| 23 | #define BOOST_STL_INTERFACES_USE_DEDUCED_THIS 1 |
| 24 | #else |
| 25 | #define BOOST_STL_INTERFACES_USE_DEDUCED_THIS 0 |
| 26 | #endif |
| 27 | |
| 28 | // The inline namespaces v1, v2, and v3 represent C++14, C++20, and C++23 and |
| 29 | // later, respectively. v1 is inline for standards before C++20, and v2 is |
| 30 | // inline for C++20 and later. Note that this only applies to code for which |
| 31 | // multiple vI namespace alternatives exist. For example, some instances of |
| 32 | // the v1 namespace may still be inline, if there is no v2 version of its |
| 33 | // contents. |
| 34 | #if !BOOST_STL_INTERFACES_USE_CONCEPTS && !BOOST_STL_INTERFACES_USE_DEDUCED_THIS |
| 35 | # define BOOST_STL_INTERFACES_NAMESPACE_V1 inline namespace v1 |
| 36 | # define BOOST_STL_INTERFACES_NAMESPACE_V2 namespace v2 |
| 37 | # define BOOST_STL_INTERFACES_NAMESPACE_V3 namespace v3 |
| 38 | #elif BOOST_STL_INTERFACES_USE_CONCEPTS && !BOOST_STL_INTERFACES_USE_DEDUCED_THIS |
| 39 | # define BOOST_STL_INTERFACES_NAMESPACE_V1 namespace v1 |
| 40 | # define BOOST_STL_INTERFACES_NAMESPACE_V2 inline namespace v2 |
| 41 | # define BOOST_STL_INTERFACES_NAMESPACE_V3 namespace v3 |
| 42 | #else |
| 43 | # define BOOST_STL_INTERFACES_NAMESPACE_V1 namespace v1 |
| 44 | # define BOOST_STL_INTERFACES_NAMESPACE_V2 namespace v2 |
| 45 | # define BOOST_STL_INTERFACES_NAMESPACE_V3 inline namespace v3 |
| 46 | #endif |
| 47 | |
| 48 | #endif |
| 49 | |