In standard c++ we can write :
int myArray[5] = {12, 54, 95, 1, 56};
I would like to write the same thing with a template :
Yet another solution which doesn't need adder class template. Now you can do this:
int main() {
Array array;
array = 1,2,3,4,5,6,7,8,9,10;
for (size_t i = 0 ; i < array.Size() ; i++ )
std::cout << array[i] << std::endl;
return 0;
}
Output:
1
2
3
4
5
6
7
8
9
10
Here is the complete solution: http://www.ideone.com/I0L1C