Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2008-03-31 03:09:25


Giovanni Piero Deretta wrote:
> On Fri, Mar 28, 2008 at 9:56 PM, Eric Niebler <eric_at_[hidden]> wrote:
>> David Abrahams wrote:
>>> To start with, there's one very basic thing we won't be able to do: name
>>> template specializations that cannot be instantiated, like
>>>
>>> vector<foo(bar)>
>>>
>>> just for DSEL purposes.
>>
>> Ugh! I suppose this would work around the issue:
>>
>> vector<call<foo(bar)>>
>>
>> as long as call<> happened to be Regular.
>>
>
> What about
>
> template<class Wrapped<typename T...>, typename ArgList... >
> class bind;
>
> bind<vector, foo(bar(_1)), _2>
>
> That should work, even if 'Wrapped' requires it template arguments to
> conform to some exotic concept.

Really? It seems to me that this would effectively strip the
requirements from a template, violating the metatype system. Can someone
who knows, comment?

> Or may be something like this:
>
> bind<vector>(foo(bar(_1)), _2)
>
> Untested of course, and I'm not sure how concepts interact with
> template template parameters.

Me neither. Doug? The question is whether this should compile in C++0x:

// Takes an unconstrained template:
template<template<typename T> class S>
struct foo
{};

// A constrained template
template<Regular Value>
struct vector
{};

foo<vector> f; // OK? Prolly not.

Sadly, it looks like because of concepts, in C++0x we're going to lose a
lot of our cute MPL lambda-isms. :-(

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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