0

我从这里复制粘贴这段代码:

#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 »}«
4

2 回答 2

5

您需要在类定义的外部右大括号上使用分号。可能是别的东西,也许你可以粘贴完整的错误和行号

...
 RealType mean()const; // Accessor.
}; <---
...
于 2013-06-19T08:32:20.947 回答
0

可能你是 C++ 新手。在 C++ 类定义中以分号 ( ) 结尾;

于 2013-06-19T08:44:49.893 回答