[C++-sig] vector_indexing_suite override question

Joel de Guzman joel at boost-consulting.com
Fri Apr 16 09:16:37 CEST 2004


Neal D. Becker wrote:

> I'm trying to wrap my new Ring class, which is a vector-like class.  I was
> hoping to use vector_indexing_suite but override one operator.
> 
> template<class Container>
> struct my_indexing_suite : public vector_indexing_suite<Container> {
>   typedef typename vector_indexing_suite<Container>::index_type index_type;
> 
>    static index_type
>    convert_index(Container& container, PyObject* i_) {
>      throw ("help");
>    }
> };

Hi Neal,

Try informing vector_indexing_suite about your class:

     struct my_indexing_suite :
         vector_indexing_suite<Container, false, my_indexing_suite>

HTH,
-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net




More information about the Cplusplus-sig mailing list