我正在更新一个旧的 C++ 应用程序,它是用 MSVC 2013 编译的,而不是我知道的最新版本。
我收到警告:
1>c:\fraenkelsoftware-millikan\shared\debug\debughelper.h(84): warning C4512: 'HowLong' : assignment operator could not be generated
1> c:\fraenkelsoftware-millikan\shared\debug\debughelper.h(65) : see declaration of 'HowLong'
这是类原型:
class HowLong {
public:
/// \param Duration of what we are trying to measure
HowLong(const std::string &a_str, IDebug::Severity a_sev = Sev_Debug):
m_start(boost::posix_time::microsec_clock::universal_time()),
m_str(a_str), m_sev(a_sev) {
}
/// Destructor outputs how long the object was alive
~HowLong() {
boost::posix_time::time_duration elapsed(boost::posix_time::microsec_clock::universal_time() - m_start);
DEBUG_LOG(m_sev, m_str + " took: " + boost::posix_time::to_simple_string(elapsed));
}
private:
const boost::posix_time::ptime m_start; ///< Start time
const std::string m_str; ///< Duration of what we are trying to measure
const IDebug::Severity m_sev;
};
我以前没有看到过这个警告,我不确定它的实际含义是什么?