Boost logo

Boost :

Subject: [boost] [type_erasure] RFC: New version
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-05-12 22:49:46


I've just committed an updated version of
my type_erasure library to the sandbox

Highlights of this version:

* Simplified primitive concept definitions.
  Now, all it takes is:

template<class T = _self>
struct incrementable {
    static void apply(T& t) { ++t; }

* Support for associated types
  and same_type. This allows
  defining iterator concepts
  in a uniform way:

typedef mpl::vector<
  same_type<forward_iterator<>::value_type, _a>,
> concept;

std::vector<int> vec(10);
for(any<concept> first(vec.begin()), last(vec.end());
  first != last; ++first)
    std::cout << any_cast<int&>(*first) << std::endl;

Now, _a automatically binds to int.

The core library is now feature complete.
Once I finish updating the iterator
concepts, I think this should be ready
for a formal review. Any thoughts, comments,
or criticism is greatly appreciated.

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at