I'm declaring a three-dimensional array as a class member, using static const class members as the first two bounds:
class A
{
static const uint8_t screenWidth = 256;
static const uint8_t screenHeight = 240;
uint8_t buffer[screenHeight][screenWidth ][3];
}
in Visual Studio 2019 I get the following (weird?) error:
Error (active) E0098 an array may not have elements of this type
if I resort to the "enum hack" in order to declare class-local compile time integer constants it works:
class A
{
enum { SH = 240, SW = 256};
uint8_t buffer[SH][SW][3];
}
shouldn't the former example be C++11 compliant code? (I guess Visual Studio 2019 compiler is).