forked from boostorg/assert
Add a source_location constructor from std::source_location
This commit is contained in:
1 parent
ce2133a17f
commit
25f0bab733
4 files changed
+40
-4
No files matched your search
@@ -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