Skip to content

Commit

Permalink
feat(example): treat_as_floating_point specializations for examples…
Browse files Browse the repository at this point in the history
…' types removed
  • Loading branch information
mpusz committed Oct 26, 2024
1 parent 48fcbb8 commit 76057ea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
4 changes: 0 additions & 4 deletions example/include/ranged_representation.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ class ranged_representation : public validated_type<T, is_in_range_t<T, Min, Max
template<typename T, auto Min, auto Max>
constexpr bool mp_units::is_scalar<ranged_representation<T, Min, Max>> = mp_units::is_scalar<T>;

template<typename T, auto Min, auto Max>
constexpr bool mp_units::treat_as_floating_point<ranged_representation<T, Min, Max>> =
mp_units::treat_as_floating_point<T>;

template<typename T, auto Min, auto Max, typename Char>
struct MP_UNITS_STD_FMT::formatter<ranged_representation<T, Min, Max>, Char> : formatter<T, Char> {
template<typename FormatContext>
Expand Down
3 changes: 0 additions & 3 deletions example/include/validated_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ class validated_type {
template<typename T, typename Validator>
constexpr bool mp_units::is_scalar<validated_type<T, Validator>> = mp_units::is_scalar<T>;

template<typename T, typename Validator>
constexpr bool mp_units::treat_as_floating_point<validated_type<T, Validator>> = mp_units::treat_as_floating_point<T>;


template<typename CharT, typename Traits, typename T, typename Validator>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
Expand Down
7 changes: 2 additions & 5 deletions example/measurement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,9 @@ class measurement {

} // namespace

template<class T>
constexpr bool mp_units::treat_as_floating_point<measurement<T>> = mp_units::treat_as_floating_point<T>;

template<class T>
template<typename T>
constexpr bool mp_units::is_scalar<measurement<T>> = true;
template<class T>
template<typename T>
constexpr bool mp_units::is_vector<measurement<T>> = true;

static_assert(mp_units::RepresentationOf<measurement<double>, mp_units::quantity_character::scalar>);
Expand Down

0 comments on commit 76057ea

Please sign in to comment.