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
typename subscript_result<SomeArray<int> >::type somevalue = tmp[0];
Something like
template<class T>
struct subscript_result
{
typedef boost::result_of<T::operator[](typename T::difference_type)>::type type;
};
? I've always had trouble with operator[] in type signatures. :|
Thank you!