Hello, I believe P2826R0 should also be seen/discussed from the viewpoint of interface implementation.

Say QSize wants to implement an interface, which expects a "property-like", unified access in the form of `int width() const` and `void width(int)` required for a tool or a library.

Then QSize could do `width(int) = setWidth`, overloading the existing width() const.

Sure, here the argument is just an int, but for more complicated arguments, the motivation of P2826R applies.

In general, zero overhead function renaming could even be one of the stepping stones of some sort of out of class protocol/concepts implementation. 
We will need a way to point to the real implementation w/o wrapping - be it in-class or not (which will be the case of the default implementation).

Handwavy scratch:

class interface Swappable {
  void swap(this Swappable&, Swappable&) = std::swap; //< default impl
};

class QVector {...};

QVector : Swappable { //< out of calss
   void swap(this Swappable&, Swappable&) = QVector::swap; //< specific impl
};




Няма вирусиwww.avast.com