Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Function arguments and braced initializer lists

25 views
Skip to first unread message

Mr Flibble

unread,
Mar 31, 2016, 9:31:39 PM3/31/16
to
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

Mr Flibble

unread,
Mar 31, 2016, 9:35:43 PM3/31/16
to
You appear to be confusing assignment with something that is not
assignment.

/Flibble



Luca Risolia

unread,
Apr 2, 2016, 7:16:08 PM4/2/16
to
Mr Flibble wrote:
> Your absurd habit of writing ::std instead of std continues to irritate
> mate; well done.

+1

also considering that many people showed him that :: before std is
essentially unuseful.

and he also looses potential answers to his questions by obstinately
keeping doing this.

0 new messages