Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

This library provides a single type that can be used to represent any physical SI unit. It provides automatic type safety by ensuring values of differing types can not be operaterated on in illegal ways. For instance, distance + velocity would generate an compile-time error; where as distance + velocity * time is a legal expression.

Example

auto position = Meter<float>(15);
auto velocity = Velocity<float>(10);
auto time     = Second<float>(2);

auto fubar  = position + velocity; //<-- Compilation error
auto result = position + velocity * time;

std::cout << float(result); // "45"

About

SI unit library. Provides types and functionality to support compile-time dimentional analysis checking.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages