lambalicious,

The fact that the solution is not to simply invoke the copy constructor, but to (portably!) write an ungodly mess that uses double-references, full noexcept(noexcept(repeat_of_body)) daisy-chaining, std::forward (a function that doesn’t forward), and probably constexpr, and probably explicit(explicit(…)) daisy-chaining, and probably requires(requires(…)) daisy-chaining, and probably constinit, and probably structured bindings, and probably yet another form of auto, and so on…, demonstrates the problem with C++.

There’s a place for macros, and this example shows it is precisely it. I’d just write MAKE_COPY(x).

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