config.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // Included for definition of __cpp_lib_concepts.
  9. #include <iterator>
  10. #if defined(__cpp_lib_concepts) && defined(__cpp_lib_ranges) && \
  11. !defined(BOOST_STL_INTERFACES_DISABLE_CONCEPTS)
  12. #define BOOST_STL_INTERFACES_USE_CONCEPTS 1
  13. #else
  14. #define BOOST_STL_INTERFACES_USE_CONCEPTS 0
  15. #endif
  16. #if defined(__cpp_explicit_this_parameter) && \
  17. BOOST_STL_INTERFACES_USE_CONCEPTS && \
  18. !defined(BOOST_STL_INTERFACES_DISABLE_DEDUCED_THIS)
  19. #define BOOST_STL_INTERFACES_USE_DEDUCED_THIS 1
  20. #else
  21. #define BOOST_STL_INTERFACES_USE_DEDUCED_THIS 0
  22. #endif
  23. // The inline namespaces v1, v2, and v3 represent C++14, C++20, and C++23 and
  24. // later, respectively. v1 is inline for standards before C++20, and v2 is
  25. // inline for C++20 and later. Note that this only applies to code for which
  26. // multiple vI namespace alternatives exist. For example, some instances of
  27. // the v1 namespace may still be inline, if there is no v2 version of its
  28. // contents.
  29. #if !BOOST_STL_INTERFACES_USE_CONCEPTS && !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
  30. # define BOOST_STL_INTERFACES_NAMESPACE_V1 inline namespace v1
  31. # define BOOST_STL_INTERFACES_NAMESPACE_V2 namespace v2
  32. # define BOOST_STL_INTERFACES_NAMESPACE_V3 namespace v3
  33. #elif BOOST_STL_INTERFACES_USE_CONCEPTS && !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
  34. # define BOOST_STL_INTERFACES_NAMESPACE_V1 namespace v1
  35. # define BOOST_STL_INTERFACES_NAMESPACE_V2 inline namespace v2
  36. # define BOOST_STL_INTERFACES_NAMESPACE_V3 namespace v3
  37. #else
  38. # define BOOST_STL_INTERFACES_NAMESPACE_V1 namespace v1
  39. # define BOOST_STL_INTERFACES_NAMESPACE_V2 namespace v2
  40. # define BOOST_STL_INTERFACES_NAMESPACE_V3 inline namespace v3
  41. #endif
  42. #endif