"David Abrahams" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Thorsten Ottosen" <[EMAIL PROTECTED]> writes:
>
> > my code does not include <vector>, <list> or <map>, but it does need
> > <iterator>.
> >
> > Some of the functionality of the container_traits are shown here:
> >
> >
> > template< typename C >
> > bool is_container()
> > {
> >     return boost::container_traits<C>::is_container();
> > }
>
> ...
>
> Yes, you can take an approach like this one, but it will cause false
> positives in some circumstances.  If that's acceptable for your
> application, then it's a good answer.

I guess you're  thinking about classes with eg. an iterator typedef.
Couldn't the procedure be improved a little by doing something
like


      template< typename C >
     true_t  is_container( const C&, const typename C::iterator& =
      typename C::iterator(),
    const typename C::const_iterator& = typename C::const_iterator(),
    <more of the same here> );

That way we would reduce the likelyhood of false positives a lot. Or would
we?

regards

Thorsten



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to