electro 0.4.1
Type-safe electrical units library modeled after std::chrono
Loading...
Searching...
No Matches
electro::quantity_suffix< decibel_unit, Precision > Struct Template Reference

Decibels opt out of the generic SI-prefix suffix machinery. More...

#include <electro/decibel.hpp>

Detailed Description

template<typename Precision>
struct electro::quantity_suffix< decibel_unit, Precision >

Decibels opt out of the generic SI-prefix suffix machinery.

A gain's precision is rendered as decimal places, not as an SI prefix: "10.50dB", never "1050cdB". Leaving this specialization empty makes the generic quantity to_string and formatter unusable for decibel_unit, so the decibel-specific overloads below are the only candidates rather than merely the better-matching ones.

Gains and levels always render in the same unit as {} (dB, or the level's reference symbol such as dBm): a format spec changes only the number formatting. They have no SI prefix family, so the b and s format markers and the base_unit and scaled to_string() tags render in that same unit, with the value in the shortest fixed notation that round-trips.

Definition at line 607 of file decibel.hpp.


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