Use __cpp_lib_source_location instead of BOOST_NO_CXX20_HDR_SOURCE_LOCATION

This commit is contained in:
Peter Dimov
2022-02-03 09:31:27 +02:00
parent 25f0bab733
commit fde226c7f5
2 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@
#include <string> #include <string>
#include <cstdio> #include <cstdio>
#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L
# include <source_location> # include <source_location>
#endif #endif
@@ -40,7 +40,7 @@ public:
{ {
} }
#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L
BOOST_CONSTEXPR source_location( std::source_location const& loc ) BOOST_NOEXCEPT: file_( loc.file_name() ), function_( loc.function_name() ), line_( loc.line() ), column_( loc.column() ) BOOST_CONSTEXPR source_location( std::source_location const& loc ) BOOST_NOEXCEPT: file_( loc.file_name() ), function_( loc.function_name() ), line_( loc.line() ), column_( loc.column() )
{ {

View File

@@ -25,7 +25,7 @@ int main()
BOOST_TEST_EQ( loc.column(), 0 ); BOOST_TEST_EQ( loc.column(), 0 );
} }
#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L
{ {
std::source_location loc = std::source_location::current(); std::source_location loc = std::source_location::current();