dimval 0.2.0
Modern C++23 header-only library of dimensional values (units, measures, ranges)
Loading...
Searching...
No Matches
dimval::IUnitValue Class Referenceabstract

Polymorphic interface implemented by every UnitValue<U,T>. More...

#include <interface.hpp>

Inheritance diagram for dimval::IUnitValue:

Public Member Functions

virtual UnitDescriptor descriptor () const noexcept=0
 Full descriptor — read individual fields (descriptor().id, ...) from here.
 
virtual double numeric_as_double () const noexcept=0
 Numeric value as a double (lossy for >double types).
 
virtual std::string to_string () const =0
 Render <value> <symbol> (or whatever the descriptor's formatter dictates).
 
virtual std::string to_formatted_string () const =0
 Render with the descriptor's default precision applied.
 
virtual std::unique_ptr< IUnitValueclone () const =0
 Deep copy as the interface type — the moral equivalent of a virtual copy ctor.
 

Detailed Description

Polymorphic interface implemented by every UnitValue<U,T>.


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