33#ifndef AH_INIT_GUARD_H
34#define AH_INIT_GUARD_H
78template <
typename CleanupFunc>
129 other.released =
true;
148 other.released =
true;
155template <
typename CleanupFunc>
168template <
typename CleanupFunc>
RAII guard for graph algorithm initialization.
void release() noexcept
Release the guard - cleanup will not be called.
bool is_released() const noexcept
Check if the guard has been released.
Init_Guard(Init_Guard &&other) noexcept
Move constructor.
Init_Guard(CleanupFunc f)
Construct guard with cleanup function.
Init_Guard(const Init_Guard &)=delete
Non-copyable.
Init_Guard & operator=(Init_Guard &&other) noexcept
Move assignment operator.
Init_Guard & operator=(const Init_Guard &)=delete
~Init_Guard()
Destructor calls cleanup if not released.
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.