refactor: representation concepts refactored + some quantities switched to complex

This commit is contained in:
Mateusz Pusz
2024-11-05 19:09:16 +01:00
parent 1595fca9a9
commit c7303cc5fb
5 changed files with 112 additions and 35 deletions

View File

@ -37,9 +37,10 @@ import std;
#if MP_UNITS_HOSTED
template<typename T>
constexpr bool mp_units::is_scalar<std::complex<T>> = true;
constexpr bool mp_units::is_complex<std::complex<T>> = true;
#endif
namespace {
using namespace mp_units;
@ -268,7 +269,9 @@ static_assert(Representation<double>);
static_assert(!Representation<bool>);
static_assert(!Representation<std::optional<int>>);
#if MP_UNITS_HOSTED
static_assert(Representation<std::complex<float>>);
static_assert(Representation<std::complex<double>>);
static_assert(Representation<std::complex<long double>>);
static_assert(!Representation<std::string>);
static_assert(!Representation<std::chrono::seconds>);
#endif
@ -279,7 +282,7 @@ static_assert(RepresentationOf<double, quantity_character::scalar>);
static_assert(!RepresentationOf<bool, quantity_character::scalar>);
static_assert(!RepresentationOf<std::optional<int>, quantity_character::scalar>);
#if MP_UNITS_HOSTED
static_assert(RepresentationOf<std::complex<double>, quantity_character::scalar>);
static_assert(RepresentationOf<std::complex<double>, quantity_character::complex>);
static_assert(!RepresentationOf<std::chrono::seconds, quantity_character::scalar>);
static_assert(!RepresentationOf<std::string, quantity_character::scalar>);
#endif