COMP6771 Week 9.2

Revision

std::forward

Hidden friends

  • Because of ADL, the compiler looks inside the class of the arguments
  • Hidden friends prevent implicit conversions
    • A function that would be viable via conversion cannot be found, because ADL doesn't look inside the class
  • Declaring a friend inside the class doesn't solve this issue, because the definition is external (and hence available to ADL)
  • https://www.justsoftwaresolutions.co.uk/cplusplus/hidden-friends.html

Function callbacks with std::function

Text

Lvalues and rvalues

Text

COMP6771 19T2 - 9.2 - Revision

By cs6771

COMP6771 19T2 - 9.2 - Revision

  • 146
Loading comments...

More from cs6771