forked from Alepha/Alepha
Assertion facility.
This commit is contained in:
30
assertion.h
Normal file
30
assertion.h
Normal file
@ -0,0 +1,30 @@
|
||||
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 )
|
||||
{
|
||||
if( not b )
|
||||
{
|
||||
throw build_exception< ProgrammerExpectationViolation >(
|
||||
"Expectation violated." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Alepha::Hydrogen::inline exports::inline assertion_m
|
||||
{
|
||||
using namespace detail::assertion_m::exports;
|
||||
}
|
Reference in New Issue
Block a user