Consider this code snippet:
std::shared_ptr<...> p = ...;
p->f(std::move(p));
According to cppref, operator -> and () are of the same precedence and are both left-to-right associative. So I presume p-> is evaluated before std::move(), and the snippet should be fine. But VC15 does the opposite and crashes my program. Is this a VC15 bug or I have just got something wrong here?
Aucun commentaire:
Enregistrer un commentaire