P
Protoman
Is there any way I can improve this bounded array class? What other ops
should I overload? How do I use operator() to make multiple subscripts?
Here's the code:
class OutOfBounds{};
template <class T, unsigned long long Size>
class BArray
{
public:
T& operator[](const T& ix)
{
if(ix>=Size||ix<0)
throw OutOfBounds();
else
return myData[ix];
}
private:
T myData[Size];
};
Thanks!!!!
should I overload? How do I use operator() to make multiple subscripts?
Here's the code:
class OutOfBounds{};
template <class T, unsigned long long Size>
class BArray
{
public:
T& operator[](const T& ix)
{
if(ix>=Size||ix<0)
throw OutOfBounds();
else
return myData[ix];
}
private:
T myData[Size];
};
Thanks!!!!