15[[noreturn]]
void Throw(
const char* condition,
const char* func,
16 const char*
file,
int line);
34#define DRAKE_THROW_UNLESS(condition) \
36 typedef ::drake::assert::ConditionTraits< \
37 typename std::remove_cv_t<decltype(condition)>> Trait; \
38 static_assert(Trait::is_valid, "Condition should be bool-convertible."); \
40 !std::is_pointer_v<decltype(condition)>, \
41 "When using DRAKE_THROW_UNLESS on a raw pointer, always write out " \
42 "DRAKE_THROW_UNLESS(foo != nullptr), do not write DRAKE_THROW_UNLESS" \
43 "(foo) and rely on implicit pointer-to-bool conversion."); \
44 if (!Trait::Evaluate(condition)) { \
45 ::drake::internal::Throw(#condition, __func__, __FILE__, __LINE__); \
then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file
Definition: ThirdPartyNotices.txt:195
Provides Drake's assertion implementation.
void Throw(const char *condition, const char *func, const char *file, int line)
Definition: drake_assertion_error.h:6
Definition: Eigen_Colamd.h:50