TEMPLATE1之前'{'预期的非限定错误
expected unqualified error '{' before TEMPLATE1
早上的家伙,我正在运行此代码,但是我会收到错误:"预期" {'template1'',即使我不don',即使我不喜欢template1inate"。t了解为什么需要它。
class MIXIM_API TEMPLATE1 : public cObject
{
public:
/** @brief Constant with all values set to 0. */
static const TEMPLATE1 ZERO;
public:
BasicSafetyMessage BSM;
private:
void copy(const TEMPLATE1& other) { BSM = other.BSM; }
public:
/** @brief Default constructor. */
TEMPLATE1()
: BSM {}
/** @brief Initializes a TEMPLATE1inate. */
TEMPLATE1( BasicSafetyMessage bsm )
: BSM(bsm) {}
/** @brief Initializes TEMPLATE1inate from other TEMPLATE1inate. */
TEMPLATE1(const TEMPLATE1& other)
: cObject(other) { copy(other); }
/** @brief Returns a string with the value of the TEMPLATE1inate. */
std::string info() const;
};
inline std::ostream& operator<<(std::ostream& os, const TEMPLATE1& TEMPLATE1)
{
return os << "(" << TEMPLATE1.BSM << ")";
}
inline std::string TEMPLATE1::info() const {
std::stringstream os;
os << *this;
return os.str();
}
TEMPLATE1()
: BSM {}
我不知道这应该做什么。您缺少一组()
或一组{}
或我无法猜到的其他东西。
这是一个空的默认构造函数,使用BSM的默认构造函数:
TEMPLATE1()
{
}
我认为你想要那个。
相关文章:
- Arduino:for/while/if在void setup()或void loop()之前?——错误:之前需要不合格
- 在C++中出现错误之前,无效使用了不完整的类型和所需的类型说明符
- 令牌 C++ 错误之前'['非限定 ID
- 在 C++ 中出现unique_ptr错误之前的预期类型说明符
- 修复令牌错误之前';'预期的非限定 ID
- "{"标记错误之前的预期主表达式
- C++错误";"之前'endl'如何修复它?
- 标记简单错误之前的预期主表达式
- C++:在原型中声明"auto"函数返回类型仍然会导致在扣除错误之前使用"auto&quo
- 令牌"("错误之前缺少 QT 二进制运算符
- { 错误之前的预期类名
- 我的代码出现错误:错误:“”之前应为主表达式代币
- 错误:“.”之前应为不合格的idtoken-std::vector
- 令牌错误之前"{"预期类名
- 在C++中'case'开关大小写错误之前的预期'{'
- 枚举数组错误之前的预期主表达式
- “{”标记错误之前的预期类名
- 标识符错误之前缺少';' - 无法运行 MPI 示例
- 令牌错误之前的预期主表达式'<'
- 字符串常量C++错误之前应为标识符