config.hpp 2.1 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_PARSER_DETAIL_STL_INTERFACES_CONFIG_HPP
  7. #define BOOST_PARSER_DETAIL_STL_INTERFACES_CONFIG_HPP
  8. #include <boost/parser/config.hpp>
  9. #if !BOOST_PARSER_USE_CONCEPTS
  10. # define BOOST_PARSER_DETAIL_STL_INTERFACES_USE_CONCEPTS 0
  11. #else
  12. // This is now hard-coded to use the pre-C++20 code path. There are a bunch
  13. // of really odd compile errorswith Clang+libstdc++ I can't be bothered to
  14. // address right now.
  15. # define BOOST_PARSER_DETAIL_STL_INTERFACES_USE_CONCEPTS 0
  16. #endif
  17. #if defined(__cpp_explicit_this_parameter) && BOOST_PARSER_DETAIL_STL_INTERFACES_USE_CONCEPTS
  18. #define BOOST_PARSER_USE_DEDUCED_THIS 1
  19. #else
  20. #define BOOST_PARSER_USE_DEDUCED_THIS 0
  21. #endif
  22. // The inline namespaces v1, v2, and v3 represent C++14, C++20, and C++23 and
  23. // later, respectively. v1 is inline for standards before C++20, and v2 is
  24. // inline for C++20 and later. Note that this only applies to code for which
  25. // multiple vI namespace alternatives exist. For example, some instances of
  26. // the v1 namespace may still be inline, if there is no v2 version of its
  27. // contents.
  28. #if !BOOST_PARSER_DETAIL_STL_INTERFACES_USE_CONCEPTS && !BOOST_PARSER_USE_DEDUCED_THIS
  29. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V1 inline namespace v1
  30. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V2 namespace v2
  31. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V3 namespace v3
  32. #elif BOOST_PARSER_DETAIL_STL_INTERFACES_USE_CONCEPTS && !BOOST_PARSER_USE_DEDUCED_THIS
  33. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V1 namespace v1
  34. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V2 inline namespace v2
  35. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V3 namespace v3
  36. #else
  37. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V1 namespace v1
  38. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V2 namespace v2
  39. # define BOOST_PARSER_DETAIL_STL_INTERFACES_NAMESPACE_V3 inline namespace v3
  40. #endif
  41. #endif