Boost logo

Boost Users :

From: deb (mandaldebabrata123_at_[hidden])
Date: 2020-03-04 19:13:53


Hello,
I am currently learning about mp11 from the docs . While mpl had an
iterator functionality to get an alias over a type in mp_list it seemed
mp11's mp_rest could be used for a similar task. So I coded up a simple
example of recursing over a type list based on some type check , but am
quite lost trying to make it work . So a possible pseudo code for the above
might be
template<typename list>
struct recurse{
    using rest_of_list=mp_rest<list>;
    using type = typename std::conditional<
        mp_empty<rest_of_list>::value,
        base type here on empty list,
        typename std::conditional<
            some "loop" break condition,
            type on true condition,
            typename recurse<
            rest_of_list >::type
>::type
>::type;
}
Is this even possible or there exists some other method to do the same in
mp11.
Thanks.

--
Sent from: http://boost.2283326.n4.nabble.com/Boost-Users-f2553780.html

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net