45 util::source_info_view source, std::string_view condition,
46 const logging::logger& logger, std::string_view description) {
47 fmt::memory_buffer buffer;
48 fmt::format_to(std::back_inserter(buffer),
49 "Precondition failed: {} (Condition: {})", description, condition);
50 logging::log_and_throw<precondition_not_satisfied>(
51 source, logger, std::string_view(buffer.data(), buffer.size()));
82 util::source_info_view source, std::string_view condition,
83 const logging::logger& logger,
84 fmt::format_string<Args...> description_format,
85 Args&&... description_args) {
86 fmt::memory_buffer buffer;
87 fmt::format_to(std::back_inserter(buffer), description_format,
88 std::forward<Args>(description_args)...);
90 std::string_view(buffer.data(), buffer.size()));
106 util::source_info_view source, std::string_view condition,
107 fmt::format_string<Args...> description_format,
108 Args&&... description_args) {
109 logging::logger logger;
111 std::forward<Args>(description_args)...);
void handle_precondition_failure(util::source_info_view source, std::string_view condition, const logging::logger &logger, std::string_view description)
Handle a failure of a precondition.