Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-03-28 15:53:51

on Fri Mar 28 2008, Steven Watanabe <> wrote:

> David Abrahams wrote:
>> on Fri Mar 28 2008, Steven Watanabe <> wrote:
>>> It can break today under certain conditions.
>> I don't understand how that is a case of what I'm describing. It looks
>> like a simple instantiation failure.
> Yep. The problem turns out to be that ADL causes msvc to instantate
> all the template parameters recursively.

> The result is that any constructs
> involving templates that cannot be instantiated cannot safely appear
> in the interfaces of non-metafunction class templates.

Actually I think they can if you wrap them appropriately:

instead of

  foo<_1, _2>

you write:


I don't think function types have associated namespaces, do they?

> This means that using MPL lambda expressions as a replacement for
> template template parameters for instance doesn't work in general.

Bleah, that's ugly.

>> In C++0x you won't even be able to
>> write
>> typedef vector<foo(bar)> x;
>> without getting an error.
> And this is better than the possibility of obscure errors when
> the compiler unexpectedly instantiates vector<foo(bar)>

It's "better" as long as you're not trying to do the kinds of things we
do with MPL lambdas and related constructs like many of those that
appear in Proto.

Dave Abrahams
Boost Consulting

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