forked from Alepha/Alepha
29 lines
546 B
C++
29 lines
546 B
C++
static_assert( __cplusplus > 2020'00 );
|
|
|
|
#pragma once
|
|
|
|
#include <Alepha/Alepha.h>
|
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
namespace Alepha::Hydrogen::Utility ::detail:: ScopedState_m
|
|
{
|
|
inline namespace exports
|
|
{
|
|
class ScopedState : boost::noncopyable
|
|
{
|
|
private:
|
|
bool &state;
|
|
|
|
public:
|
|
~ScopedState() { state= false; }
|
|
explicit ScopedState( bool &state ) : state( state ) { state= true; }
|
|
};
|
|
}
|
|
}
|
|
|
|
namespace Alepha::Hydrogen::Utility::inline exports::inline ScopedState_m
|
|
{
|
|
using namespace detail::ScopedState_m::exports;
|
|
}
|