Subject: Re: [boost] Call for interest - BOOST_AUTO_FUNCTION
From: David Abrahams (dave_at_[hidden])
Date: 2010-10-28 05:43:34
At Wed, 27 Oct 2010 19:36:37 -0400,
Matt Calabrese wrote:
> On Sun, Oct 17, 2010 at 10:27 PM, David Abrahams <dave_at_[hidden]> wrote:
> > BTW, seems like you're close enough; it's probably time to integrate
> > concept support for a future BCCL.
> Okay, I've finished support for everything talked about up until this point
> (minus continue try, which is also now called auto try).
> I also have some exciting news (well, exciting to me at least, though I may
> be jumping the gun). During development of the macro, I came up with a way
> to emulate concept-based template overloads, and it should be possible to
> integrate it into the macro, making for a possible, very powerful, BCCL 2.
> By this I mean being able to write, for instance, a function template that
> is overloaded for forward iterators and another that is overloaded for
> random access iterators, while making it unambiguous to call with an
> iterator that explicitly models the random access iterator concept -- I.E.
> the random access iterator version will be picked as a better match, much
> like what you'd use tag dispatching for now and what concept-based template
> overloads would have done in C++ with concepts.
Dude, are you kidding me?! That is too amazing.
Couple of questions:
* What does an explicit concept map look like? You didn't show an
* Can you do concept map templates (e.g. all vector<T>s model
<snip all your other cool stuff>
I love the "break if" thing, too :-)
> which will static_assert when the condition is met, having the text of the
> condition in the static_assert message. Similar behavior would exist for
> (break not some_condition). As a use-case, the first "foo" template (the one
> with the switch) could have ( break not is_forward_iterator< It > ), which
> would trigger a static_assert if you try to call it with something that
> isn't an iterator at all.
Not (break if not is_forward_iterator<...>) ?
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk