
AMDG Roberto Gimenez wrote:
I need something like this:
template <typename Type> struct Array;
But I think boost doesn't have it. boost::array also takes an std::size_t template parameter but that doesn't work for what I want to do because I want to be able to pass a function something like this:
void myFunction(const Array<int> &a) { ... }
void main() {
int myVec1[6] = { 1,2,3,4,5,6 }; int myVec2[2] = { 7,8 };
myFunction(Array<int>(myVec1, 6)); myFunction(Array<int>(myVec2, 2));
}
I can't do this with boost::array and std::vector allocates and I don't want that too. Any help?
You can use iterator_range.
#include