У меня есть тип стручка:Инициализация типов POD с круглыми скобками в VS 2010 невозможна?
struct TexImageParams2D
{
/*! Width of the texture image */
GLsizei width;
/*! Height of the texture image */
GLsizei height;
/*! Pointer to image data */
const GLvoid *pixels;
/*! For efficiency we don't like to sent texture image over and over again.
* \param[in] rhs The new texture params which will be compared with this one
*/
bool operator !=(const TexImageParams2D& rhs)
{
return !(width == rhs.width && height == rhs.height && pixels == rhs.pixels);
}
/*! We check is this struct is instantiated with proper values by checking the data pointer */
bool isActive()
{
return pixels;
}
/*! When this class is reseted we use this method to reset vales */
void clear()
{
width = 0;
height = 0;
pixels = nullptr;
}
};
И это работает в НКУ 4,8
RendererStateTextureUnits::TexImageParams2D temp = RendererStateTextureUnits::TexImageParams2D{ width, height, pixels};
Но мой дорогой против 2010 компилятор кляч, как:
error C2275: 'Graphics::RendererStateTextureUnits::TexImageParams2D' : illegal use of this type as an expression
error C2143: syntax error : missing ';' before '{'
error C2143: syntax error : missing ';' before '}'
Не инициализация пакетиков очень старая функция даже поддерживается в C? Почему VS2010 обманывает? Если VS2010 не поддерживает эту функцию, из которой версия Visual Studio начнет поддерживать инициализацию скобок POD?