X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9d7dca1d2de1e6d67027e4ba33fefe1eb09550e3..c4081e3a628c6ab697d7958f3f22bdf788c0c13c:/include/xbt/exception.hpp diff --git a/include/xbt/exception.hpp b/include/xbt/exception.hpp index 4391ffec6d..6e801981d2 100644 --- a/include/xbt/exception.hpp +++ b/include/xbt/exception.hpp @@ -40,10 +40,10 @@ typedef std::vector Backtrace; * * @ingroup XBT_ex */ -struct ThrowPoint { - ThrowPoint() {} - ThrowPoint(const char* file, int line, const char* function) : - file(file), line(line), function(function) {} +class ThrowPoint { + public: + ThrowPoint() = default; + explicit ThrowPoint(const char* file, int line, const char* function) : file(file), line(line), function(function) {} const char* file = nullptr; int line = 0; const char* function = nullptr; @@ -61,7 +61,7 @@ struct ThrowPoint { * You are not expected to inherit from it. Instead of you use should * @ref XBT_THROW an exception which will throw a subclass of your original * exception with those additional features. - * + * * However, you can try `dynamic_cast` an exception to this type in order to * get contextual information about the exception. */ @@ -103,9 +103,7 @@ template class WithContext : public E, public WithContextException { public: - - static_assert(!std::is_base_of::value, - "Trying to appli WithContext twice"); + static_assert(not std::is_base_of::value, "Trying to appli WithContext twice"); WithContext(E exception) : E(std::move(exception)) {}