class poisson_distributio-6ren">
gpt4 book ai didi

c++ - 为什么我从编译器得到 "expected unqualified-id before »}«"?

转载 作者:太空宇宙 更新时间:2023-11-04 16:20:36 26 4
gpt4 key购买 nike

我从 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 »}«

最佳答案

您需要在类定义的外大括号上使用分号。不过也可能是其他原因,也许您可​​以粘贴完整的错误和行号

...
RealType mean()const; // Accessor.
}; <---
...

关于c++ - 为什么我从编译器得到 "expected unqualified-id before »}«"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17186452/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com