KiCad PCB EDA Suite
Loading...
Searching...
No Matches
always_false< T > Struct Template Reference

A type that is always false. More...

#include <type_helpers.h>

Inheritance diagram for always_false< T >:

Detailed Description

template<typename T>
struct always_false< T >

A type that is always false.

Useful for static_asserts, when 'false' is no good as the compiler likes to believe that the assert could pass in some cases:

if constexpr ( something<T>() ) { // Say we know that this branch must always be chosen. } else { // Even if the above if's are made such this branch is never chosen // compilers may still complain if this were to use a literal 'false'. static_assert( always_false<T>::value, "This should never happen" ); }

Definition at line 45 of file type_helpers.h.


The documentation for this struct was generated from the following file: