
14 Jun
2010
14 Jun
'10
6:18 a.m.
Hi, I am curious. In Boost.Units it is not possible to *initialize* a quantity from a plain value, the closest thing to it is the ::from_value static member function. But ... What is the magic that makes this particular initialization compile? boost::units::quantitysi::length L(0); //compiles and works as expected but *not* these ones: boost::units::quantitysi::length L(1); //does not compile or boost::units::quantitysi::length L(0.); //does not compile (gives a compile error, "no matching function for call to '...::quantity(int/double)') By the way, I think it is a great feature! I am interested to know how is this achieved. Thanks, Alfredo