我从here复制粘贴此代码:
#include <boost/math/distributions/poisson.hpp>
namespace boost { namespace math {
template <class RealType = double,
class Policy = policies::policy<> >
class poisson_distribution;
typedef poisson_distribution<> poisson;
template <class RealType, class Policy>
class poisson_distribution
{
public:
typedef RealType value_type;
typedef Policy policy_type;
poisson_distribution(RealType mean = 1); // Constructor.
RealType mean()const; // Accessor.
}
}} // namespaces boost::math
收到编译错误:
expected unqualified-id before »}«
答案 0 :(得分:5)
您需要在类定义的外部闭括号上使用分号。可能是其他的东西,也许你可以粘贴完整的错误和行号
...
RealType mean()const; // Accessor.
}; <---
...
答案 1 :(得分:0)
可能你是C ++的新手。在C ++类定义中以分号结尾(;
)。