Skip to content

Commit

Permalink
fix(example): treat_as_floating_point specified for `validated_type…
Browse files Browse the repository at this point in the history
…` and `ranged_representation`
  • Loading branch information
mpusz committed Sep 4, 2023
1 parent b6bc943 commit d7261c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/include/ranged_representation.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ class ranged_representation : public validated_type<T, is_in_range_t<T, Min, Max
template<typename T, auto Min, auto Max>
inline constexpr bool mp_units::is_scalar<ranged_representation<T, Min, Max>> = mp_units::is_scalar<T>;

template<typename T, auto Min, auto Max>
inline 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>
struct MP_UNITS_STD_FMT::formatter<ranged_representation<T, Min, Max>> : formatter<T> {
template<typename FormatContext>
Expand Down
4 changes: 4 additions & 0 deletions example/include/validated_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ class validated_type {
template<typename T, typename Validator>
inline constexpr bool mp_units::is_scalar<validated_type<T, Validator>> = mp_units::is_scalar<T>;

template<typename T, typename Validator>
inline 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

0 comments on commit d7261c8

Please sign in to comment.