Files
mp-units/example/alternative_namespaces/units_str.h

11 lines
348 B
C
Raw Normal View History

#pragma once
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
// get at the units text of the quantity, without its numeric value
inline auto constexpr units_str(const units::Quantity auto& q)
{
typedef std::remove_cvref_t<decltype(q)> qtype;
return units::detail::unit_text<typename qtype::dimension, typename qtype::unit>();
}