|
Unit Conversion and Dimensional Analysis Library 3.6.1
A compile-time, header-only C++23 dimensional-analysis library
|
Whether T is a complete type, decided by SFINAE on sizeof(T) without instantiating any other trait. More...
#include <core.h>
Whether T is a complete type, decided by SFINAE on sizeof(T) without instantiating any other trait.
std::is_base_of<Base, T> is ill-formed when T is an incomplete, non-same class type (a conforming library — libc++ — rejects it). is_unit must stay usable as a SFINAE probe on arbitrary foreign types, and one such type is a standard-library class caught mid-definition: libc++'s <chrono> evaluates every std::common_type partial specialization while std::chrono::duration is still incomplete, which would instantiate is_base_of<_unit, duration> on the incomplete duration. Gating the base-of test on completeness avoids that.