Boost logo

Boost Users :

Subject: [Boost-users] [type_erasure] member function return any
From: Mikhail Strelnikov (mikhail.strelnikov_at_[hidden])
Date: 2017-03-06 11:59:07


Hello!

I want to return type_erasure::any from a member function of a struct
adapted by that same any. How can I do this?

#include <boost/type_erasure/any.hpp>
#include <boost/type_erasure/callable.hpp>

using my_any = boost::type_erasure::any<
    boost::mpl::vector<
        boost::type_erasure::copy_constructible<>,
        boost::type_erasure::assignable<>,
        boost::type_erasure::callable<? ? ?>
>
>;

struct s
{
    my_any operator()(my_any v)
    {
        return v;
    }
};

int main()
{
    my_any t = s{};
    t = t(t);
}

Thanks.


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