Is there a sequenced-before relationship between the evaluation of the lhs of the member access operator and the side-effects of its arguments?

Viewed 83

I have read Order of evalution from cppreference, but I couldn't find any rule which concerns this situation. Is this means that there is no sequenced-before relationship or did I miss something? Thanks.

The following code snippet gives an exemple.

#include <memory>

struct Foo {
  void func(std::unique_ptr<Foo>) {}
};

int main() {
  auto ptr = std::make_unique<Foo>();
  ptr->func(std::move(ptr)); // Is this valid?
  return 0;
}
1 Answers
Related