私はこのコードを持っています
typedef struct
{
const char* fooString;
const bool fooBool;
}fooStruct;
そして、このイニシャライザ:
static const fooStruct foo[] =
{
{"file1", true},
{"file2", false},
....
};
このコードを使用すると、VS2008 で 3 つの警告が表示されます。
error C2220: warning treated as error - no 'object' file generated
warning C4510: '<unnamed-tag>' : default constructor could not be generated
warning C4512: '<unnamed-tag>' : assignment operator could not be generated
warning C4610: struct '<unnamed-tag>' can never be instantiated - user defined constructor required