Boost.Type_erasure: member function return _self
26 Nov
26 Nov
8:15 p.m.
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_typeerasu.... In Christ, Steven Watanabe
3289
Age (days ago)
3290
Last active (days ago)
1 comments
2 participants
participants (2)
-
Steven Watanabe
-
Yuan Yao