IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 8c4010b4 authored by Ralf M Ulrich's avatar Ralf M Ulrich
Browse files

cast dimensionless_d to integral type

parent 7e9e84f6
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
#include <utility> // std::declval #include <utility> // std::declval
#include <type_traits> // std::enable_if
/// namespace phys. /// namespace phys.
...@@ -358,6 +359,10 @@ namespace phys { ...@@ -358,6 +359,10 @@ namespace phys {
static constexpr quantity zero() { return quantity{value_type(0.0)}; } static constexpr quantity zero() { return quantity{value_type(0.0)}; }
// static constexpr quantity zero = quantity{ value_type( 0.0 ) }; // static constexpr quantity zero = quantity{ value_type( 0.0 ) };
// RU, added conversion to T (often: double) for dimensionless_d
template <typename DIM=Dims, std::enable_if_t<std::is_same_v<DIM, dimensionless_d>, int> = 0>
operator T() { return m_value; }
private: private:
/** /**
* private initializing constructor. * private initializing constructor.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment