Add type safety to your frequency calculations.
Single header file, simply download and include it:
#include "frequency.h"
Inspired by the std::chrono::duration class:
frequency<Hz> f1 {5}; // 5 Hz
frequency<KHz> f2 {5}; // 5 KHz
// the smallest unit is inferred:
auto f3 = f1 + f2; // 5505.5 Hz
f1 += f2; // 5005 Hz
f2 += f1; // 10.005 kHz
Requires C++11.
Ensure that you have at least cmake 3.1.0 installed.
mkdir build
cd build
cmake ../
make
./frequency
MIT-licensed. See LICENSE.