0
早上傢伙,我正在運行此代碼,但我得到的錯誤:「預期」{'之前TEMPLATE1「,在」簡單初始化TEMPLATE1inate「行,即使我不'不明白爲什麼這是必需的。預期不合格的錯誤'{'之前TEMPLATE1
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();
}
你是對的,我傻了,錯過了一套BSM構造函數。非常感謝 – FMA