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.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.
[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?
Stack Overflow? (Operator Overloading)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement