.. _program_listing_file_src_LouLib_Units_Temperature.hpp: Program Listing for File Temperature.hpp ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/LouLib/Units/Temperature.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef LOULIB_TEMPERATURE_HPP #define LOULIB_TEMPERATURE_HPP #include "BaseUnit.hpp" #include "UnitMath.hpp" namespace LouLib { namespace Units { DEFINE_NEW_UNIT(0, 0, 0, 0, 1, 0, 0, 0, Temperature); //base unit constexpr Temperature KELVIN(1.0); inline namespace literals{ #define CREATE_TEMPERATURE_STRING_LITERAL(literal, unit) \ constexpr Temperature operator"" literal(long double x){ \ return static_cast(x)*unit; \ } \ constexpr Temperature operator"" literal(unsigned long long int x){ \ return static_cast(x)*unit; \ } CREATE_TEMPERATURE_STRING_LITERAL(_K, KELVIN); } } } #endif //LOULIB_TEMPERATURE_HPP