具有前缀的Boost.Units和赋值运算符

时间:2016-01-31 21:06:52

标签: c++ boost boost-units

我正在尝试使用Boost.Units并面临以下问题:

#include <boost/units/quantity.hpp>
#include <boost/units/systems/si/prefixes.hpp>
#include <boost/units/systems/si/length.hpp>
using namespace boost::units::si;
using namespace boost::units;

int main()
{
    quantity<length> a(10.0 * centi * meter); //compiles fine
    quantity<length> b = 10.0 * centi * meter; //compiler error
}

由于库的模板性质,错误非常长:error: conversion from 'boost::units::multiply_typeof_helper<boost::units::quantity ...

这是设计,还是我错过了什么?

0 个答案:

没有答案