TEMPLATE1之前'{'预期的非限定错误

expected unqualified error '{' before TEMPLATE1

本文关键字:错误 之前 TEMPLATE1      更新时间:2023-10-16

早上的家伙,我正在运行此代码,但是我会收到错误:"预期" {'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()
{
}

我认为你想要那个。