etl/docs/utilities/static-assert.md
John Wellbelove b09bb9448e New documentation files.
Harmonised file name format
2026-05-18 07:57:12 +01:00

422 B

title
static assert

{{< callout type="info">}} Header: static_assert.h
{{< /callout >}}

Macro

ETL_STATIC_ASSERT

Either maps on to the built-in static_assert or supplies a suitable definition.

ETL_STATIC_ASSERT(condition, message);

Example

template <typename T>
void Do_This(T value)
{
  ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
}