Skip to content

Commit aaf9451

Browse files
committed
no compiler error when printing quantities without units
1 parent af17917 commit aaf9451

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

quantity.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ using is_scaling_string_specialized = typename scaling_traits<S>::is_specialized
749749
template<typename U, typename T>
750750
struct unit_traits {
751751
using is_specialized = std::false_type;
752+
static constexpr const auto& get_string() {return "";}
752753
};
753754

754755
/** Find out whether unit_traits is specialized for a specific unit and tag */
@@ -826,13 +827,12 @@ constexpr static_string<quantity_string_traits<U,S,T>::strlen> quantity_string_t
826827
*
827828
* @tparam U the quantity's unit type
828829
* @tparam S the quantity's scale type
829-
* @tparam V the quantity's value type
830830
* @tparam T the quantity's tag type
831831
*/
832832
template<typename U, typename S, typename T>
833833
struct quantity_traits {
834834
using is_specialized = std::integral_constant<bool, is_scaling_string_specialized<S >::value
835-
and is_unit_string_specialized<U,T>::value>;
835+
and is_unit_string_specialized<U,T>::value>;
836836
static constexpr const auto& get_string() {return detail::quantity_string_traits<U,S,T>::string.array;}
837837
};
838838

0 commit comments

Comments
 (0)