simontoth,
@simontoth@hachyderm.io avatar

The std::forward is a conditional r-value (specifically x-value) cast.

std::forward is primarily designed to work in conjunction with universal references and will only cast to an r-value if the template argument isn't an l-value reference type.

Compiler Explorer link: https://compiler-explorer.com/z/E5dcPh6T3

  • All
  • Subscribed
  • Moderated
  • Favorites
  • cpp
  • kavyap
  • thenastyranch
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • InstantRegret
  • Youngstown
  • vwfavf
  • slotface
  • everett
  • osvaldo12
  • rosin
  • khanakhh
  • megavids
  • tester
  • Durango
  • tacticalgear
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • cubers
  • normalnudes
  • modclub
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • All magazines