Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-03-28 14:34:49


AMDG

David Abrahams wrote:
> on Fri Mar 28 2008, Steven Watanabe <watanabesj-AT-gmail.com> wrote:
>
>
>> It can break today under certain conditions.
>>
>> http://lists.boost.org/boost-users/2006/11/23322.php
>>
>
> 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.

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

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

In Christ,
Steven Watanabe


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