
"Eric Niebler" <eric@boost-consulting.com> wrote in message news:<475A0ED4.1010307@boost-consulting.com>...
template< typename T, typename U = proto::is_proto_expr > struct vector2;
template< typename T > struct vector2<T[3]> { BOOST_PROTO_EXTENDS(typename proto::terminal<T[3]>::type, vector2<T[3]>, VectorDomain)
typedef T value_type;
T & operator [](std::size_t i) { return proto::arg(*this)[i]; }
T const & operator [](std::size_t i) const { return proto::arg(*this)[i]; } };
// Tell proto that in the VectorDomain, all // expressions should be wrapped in vector_expr<> struct VectorDomain : proto::domain< proto::pod_generator< vector_expr > , VectorGrammar > { };
Thanks, this works great. The only problem is that vector<> is intended as a wrapper class, and I just implemented it as an array for convenience in this example. It could have any underlying type, not necessarily an array. Is there a proper way to do this without exposing vector<>'s underlying type?