29 #include <type_traits>
31 #if __has_include(<source_location>)
32 #include <source_location>
34 #include <experimental/source_location>
44 template<
class,
class =
void>
58 return p.get() ==
nullptr;
66 template<
class T,
class ExceptionType = std::inval
id_argument>
72 s <<
"Ptr passed to CheckedDeref is NULL"
73 <<
"\nfile : " << loc.file_name()
74 <<
"\nline : " << loc.line()
75 <<
"\nfunction: " << loc.function_name();
76 throw ExceptionType {
s.str()};
80 template<
class T,
class M,
class ExceptionType = std::inval
id_argument>
86 s <<
"Ptr passed to CheckedDeref is NULL"
87 <<
"\nfile : " << loc.file_name()
88 <<
"\nline : " << loc.line()
89 <<
"\nfunction: " << loc.function_name()
90 <<
"\nmessage :\n" << msg;
91 throw ExceptionType {
s.str()};