Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-08-22 14:01:59


"Alex Chovanec" <achovane_at_[hidden]> wrote in message
news:cgapen$tfi$1_at_sea.gmane.org...
>
> "Thomas Witt" <witt_at_[hidden]> wrote in message
> news:cgal5p$lb4$1_at_sea.gmane.org...
>
> > How do you implement that?
>
> Thomas,
>
> I'm using the SFINAE principle. I have two member functions called
'test' in
> 'struct detail::is_iterator_impl', where one of them is a template:
>
> static char (& test(...))[2];
>
> template <typename T>
> static char test(
> T *,
> type_tag<typename T::value_type> * = 0,
> type_tag<typename T::reference> * = 0,
> type_tag<typename T::pointer> * = 0,
> type_tag<typename T::difference_type> * = 0,
> type_tag<typename T::iterator_category> * = 0,

Note that boost already has a facility for detecting member types. See
boost/mpl/aux_/has_xxx.hpp.

Jonathan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk