I have the next class and want to initialize _operators array with 0:
//Entity.h
class Entity
{
static const unsigned short operatorTypeColumn = 1;
static const unsigned short outputValueColumn = 4;
private:
mainDataType _operators[operatorsMaxCount][operatorsTableWidth];
}
//Entity.cpp. I thought this should work in C++ v11
Entity::Entity(void) : _operators[operatorsMaxCount][operatorsTableWidth]
{
}
I thought this sold work in C++ v11 but i got error... how can i initialize array with 0.. with ugly for? i don't want make it static
()on your array initializer, and you don't need the dimensions there; only in the decl. I.e. ` : _operator()`. sidenote: terrible name for a member var.operator, you can surely call it something else (opsprings to my mind).