config.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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. // The inline namespaces v1 and v2 represent pre- and post-C++20. v1 is
  17. // inline for standards before C++20, and v2 is inline for C++20 and later.
  18. // Note that this only applies to code for which a v2 namespace alternative
  19. // exists. Some instances of the v1 namespace may still be inline, if there
  20. // is no v2 version of its contents.
  21. #if BOOST_STL_INTERFACES_USE_CONCEPTS
  22. # define BOOST_STL_INTERFACES_NAMESPACE_V1 namespace v1
  23. # define BOOST_STL_INTERFACES_NAMESPACE_V2 inline namespace v2
  24. #else
  25. # define BOOST_STL_INTERFACES_NAMESPACE_V1 inline namespace v1
  26. # define BOOST_STL_INTERFACES_NAMESPACE_V2 namespace v2
  27. #endif
  28. #endif