From cf18707c086a1b47600c924ae1f33a379d1d3fb2 Mon Sep 17 00:00:00 2001 From: Claudius Holeksa Date: Tue, 23 May 2023 18:32:59 +0200 Subject: nix: Fixed dev install and moved folders --- src/unit.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/unit.h (limited to 'src/unit.h') diff --git a/src/unit.h b/src/unit.h new file mode 100644 index 0000000..a8e8320 --- /dev/null +++ b/src/unit.h @@ -0,0 +1,49 @@ +#pragma once + +#include "unit_reduction.h" + +namespace kel { +template +struct unit_component {}; + +template +class unit; + +template +class unit...> { +public: + using value_type = StorageT; + + unit() = default; + + unit(const unit...>&) = default; + unit(unit...>&&) = default; + + unit...>& operator=(const unit...>&) = default; + unit...>& operator=(unit...>&&) = default; + + unit(const value_type&); + unit(value_type&&); + + unit...>& operator=(const value_type&); + unit...>& operator=(value_type&&); + + unit...> operator+(const unit...>& rhs); + unit...> operator-(const unit...>& rhs); + + template + typename unit_multiplication...>, unit>::type operator*(const unit& rhs); + + template + typename unit_multiplication...>, typename unit_invert::type>::type operator/(const unit& rhs); + + value_type data() const; +private: + value_type value; +}; + +template +using scalar = unit; +} + +#include "unit.tmpl.h" -- cgit v1.2.3