[type_erasure] Force any to have typedef
Hi, Assume I have the following function template: template <typename Container> typename Container::value_type get_front(const Container& c) { return c.front(); } Is there a way I can force type_erasure::any<> to have a `value_type` typedef? I can create a concept which requires the underlying type to have it, but I'd like to make `any` to have such a typedef. Thanks, Benedek
AMDG On 07/09/2014 03:49 AM, Benedek Thaler wrote:
Assume I have the following function template:
template <typename Container> typename Container::value_type get_front(const Container& c) { return c.front(); }
Is there a way I can force type_erasure::any<> to have a `value_type` typedef? I can create a concept which requires the underlying type to have it, but I'd like to make `any` to have such a typedef.
Specialize concept_interface. See http://www.boost.org/doc/html/boost_typeerasure/concept.html#boost_typeerasu... and http://www.boost.org/doc/html/boost/type_erasure/concept_interface.html In Christ, Steven Watanabe
On Wed, Jul 9, 2014 at 4:34 PM, Steven Watanabe
AMDG
[snip]
Specialize concept_interface. See
http://www.boost.org/doc/html/boost_typeerasure/concept.html#boost_typeerasu... and http://www.boost.org/doc/html/boost/type_erasure/concept_interface.html
In Christ, Steven Watanabe
Thank you, this is exactly what I need! For further reference, here is what I come up with: https://github.com/erenon/pipeline/blob/e2313aeb7d7e9630d81be71a3bd0910bfb93...
participants (2)
-
Benedek Thaler
-
Steven Watanabe