* Stephen Howe:
> On Tue, 02 Feb 2010 13:59:58 -0500, Victor Bazarov <> wrote:
>
>> Stephen Howe wrote:
>>> is this legal?
>> Don't have a quote from the Standard ready, but somehow I recall that
>> it's not legal. Look through the archives for "instantiate templates
>> incomplete types C++" (or something like that, without quotes).
>
> Thanks Victor. It is not legal
>
> I found Matt Austerns article here
>
> The Standard Librarian: Containers of Incomplete Types
> http://www.drdobbs.com/cpp/184403814
>
> which is useful and good except I dont beleive he is right on one point.
>
> You can have function declarations (not definitions) where the arguments
> and return type are incomplete types.
Yes.
To be precise, Matt Austern, then chair of the library working group of the C++
standardization committee, wrote "You can't pass or return incomplete types by
value, for the same reason that you can't define variables of an incomplete
type.", in the context of function declarations, and that's wrong.
Another case of a well-known expert getting this wrong is the GOTW on PIMPL,
where Herb Sutter, chair of the standardization committee, used std::auto_ptr
with incomplete type...
From which we might conclude that committee chairs don't go well with
incomplete types.
Or, there's something there.
Cheers,
- Alf