Unit Conversion and Dimensional Analysis Library 3.6.1
A compile-time, header-only C++23 dimensional-analysis library
Loading...
Searching...
No Matches
units::detail::is_complete< T, class > Struct Template Reference

Whether T is a complete type, decided by SFINAE on sizeof(T) without instantiating any other trait. More...

#include <core.h>

Inheritance diagram for units::detail::is_complete< T, class >:
[legend]
Collaboration diagram for units::detail::is_complete< T, class >:
[legend]

Detailed Description

template<class T, class = void>
struct units::detail::is_complete< T, class >

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.


The documentation for this struct was generated from the following file:
  • /home/runner/work/units/units/include/units/core.h