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

SFINAE-able trait that maps a conversion_factor to its strengthened type. More...

#include <core.h>

Public Types

using type = decltype(strong_name(static_cast<T*>(nullptr)))

Detailed Description

template<ConversionFactorType T>
requires std::is_same_v<T, std::remove_cv_t<T>>
struct units::traits::strong< T >

SFINAE-able trait that maps a conversion_factor to its strengthened type.

If T is a cv-unqualified conversion_factor, the member type alias names the strong type alias of T, if any, and T otherwise. Otherwise, there is no type member.

The strong type of a conversion_factor is registered by its dimension header (e.g. units/frequency.h registers hertz for 1/time). Resolution is an ADL customization point (units::detail::strong_name), NOT an explicit specialization of strong: a named type is discovered by overload resolution over the conversion_factor's associated namespace at the point strong_t<T> is instantiated. This deliberately avoids the "explicit specialization after implicit instantiation" ordering trap (#357) — forming an expression that reduces to a not-yet-included dimension no longer bakes in a decision a later header would contradict; the later header simply contributes a better overload.


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