[type_erasure] call with multiple placeholders

Hi, I have the following type erasure setup: https://github.com/erenon/pipeline/blob/type_erasure/include/boost/pipeline/... I'd like to make `any` have a method template, `connect_to`, i.e: class any { template <typename T> auto connect_to(const T&) {} } I have a concept, added to the main concept like this: detail::has_connect_to<type_erasure::_self, type_erasure::_a> And also a concept_interface specialization. (Bottom of the file in the link above) The doc says: "When there are multiple placeholders involved, you will have to use tuple, or pass the bindings explicitly, but the substitution still works the same way. " I'm trying to do just like this, but without success. Errors include: error: ‘const struct boost::type_erasure::_self’ has no member named ‘connect_to’ error: ‘apply’ is not a member of ‘boost::pipeline::detail::has_connect_to<boost::type_erasure::_self, boost::type_erasure::_a>’ *error: no matching function for call to ‘call(boost::type_erasure::concept_interface<...[snip]...>`* I think the last one is the core issue, but I can't figure out how to pass the binding properly. I don't know why does concept_interface show up as the first argument. Thanks, Benedek

AMDG On 07/24/2014 04:12 PM, Benedek Thaler wrote:
Hi,
I have the following type erasure setup: https://github.com/erenon/pipeline/blob/type_erasure/include/boost/pipeline/...
I'd like to make `any` have a method template, `connect_to`, i.e:
class any { template <typename T> auto connect_to(const T&) {} }
I'm not exactly sure what you're trying to do, but I'm pretty sure that it's impossible for the same reason that: class Base { template<class T> virtual auto connect_to(const T&) = 0; }; is impossible. What you can do is to define connect_to as void connect_to(any<some_concept, const _self&>); if establish precisely what the requirements on the argument are. In Christ, Steven Watanabe
participants (2)
-
Benedek Thaler
-
Steven Watanabe