cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
Macros
static_assert.hpp File Reference

Implementation details for "static_assert" backport. More...

Macros

#define static_assert(test, msg)   enum { CXXO_JOIN(sassert_e_,__COUNTER__) = 1/(test) }
 Provides an assertion at compile-time. More...
 

Detailed Description

Implementation details for "static_assert" backport.

Macro Definition Documentation

◆ static_assert

#define static_assert (   test,
  msg 
)    enum { CXXO_JOIN(sassert_e_,__COUNTER__) = 1/(test) }

Provides an assertion at compile-time.

Parameters
testThe boolean test to run, must be computable at compile-time
msgThe string literal to provide as a compiler error message if the assertion does not hold
See also
https://en.cppreference.com/w/cpp/language/static_assert

Referenced by cxxomfort::fix::clamp(), cxxomfort::cxxostd::get(), cxxomfort::max(), and unique_ptr< T, D >::unique_ptr().