diff --git a/include/scalr/named_quantity/volume.hpp b/include/scalr/named_quantity/volume.hpp index 62cd07a..6a8539f 100644 --- a/include/scalr/named_quantity/volume.hpp +++ b/include/scalr/named_quantity/volume.hpp @@ -50,12 +50,12 @@ struct cubic_meters { struct liters { using dimension = volume_dimension; - using ratio = std::ratio<100>; + using ratio = std::milli; }; struct milliliters { using dimension = volume_dimension; - using ratio = std::ratio<10000>; + using ratio = std::micro; }; template @@ -69,20 +69,20 @@ struct make> { }; template <> -struct make> { +struct make { using type = liters; }; template <> -struct make> { +struct make { using type = milliliters; }; } // namespace unit using cubic_meters = volume>; -using liters = volume>; -using milliliters = volume>; +using liters = volume; +using milliliters = volume; namespace literals { diff --git a/tests/scalr_core.test.cpp b/tests/scalr_core.test.cpp index 481fe5f..34d5ec2 100644 --- a/tests/scalr_core.test.cpp +++ b/tests/scalr_core.test.cpp @@ -230,6 +230,12 @@ TEST_CASE("Named Quantities") { CHECK(80_kg * 9.81_mps2 * 3_m / 5_s == 470.88_W); } + SECTION("Volume") { + CHECK(1_l == 1000_ml); + CHECK(1000_l == 1_m3); + CHECK(0.5_l + 250_ml == 0.75_l); + } + SECTION("Quantity Conversion") { scalr::seconds secs{12}; scalr::minutes mins{4};