Slightly surprised that the following didn't compile
#inclue <algorithm>
enum { C = 10 };
int main()
{
char a[C];
std::fill_n(a, C, '\0');
}
Error message points to implementation of std::fill_n and complains that
unary '--' : '' does not define this operator or a conversion to a type
acceptable to the predefined operator
Essentially I think its complaining that it can't modify the value of the
enum C.
Is this correct? I expected the template to be instantiated with an int
which could be modified using operator--.
Replacing enum { C = 10 }; with const int C = 10; does compile.
John
#inclue <algorithm>
enum { C = 10 };
int main()
{
char a[C];
std::fill_n(a, C, '\0');
}
Error message points to implementation of std::fill_n and complains that
unary '--' : '' does not define this operator or a conversion to a type
acceptable to the predefined operator
Essentially I think its complaining that it can't modify the value of the
enum C.
Is this correct? I expected the template to be instantiated with an int
which could be modified using operator--.
Replacing enum { C = 10 }; with const int C = 10; does compile.
John
Comment