.. _program_listing_file_src_LouLib_Units_Velocity.hpp: Program Listing for File Velocity.hpp ===================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/LouLib/Units/Velocity.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef LOULIB_VELOCITY_HPP #define LOULIB_VELOCITY_HPP #include "BaseUnit.hpp" #include "UnitMath.hpp" #include "Length.hpp" #include "Time.hpp" namespace LouLib{ namespace Units{ DEFINE_NEW_UNIT(1, 0, -1, 0, 0, 0, 0, 0, Velocity); constexpr Velocity METER_PER_SECOND = METER / SECOND; constexpr Velocity FOOT_PER_SECOND = FOOT / SECOND; inline namespace literals{ #define CREATE_VELOCITY_STRING_LITERAL(literal, unit) \ constexpr Velocity operator"" literal(long double x){ \ return static_cast(x)*unit; \ } \ constexpr Velocity operator"" literal(unsigned long long int x){ \ return static_cast(x)*unit; \ } CREATE_VELOCITY_STRING_LITERAL(_mps, METER_PER_SECOND); CREATE_VELOCITY_STRING_LITERAL(_fps, FOOT_PER_SECOND); } } } #endif //LOULIB_VELOCITY_HPP