[type_erasure] RFC: New version

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[type_erasure] RFC: New version

Steven Watanabe-4
AMDG

I've just committed an updated version of
my type_erasure library to the sandbox
at http://svn.boost.org/svn/boost/sandbox/type_erasure.

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<
  forward_iterator<>,
  same_type<forward_iterator<>::value_type, _a>,
  copy_constructible<_a>,
  typeid_<_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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [type_erasure] RFC: New version

Dave Abrahams

on Sat May 12 2012, Steven Watanabe <watanabesj-AT-gmail.com> wrote:

> 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.

Just that this looks really, really cool!  I hope you'll show your
design to Sean Parent while you're here at BoostCon/C++Now!
--
Dave Abrahams
BoostPro Computing
http://www.boostpro.com


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [type_erasure] RFC: New version

lcaminiti
In reply to this post by Steven Watanabe-4
Hi Steven,

Steven Watanabe-4 wrote
I've just committed an updated version of
my type_erasure library to the sandbox
at http://svn.boost.org/svn/boost/sandbox/type_erasure.
Can you please commit HTML docs too?

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<
  forward_iterator<>,
  same_type<forward_iterator<>::value_type, _a>,
  copy_constructible<_a>,
  typeid_<_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.
Boost.Generic claims to support the following (but perhaps Matt is no longer developing this library):
Associate Types -- Yes
Associate Functions -- Yes
Multi-type Concepts -- Yes
Concept Maps -- Yes
Archetypes -- Yes
Concept Refinement -- Yes
Typename Deduction -- Yes
Concept-Based Overloading -- Almost

How much of this can your library do?

Thanks a lot!
--Lorenzo
Reply | Threaded
Open this post in threaded view
|

Re: [type_erasure] RFC: New version

Steven Watanabe-4
AMDG

On 05/14/2012 05:21 AM, lcaminiti wrote:
>
> Boost.Generic claims to support the following (but perhaps Matt is no longer
> developing this library):
> Associate Types -- Yes

Yes.

> Associate Functions -- Yes

Yes.

> Multi-type Concepts -- Yes

Yes.

> Concept Maps -- Yes

Yes.

> Archetypes -- Yes

N/A, although any<Concept, Tag> can act like
an archetype.

> Concept Refinement -- Yes

Yes.

> Typename Deduction -- Yes

I'm not sure exactly what this means.

> Concept-Based Overloading -- Almost

N/A.

>
> How much of this can your library do?
>

My library can do everything that's meaningful
for a dynamic library as opposed to static
concept checking.

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [type_erasure] RFC: New version

lcaminiti
Steven Watanabe-4 wrote
My library can do everything that's meaningful
for a dynamic library as opposed to static
concept checking.
Got it, thanks.

What's the status of the docs? It'd be handy if you can commit the built HTML docs.

I'll definitively take a close look at your library.

Thanks.
--Lorenzo
Reply | Threaded
Open this post in threaded view
|

Re: [type_erasure] RFC: New version

Steven Watanabe-4
AMDG

On 05/14/2012 05:38 PM, lcaminiti wrote:

>
> Steven Watanabe-4 wrote
>>
>> My library can do everything that's meaningful
>> for a dynamic library as opposed to static
>> concept checking.
>>
>
> Got it, thanks.
>
> What's the status of the docs? It'd be handy if you can commit the built
> HTML docs.
>

Compiled docs don't belong in version control.
I'll get an online version of the docs up
this weekend.

> I'll definitively take a close look at your library.
>

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [type_erasure] RFC: New version

lcaminiti
Steven Watanabe-4 wrote
> What's the status of the docs? It'd be handy if you can commit the built
> HTML docs.
>

Compiled docs don't belong in version control.
I'll get an online version of the docs up
this weekend.
OK, thanks.

--Lorenzo
Reply | Threaded
Open this post in threaded view
|

Re: [type_erasure] RFC: New version

Vicente Botet
In reply to this post by lcaminiti
Le 15/05/12 02:38, lcaminiti a écrit :

> Steven Watanabe-4 wrote
>> My library can do everything that's meaningful
>> for a dynamic library as opposed to static
>> concept checking.
>>
> Got it, thanks.
>
> What's the status of the docs? It'd be handy if you can commit the built
> HTML docs.
>
> I'll definitively take a close look at your library.
>
Hi Lorenzo,

you can build them

cd libs/type_erasure/doc
bjam

Maybe you need to define where is BOOST and where is bjam if not already
done ;-)

Vicente

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost