Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-02-08 09:53:49

----- Original Message -----
From: "rogeeff" <rogeeff_at_[hidden]>
> There is one small flaw with current implementation: it could lie
> sometimes about resulting iterator category. Does anybody know
> elegant way to deduce most restrictive category of two provided?

#include <boost/detail/select_type.hpp>

// needs workarounds for codewarrior 7
template <class C1, class C2>
struct most_restrictive
    BOOST_STATIC_ASSERT((is_convertible<C1,C2>::value ||

    typedef typename detail::if_true<
>::template then
 // else
        , C1
>::type type;

Boost list run by bdawes at, gregod at, cpdaniel at, john at