Stack Overflow? (Operator Overloading)

Started by
19 comments, last by iMalc 12 years, 11 months ago
And when it isn't a class then it might be worse. Since we know this isn't to be used for a class in this instance, for the purposes of what we have here, we can forego the reference. The ideal situtaion would use a type traits system to do it one way or the other but I'm not going into that here, you can look into the Yasli::vector if you're interested.

[quote='CableGuy']Correct me if I'm wrong but passing the dimensions of the array as a template parameter prevents you from writing something like this:
Array3D<char, width, height, depth> array;

assuming width, height and depth are not const?
Yes it certainly does. You'll note however that in the original post the array was declared as fixed size, so the code makes the same number of assumptions, and leveraging those existing assumptions can lead to greater optimisation opportunities.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms

This topic is closed to new replies.

Advertisement