0
結構這似乎微不足道,但在VS2015u3與初始化列表與vs2015u3
h:\lfwin32\lfwin32.h(21): error C2440: 'initializing': cannot convert from 'initializer list' to 'LFWin32::Timer::T'
h:\lfwin32\lfwin32.h(21): note: No constructor could take the source type, or constructor overload resolution was ambiguous
不起作用
namespace Timer {
struct T
{
int milliseconds = 0;
int cmd_id = 0;
};
T init(const HWND hwnd) {
T t = { 0, 0 } ;
return t;
}
}
呼叫者
auto timer = Timer::init();
錯誤,我會認爲這是標準隨着C + + 11以上。有沒有我需要設置的選項?
這不僅僅是自C++ 14以來的一項功能嗎? – Rakete1111