Boost logo

Boost :

Subject: Re: [boost] Abstract STL Container Adaptors
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-03-14 22:36:02


AMDG

On 03/14/2013 04:07 PM, Andy Jost wrote:
>> I really cannot follow this.
>>
>> If the container is type erased, how do you get that information you are alluding to back out?
>
> Here's a very rough sketch demonstrating just one member (set::count). Many details are ignored, obviously.
>
> <snip>
>> There are plenty of papers and implementations of any_iterator out there.
>> Why is that not sufficient for your needs?
>
> I want the container, not just an iterator. I might want to test for membership or add elements to the container.
>

BOOST_TYPE_ERASURE_MEMBER(has_count, count);
template<class T>
using abstract_set =
  boost::type_erasure::any<has_count<std::size_t(const T&)>, _self&>;

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk