niconiconi,

"Lambda expressions are objects - their types are classes, so we can inherit from them too."

statements dreamed up by the utterly deranged

whitequark,
@whitequark@mastodon.social avatar

@niconiconi i want to see the context

niconiconi,

@whitequark Hands-On Design Patterns with C++, Fedor G. Pikus, page 51. Apparently it's a One Weird Trick to manipulate lambda functions within templates - just subclass it as if it's a regular base class, then one can do all kind of things like overloading its operator() to have multiple versions...

whitequark,
@whitequark@mastodon.social avatar

@niconiconi what the fuck am I reading

lisyarus,
@lisyarus@mastodon.gamedev.place avatar

@niconiconi @whitequark Imo this trick combined with lambdas is the closest we have in C++ to pattern-matching on sum types

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