1
0
forked from Alepha/Alepha
Files
Alepha/assertion.h

33 lines
586 B
C++

static_assert( __cplusplus > 2020'99 );
#pragma once
#include <Alepha/Alepha.h>
#include <Alepha/Exception.h>
namespace Alepha::Hydrogen ::detail:: assertion_m
{
inline namespace exports
{
class ProgrammerExpectationViolation : public virtual Violation {};
inline void
assertion( const bool b )
{
#ifndef NDEBUG
if( not b )
{
throw build_exception< ProgrammerExpectationViolation >(
"Expectation violated." );
}
#endif
}
}
}
namespace Alepha::Hydrogen::inline exports::inline assertion_m
{
using namespace detail::assertion_m::exports;
}