subscript-operator

How do I access a C++ subscript operator from within the class in which it resides?

Where, ClassA has an operator as such, that returns ClassB: class ClassA { public: ClassA(); ClassB &operator[](int index); } If I want to access said operator from within ClassA's constructor, as so: ClassA::ClassA() { // How do I access the [] operator? } At the moment, as a work-around I'm just using a method called ...

C++ arrays as parameters, EDIT: now includes variable scoping

Alright, I'm guessing this is an easy question, so I'll take the knocks, but I'm not finding what I need on google or SO. I'd like to create an array in one place, and populate it inside a different function. I define a function: void someFunction(double results[]) { for (int i = 0; i<100; ++i) { for (int n = 0; n<16; +...

How do I determine the return type of a given array type's subscript operator with boost?

What type signature would I need to use if I'd like to determine the type returned by an array (T)'s subscript operator using boost? Note that the arrays for which I would be using this do not contain typedefs and are third-party. Example. I want to determine that: SomeArray<int> tmp(1); int& somevalue = tmp[0]; //would equate ty...