Stefan Ram <
r...@zedat.fu-berlin.de> wrote:
>
r...@zedat.fu-berlin.de (Stefan Ram) writes:
>> void print( ::std::string s ){ ::std::cout << s << '\n'; }
>> int main()
>> { print( "alpha" );
>
> And while I'm at it:
>
> Did I got this right:
>
> The initialization of the parameter s above by the argument
> "alpha" (or any other argument expression) is as if by
>
>> :std::string s = "alpha";
>
> ? Or for the call »print( { { "alpha" }} )« as if by
>
>> :std::string s = { { "alpha" }};
>
> ? This seems to be confirmed by the following program
> having similar results as the OP program:
>
> #include <iostream>
> #include <string>
>
> int main()
> { { ::std::string s = "alpha"; }
> { ::std::string s = { "alpha" }; }
> { ::std::string s = { { "alpha" }}; }
> /* { ::std::string s = { { { "alpha" }}}; } */ /* No! */ }
>
> However, in the C++ standard it is the other way round for
> user-defined class types:
>
> The effect of an assignment is being defined by passing the
> operands to an appropriate assignment operator function.
>
> Therefore, argument passing is more fundamental than
> assignment expressions, so one cannot use assignment
> expressions to explain argument passing in a strict text.
>
>
Your absurd habit of writing ::std instead of std continues to irritate
mate; well done.
/Flibble