118 if (
const auto *
oss =
dynamic_cast<const std::ostringstream *
>(&s))
121 if (
const auto *
ss =
dynamic_cast<const std::stringstream *
>(&s))
124 throw E(
"Unknown stream type in Aleph::ExceptionBuilder");
146#define ah_warning_unless(out, C) \
148 [[unlikely]](out) << "WARNING (" << __FILE__ << ":" << __LINE__ << ") | "
162#define ah_warning_if(out, C) \
164 [[unlikely]](out) << "WARNING (" << __FILE__ << ":" << __LINE__ << ") | "
177#define ah_warning(out) \
178 (out) << "WARNING (" << __FILE__ << ":" << __LINE__ << ") | "
196#define ah_range_error_unless(C) \
198 [[unlikely]]Aleph::ExceptionBuilder<std::range_error>(), \
199 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
212#define ah_range_error_if(C) \
214 [[unlikely]]Aleph::ExceptionBuilder<std::range_error>(), \
215 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
228#define ah_range_error() \
229 Aleph::ExceptionBuilder<std::range_error>(), \
230 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
232#define ah_range_error_if_constexpr(C) \
236#define ah_range_error_unless_constexpr(C) \
237 if constexpr (not (C)) \
255#define ah_runtime_error_unless(C) \
257 [[unlikely]]Aleph::ExceptionBuilder<std::runtime_error>(), \
258 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
271#define ah_runtime_error_if(C) \
273 [[unlikely]]Aleph::ExceptionBuilder<std::runtime_error>(), \
274 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
287#define ah_runtime_error() \
288 Aleph::ExceptionBuilder<std::runtime_error>(), \
289 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
291#define ah_runtime_error_if_constexpr(C) \
295#define ah_runtime_error_unless_constexpr(C) \
296 if constexpr (not (C)) \
314#define ah_logic_error_unless(C) \
316 [[unlikely]]Aleph::ExceptionBuilder<std::logic_error>(), \
317 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
330#define ah_logic_error_if(C) \
332 [[unlikely]]Aleph::ExceptionBuilder<std::logic_error>(), \
333 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
346#define ah_logic_error() \
347 Aleph::ExceptionBuilder<std::logic_error>(), \
348 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
350#define ah_logic_error_if_constexpr(C) \
354#define ah_logic_error_unless_constexpr(C) \
355 if constexpr (not (C)) \
373#define ah_underflow_error_if(C) \
375 [[unlikely]]Aleph::ExceptionBuilder<std::underflow_error>(), \
376 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
389#define ah_underflow_error_unless(C) \
391 [[unlikely]]Aleph::ExceptionBuilder<std::underflow_error>(), \
392 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
405#define ah_underflow_error() \
406 Aleph::ExceptionBuilder<std::underflow_error>(), \
407 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
409#define ah_underflow_error_if_constexpr(C) \
413#define ah_underflow_error_unless_constexpr(C) \
414 if constexpr (not (C)) \
426#define ah_bad_alloc() \
427 do { [[unlikely]] throw std::bad_alloc(); } while (false)
434#define ah_bad_alloc_if(C) \
435 do { if (C) [[unlikely]] throw std::bad_alloc(); } while (false)
442#define ah_bad_alloc_unless(C) \
443 do { if (!(C)) [[unlikely]] throw std::bad_alloc(); } while (false)
445#define ah_bad_alloc_if_constexpr(C) \
449#define ah_bad_alloc_unless_constexpr(C) \
450 if constexpr (not (C)) \
468#define ah_overflow_error_if(C) \
470 [[unlikely]]Aleph::ExceptionBuilder<std::overflow_error>(), \
471 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
484#define ah_overflow_error_unless(C) \
486 [[unlikely]]Aleph::ExceptionBuilder<std::overflow_error>(), \
487 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
500#define ah_overflow_error() \
501 Aleph::ExceptionBuilder<std::overflow_error>(), \
502 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
504#define ah_overflow_error_if_constexpr(C) \
508#define ah_overflow_error_unless_constexpr(C) \
509 if constexpr (not (C)) \
527#define ah_domain_error_if(C) \
529 [[unlikely]]Aleph::ExceptionBuilder<std::domain_error>(), \
530 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
543#define ah_domain_error_unless(C) \
545 [[unlikely]]Aleph::ExceptionBuilder<std::domain_error>(), \
546 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
559#define ah_domain_error() \
560 Aleph::ExceptionBuilder<std::domain_error>(), \
561 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
562#define ah_domain_error_if_constexpr(C) \
565#define ah_domain_error_unless_constexpr(C) \
566 if constexpr (not (C)) \
584#define ah_out_of_range_error_if(C) \
586 [[unlikely]]Aleph::ExceptionBuilder<std::out_of_range>(), \
587 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
600#define ah_out_of_range_error_unless(C) \
602 [[unlikely]]Aleph::ExceptionBuilder<std::out_of_range>(), \
603 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
616#define ah_out_of_range_error() \
617 Aleph::ExceptionBuilder<std::out_of_range>(), \
618 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
620#define ah_out_of_range_error_if_constexpr(C) \
622 ah_out_of_range_error()
624#define ah_out_of_range_error_unless_constexpr(C) \
625 if constexpr (not (C)) \
626 ah_out_of_range_error()
644#define ah_invalid_argument_if(C) \
646 [[unlikely]]Aleph::ExceptionBuilder<std::invalid_argument>(), \
647 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
660#define ah_invalid_argument_unless(C) \
662 [[unlikely]]Aleph::ExceptionBuilder<std::invalid_argument>(), \
663 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
676#define ah_invalid_argument() \
677 Aleph::ExceptionBuilder<std::invalid_argument>(), \
678 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
680#define ah_invalid_argument_if_constexpr(C) \
682 ah_invalid_argument()
684#define ah_invalid_argument_unless_constexpr(C) \
685 if constexpr (not (C)) \
686 ah_invalid_argument()
703#define ah_length_error_if(C) \
705 [[unlikely]]Aleph::ExceptionBuilder<std::length_error>(), \
706 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
719#define ah_length_error_unless(C) \
721 [[unlikely]]Aleph::ExceptionBuilder<std::length_error>(), \
722 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
735#define ah_length_error() \
736 Aleph::ExceptionBuilder<std::length_error>(), \
737 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
739#define ah_length_error_if_constexpr(C) \
743#define ah_length_error_unless_constexpr(C) \
744 if constexpr (not (C)) \
764#define ah_fatal_error() \
765 Aleph::ExceptionBuilder<std::runtime_error>(), \
766 std::ostringstream() << "(" << __FILE__ << ":" << __LINE__ << ") | "
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
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.