C++ Logo

std-discussion

Advanced search

Re: Positioning the && after the ...

From: Breno Guimarães <brenorg_at_[hidden]>
Date: Thu, 30 Nov 2023 09:26:53 -0300
I think that was a mistake from C that C++ had to inherit. Irrelevant
though. The syntax is "T&&..." so you can just use that and move on.

On Thu, Nov 30, 2023 at 8:33 AM Frederick Virchanza Gotham via
Std-Discussion <std-discussion_at_[hidden]> wrote:

> On Thu, Nov 30, 2023 at 10:58 AM Giuseppe D'Angelo wrote:
> >
> > Il 30/11/23 11:26, Frederick Virchanza Gotham via Std-Discussion ha
> scritto:
> > > The syntax of Func1 makes more sense because we have to define
> > > variables as follows:
> > >
> > > int &&a = monkey, &&b = donkey, &&c = fish;
> > >
> > > That is to say: The '&&' goes with the name -- not with the type.
> >
> > It goes with the type.
>
>
> No it doesn't.
>
> int array[64u];
>
> int (&array2)[64u] = array;
>
> If you want something to be a reference or a pointer, you put the
> asterisk or the ampersand with the _name_.
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
>

Received on 2023-11-30 12:27:05