forked from boostorg/assert
Add a source_location constructor from std::source_location
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
|
||||
#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION)
|
||||
# include <source_location>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@@ -36,6 +40,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION)
|
||||
|
||||
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() )
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR char const * file_name() const BOOST_NOEXCEPT
|
||||
{
|
||||
return file_;
|
||||
|
||||
Reference in New Issue
Block a user