p = nullptr;

std::cout  <<  q->>size()  <<  p->>size()  <<  r->>size()  <<  std::endl; // nothing happens??? What does this mean?

Object a{ p->>size() }; // nothing happens???

a.dosomething(); // UB? Never initialized

 

Those error-ignoring functionalities (stops automatically when it encounters a nullptr and nothing happens) are not the typical C++ way or direction IMHO. We want to have proper error handling either with pre-/post-conditions and/or with exceptions or error codes.

Otherwise we get a language and programs, which does something defined in every case, but seldom the thing we wanted.
 

-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Do 25.05.2023 15:32
Betreff: [std-proposals] Fwd: Chaining of the -> operator for std::optional< std::list<T>::iterator >
An: std-proposals <std-proposals@lists.isocpp.org>;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;

But anyway maybe we could have a new operator such as '->>' which
stops when it encounters a nullptr. For example if you do:

   (***p).size();    // undefined behaviour
   p->>size();        // nothing happens