45#include <gtest/gtest.h>
119 throw std::runtime_error(
"test exception");
121 catch (
const std::runtime_error&)
137 throw std::runtime_error(
"test exception");
139 catch (
const std::runtime_error&)
372 explicit Cleanup(
bool& f) : flag(f) {}
373 void operator()() { flag =
true; }
386 std::function<
void()> cleanup = [&called]() { called =
true; };
410 std::vector<int>
log;
RAII guard for exception-safe resource cleanup.
void free_function_cleanup(bool &flag)
RAII guard for graph algorithm initialization.
void release() noexcept
Release the guard - cleanup will not be called.
__gmp_expr< T, __gmp_unary_expr< __gmp_expr< T, U >, __gmp_log_function > > log(const __gmp_expr< T, U > &expr)
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
auto make_init_guard(CleanupFunc f)
Create an Init_Guard with a cleanup function.