Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Type_erasure: member function return _self
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2015-11-26 15:15:37


AMDG

On 11/25/2015 07:16 AM, Yuan Yao wrote:
> I want to use Boost.Type_erasure on a member function that returns the type
> itself. With |_self| as the return type, it is OK. However, when the *return
> type* changes to |pair<_self, some_type>|, an error occurs. The following code
> reproduces the problem.
>

  The library can only handle placeholders
at the top level. There is no way to handle
the general case, X<_self> automatically.
This is essentially the same as covariant
return types for virtual functions, which
have similar restrictions.
  To get the effect that you want, you'll
need to define the concept_interface manually.
See
http://www.boost.org/doc/html/boost_typeerasure/concept.html#boost_typeerasure.concept.custom.

In Christ,
Steven Watanabe


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