Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #87994

Re: R-value references and std::forward

From Andrey Tarasevich <andreytarasevich@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: R-value references and std::forward
Date 2022-12-17 10:55 -0800
Organization A noiseless patient Spider
Message-ID <tnl3bf$3na58$1@dont-email.me> (permalink)
References <6d19a662-76a1-4925-bd07-b259836f062bn@googlegroups.com>

Show all headers | View raw


On 12/14/2022 12:44 AM, Frederick Virchanza Gotham wrote:
> Is the behaviour undefined because of my use of 'forward' on Line #22? 

No. Why would it be? The behavior of `std::forward<>` is well-specified. 
Regardless of how and where you use it, it will simply behave in 
accordance with its specification.

> Should 'forward' only be used with a so-called 'template parameter forwarding reference'?

Yes, it probably should. That's what it's for.

-- 
Best regards,
Andrey

Back to comp.lang.c++ | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

R-value references and std::forward Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2022-12-14 00:44 -0800
  Re: R-value references and std::forward Bo Persson <bo@bo-persson.se> - 2022-12-14 10:26 +0100
    Re: R-value references and std::forward Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2022-12-14 01:48 -0800
      Re: R-value references and std::forward Bo Persson <bo@bo-persson.se> - 2022-12-14 12:42 +0100
        Re: R-value references and std::forward Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2022-12-14 06:46 -0800
          Re: R-value references and std::forward Öö Tiib <ootiib@hot.ee> - 2022-12-15 05:48 -0800
      Re: R-value references and std::forward Juha Nieminen <nospam@thanks.invalid> - 2022-12-14 12:41 +0000
        Re: R-value references and std::forward Bonita Montero <Bonita.Montero@gmail.com> - 2022-12-15 19:03 +0100
  Re: R-value references and std::forward Bonita Montero <Bonita.Montero@gmail.com> - 2022-12-15 16:39 +0100
  Re: R-value references and std::forward Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-17 10:55 -0800

csiph-web