The following class should be used as an index into an ordinary array or std::vector. It basically helps with adress calculation for access into an array from a C interface.
class Index
{
public:
int data;
inline void manipulate(Argument arg){
// do some manipulation on data
}
};
What is the right way to achieve an automatic conversion in order to use statements like:
Index myIndex;
...
a[myIndex] = A(...)
f(myIndex); // f is defined as f(int idx){...}
Side question: Will this class use exactly the storage for one int?