An example of using C++11's user-defined literals to enforce consistent units of measure. Defines two classes - Radians and Degrees - which implicitly convert between each other, and can be used to prevent mismatching units in 3D graphics APIs.
C++
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
degrad.cpp
degrad.h

README.md

DegRad

Example of using user-defined literals and implicit conversions to enforce units of measure in the C++ type system. Example usage can be found in degrad.cpp and for more information on the rationale and design, see this blogpost.

Released under the MIT license. See LICENSE for more details.