118 throw E(
static_cast<const std::ostringstream &
>(s).str());
141#define ah_warning_unless(out, C) \
143 [[unlikely]](out) << "WARNING (" << __FILE__ << ":" << __LINE__ << ") | "
157#define ah_warning_if(out, C) \
159 [[unlikely]](out) << "WARNING (" << __FILE__ << ":" << __LINE__ << ") | "
172#define ah_warning(out) \
173 (out) << "WARNING (" << __FILE__ << ":" << __LINE__ << ") | "
191#define ah_range_error_unless(C) \
193 [[unlikely]]Aleph::ExceptionBuilder<std::range_error>(), \
194 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
207#define ah_range_error_if(C) \
209 [[unlikely]]Aleph::ExceptionBuilder<std::range_error>(), \
210 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
223#define ah_range_error() \
224 Aleph::ExceptionBuilder<std::range_error>(), \
225 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
227#define ah_range_error_if_constexpr(C) \
231#define ah_range_error_unless_constexpr(C) \
232 if constexpr (not (C)) \
250#define ah_runtime_error_unless(C) \
252 [[unlikely]]Aleph::ExceptionBuilder<std::runtime_error>(), \
253 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
266#define ah_runtime_error_if(C) \
268 [[unlikely]]Aleph::ExceptionBuilder<std::runtime_error>(), \
269 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
282#define ah_runtime_error() \
283 Aleph::ExceptionBuilder<std::runtime_error>(), \
284 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
286#define ah_runtime_error_if_constexpr(C) \
290#define ah_runtime_error_unless_constexpr(C) \
291 if constexpr (not (C)) \
309#define ah_logic_error_unless(C) \
311 [[unlikely]]Aleph::ExceptionBuilder<std::logic_error>(), \
312 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
325#define ah_logic_error_if(C) \
327 [[unlikely]]Aleph::ExceptionBuilder<std::logic_error>(), \
328 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
341#define ah_logic_error() \
342 Aleph::ExceptionBuilder<std::logic_error>(), \
343 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
345#define ah_logic_error_if_constexpr(C) \
349#define ah_logic_error_unless_constexpr(C) \
350 if constexpr (not (C)) \
368#define ah_underflow_error_if(C) \
370 [[unlikely]]Aleph::ExceptionBuilder<std::underflow_error>(), \
371 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
384#define ah_underflow_error_unless(C) \
386 [[unlikely]]Aleph::ExceptionBuilder<std::underflow_error>(), \
387 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
400#define ah_underflow_error() \
401 Aleph::ExceptionBuilder<std::underflow_error>(), \
402 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
404#define ah_underflow_error_if_constexpr(C) \
408#define ah_underflow_error_unless_constexpr(C) \
409 if constexpr (not (C)) \
421#define ah_bad_alloc() \
422 do { [[unlikely]] throw std::bad_alloc(); } while (false)
429#define ah_bad_alloc_if(C) \
430 do { if (C) [[unlikely]] throw std::bad_alloc(); } while (false)
437#define ah_bad_alloc_unless(C) \
438 do { if (!(C)) [[unlikely]] throw std::bad_alloc(); } while (false)
440#define ah_bad_alloc_if_constexpr(C) \
444#define ah_bad_alloc_unless_constexpr(C) \
445 if constexpr (not (C)) \
463#define ah_overflow_error_if(C) \
465 [[unlikely]]Aleph::ExceptionBuilder<std::overflow_error>(), \
466 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
479#define ah_overflow_error_unless(C) \
481 [[unlikely]]Aleph::ExceptionBuilder<std::overflow_error>(), \
482 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
495#define ah_overflow_error() \
496 Aleph::ExceptionBuilder<std::overflow_error>(), \
497 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
499#define ah_overflow_error_if_constexpr(C) \
503#define ah_overflow_error_unless_constexpr(C) \
504 if constexpr (not (C)) \
522#define ah_domain_error_if(C) \
524 [[unlikely]]Aleph::ExceptionBuilder<std::domain_error>(), \
525 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
538#define ah_domain_error_unless(C) \
540 [[unlikely]]Aleph::ExceptionBuilder<std::domain_error>(), \
541 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
554#define ah_domain_error() \
555 Aleph::ExceptionBuilder<std::domain_error>(), \
556 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
557#define ah_domain_error_if_constexpr(C) \
560#define ah_domain_error_unless_constexpr(C) \
561 if constexpr (not (C)) \
579#define ah_out_of_range_error_if(C) \
581 [[unlikely]]Aleph::ExceptionBuilder<std::out_of_range>(), \
582 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
595#define ah_out_of_range_error_unless(C) \
597 [[unlikely]]Aleph::ExceptionBuilder<std::out_of_range>(), \
598 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
611#define ah_out_of_range_error() \
612 Aleph::ExceptionBuilder<std::out_of_range>(), \
613 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
615#define ah_out_of_range_error_if_constexpr(C) \
617 ah_out_of_range_error()
619#define ah_out_of_range_error_unless_constexpr(C) \
620 if constexpr (not (C)) \
621 ah_out_of_range_error()
639#define ah_invalid_argument_if(C) \
641 [[unlikely]]Aleph::ExceptionBuilder<std::invalid_argument>(), \
642 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
655#define ah_invalid_argument_unless(C) \
657 [[unlikely]]Aleph::ExceptionBuilder<std::invalid_argument>(), \
658 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
671#define ah_invalid_argument() \
672 Aleph::ExceptionBuilder<std::invalid_argument>(), \
673 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
675#define ah_invalid_argument_if_constexpr(C) \
677 ah_invalid_argument()
679#define ah_invalid_argument_unless_constexpr(C) \
680 if constexpr (not (C)) \
681 ah_invalid_argument()
698#define ah_length_error_if(C) \
700 [[unlikely]]Aleph::ExceptionBuilder<std::length_error>(), \
701 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
714#define ah_length_error_unless(C) \
716 [[unlikely]]Aleph::ExceptionBuilder<std::length_error>(), \
717 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
730#define ah_length_error() \
731 Aleph::ExceptionBuilder<std::length_error>(), \
732 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
734#define ah_length_error_if_constexpr(C) \
738#define ah_length_error_unless_constexpr(C) \
739 if constexpr (not (C)) \
759#define ah_fatal_error() \
760 Aleph::ExceptionBuilder<std::runtime_error>(), \
761 std::stringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
Main namespace for Aleph-w library functions.
Exception constructor with formatted message.
int operator,(const std::ostream &s)
Comma operator that throws the exception with the constructed message.