Skip to content

Commit 9c65d14

Browse files
committed
do not define quantities per retag or rescale to prevent overloading failing due to non-deducable contexts
1 parent c2ad784 commit 9c65d14

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

changes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changes
22
=======
33

4+
0.9.1
5+
* do not define quantities per retag or rescale to prevent overloading failing due to non-deducable contexts
6+
47
0.9.1
58
* no compiler error when printing quantities without units
69
* do not print permill as milli_scale "m"

common.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ template<typename V> using liter_per_hour = div_quantity_t<liter<V>, hour<
291291
* @tparam T tag
292292
* @tparam S scale
293293
*/
294-
template<typename V, typename T, typename S=scale_t<1>> using scalar = quantity<dimensionless, S, V, T>;
295-
template<typename V, typename S=scale_t<1>> using fraction = scalar<V, no_tag, S>;
296-
template<typename V> using percent = typename fraction<V>::template rescale_by<centi_scaling>;
297-
template<typename V> using permill = typename fraction<V>::template rescale_by<milli_scaling>;
294+
template<typename V, typename T , typename S=scale_t<1>> using scalar = quantity<dimensionless, S, V, T>;
295+
template<typename V, typename T=no_tag, typename S=scale_t<1>> using fraction = scalar<V, T, S>;
296+
template<typename V, typename T=no_tag> using percent = scalar<V, T, centi_scaling>;
297+
template<typename V, typename T=no_tag> using permill = scalar<V, T, milli_scaling>;
298298
/** @} */
299299

300300
/** @{
@@ -415,7 +415,7 @@ UNLIB_DEFINE_QUANTITY_LITERAL_TRAITS_NOSCALE( square_kilometer , "km2"
415415
UNLIB_DEFINE_QUANTITY_LITERAL_TRAITS_NOSCALE( hectare , "ha" )
416416

417417
UNLIB_DEFINE_QUANTITY_LITERAL_TRAITS_NOSCALE( cubic_millimeter , "mm3" )
418-
//UNLIB_DEFINE_QUANTITY_LITERAL_TRAITS_NOSCALE( cubic_centimet er, "cm3" ) // alias of ml
418+
//UNLIB_DEFINE_QUANTITY_LITERAL_TRAITS_NOSCALE( cubic_centimeter , "cm3" ) // alias of ml
419419
UNLIB_DEFINE_QUANTITY_LITERAL_TRAITS_NOSCALE( cubic_kilometer , "km3" )
420420

421421
UNLIB_DEFINE_QUANTITY_LITERAL_TRAITS_NOSCALE( milliliter , "ml" )

0 commit comments

Comments
 (0)