2020-11-24

    Comparisons, Friends, ADL Comparisons, Friends, ADL Comparisons, Friends, ADL

    Follow @hackingcpp on twitter so you don't miss any updates.

    • how to make your own types comparable
    • principles: equivalence, equality, incomparability, …
    • C++20operator == (T const&) = default;
    • C++20operator <=> for 3-way comparisons
    • C++20 comparison categories
    • split an abstraction into several friend types with (mutual) private access
    • keep members hidden from any other type/function except for its friends
    • write free-standing friend functions that can act like member functions
    • prevent implicit argument conversions
    • introduced the distinction between C++'s abstract memory model and its practical realizations (like stack/heap paritionining)
    • added an explanation of different object storage duration types