I have:
class ANew
{
private:
vector<CustomType> ArrayOfTypes;
public:
ANew() : ArrayOfTypes(0) {}
~ANew() {}
ANew& operator ()(int I)
{
return ArrayOfTypes[I];
}
operator const ANew* () const
{
return ArrayOfTypes;
}
};
But it gives me these errors:
C++\Types.h|12|error: invalid initialization of reference of type 'ANew&' from expression of type 'CustomType'|
C++\Types.h|17|error: cannot convert 'const std::vector<CustomType, std::allocator<CustomType> >' to 'const ANew*' in return|
I don't know if it's possible to overload those operators or if I'm doing it right.. Any help is appreciated.