41 {
"cm", { 0.01,
UnitSI().
m() } },
42 {
"dm", { 0.1,
UnitSI().
m() } },
44 {
"min", { 60,
UnitSI().
s() } },
45 {
"h", { 3600,
UnitSI().
s() } },
46 {
"d", { 24*3600,
UnitSI().
s() } },
47 {
"y", { 365*24*3600,
UnitSI().
s() } },
68 for (
it=base_units_map.begin();
it!=base_units_map.end(); ++
it) {
69 if (
it->first.at(0)==
'*') {
70 std::string shortcut =
it->first.substr(1);
71 double coef =
it->second.coef_;
74 std::string key = prefix_it->first + shortcut;
75 units_map_.insert(std::pair<std::string, DerivedUnit>( key, { coef*prefix_it->second,
it->second.unit_ } ));
78 units_map_.insert( std::pair<std::string, DerivedUnit>(
it->first,
it->second ) );
97 typedef spirit_namespace::position_iterator< std::string::iterator > PosnIterT;
99 std::string::iterator begin = s.begin();
100 std::string::iterator end = s.end();
102 const PosnIterT posn_begin( begin, end );
103 const PosnIterT posn_end( end, end );
108 spirit_namespace::parse( begin, end,
110 spirit_namespace::space_p );
112 }
catch (ExcInvalidUnit &e) {
113 e << EI_UnitDefinition(s);
126 Formula &formula = unit_data.find(
"")->second;