Boost logo

Boost :

Subject: Re: [boost] decltype and incomplete types
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-04-08 11:01:20


AMDG

Daniel Walker wrote:
>> // found in some header somewhere
>> struct S;
>> S foo();
>>
>> What is the "declared type" of the expression "foo()"? Obviously, it is S.
>>
>
> It might seem so at first, but consider:
>
> struct S;
> S foo(int);
> int foo(S);
>
> The type of the call expression foo(x) depends on which function is
> statically chosen after overload resolution. Overload resolution may
> not succeed unless/until S is complete.
>

But the completeness of S only affects overload resolution when
it's used as an argument. The fact that the argument of one overload
is the same as the result of another is irrelevant, IMHO.

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