I get error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const Buffer::byte_t [3]' (or there is no acceptable conversion)
Does anyone know hot to solve the problem? What I want is to initialize/assign the buffer with an fixed size array without the need of an additional variable.
What I wanted t do is to somehow determine the size of an fixed size array at compile time, generate a function from the template and avoid passing the size of the array explicitly to the function. The template parameter would have to be the size of the array.
What I wonder is why the compiler mentions const Buffer::byte_t [3] anyway, shouldn't it be Buffer::byte_t const *?
Thanks for the hint, that was just what I'm looking for.
boost solves the problem by providing a class for each array size (via a template class). As far as I understand, every time I initialize an array with a given size, a new class is deduced from the template. Therefore I'll get many different classes, although only the (initial) size varies. That's not exactly what I'm looking for, but it serves the purpose.
gives me the following errors (but it clears your point):
error C2976: 'boost::array' : too few template arguments
error C2552: 'array' : non-aggregates cannot be initialized with initializer list
You can not omit the T template parameter, only the N (size of the array defaults to 0) template parameter.
Still I have to provide the size of the array by myself . . .
It seems as if it's not possible to let the compiler (or preprocessor) fill in the numbers.