Consider I have the following minimal code:
#include
template
struct TData
{
typedef typename boost:
I don't know what's the exact answer, but...
Because of this operator:
operator ptr_t & () { return data; }
there exist already built-in [] operator (array subscription) which accepts size_t as index. So we have two [] operators, the built-in and defined by you. Booth accepts size_t so this is considered as illegal overload probably.
//EDIT
this should work as you intended
template
struct TData
{
ptr_t data;
operator ptr_t & () { return data; }
};