10

I have been trying to understand std::move. This doc describes it nicely. But it says in the example section "..... while bar loses its value, and now is in a valid but unspecified state .....". Lots of other docs also use this terminology in the same context. Also, I found lots of answers on stackoverflow related to it. This is an exactly same question. But it does not talk about "What being unspecified means?"

So my questions are?

What does being valid but unspecified means?

What will be its effect on a pointer variable (ClassA* ptr)?

And what will be the effects on the object being pointed by the variable?

Thanks.

Community
  • 1
  • 1
PHcoDer
  • 1,166
  • 10
  • 23
  • Note that moving from a raw pointer is the same as copying from it. The pointer is not changed. – aschepler Apr 14 '17 at 17:34
  • 2
    @CoryKramer I did read answers to the question you are pointing. But no one there talks about what being unspecified means. – PHcoDer Apr 14 '17 at 17:36
  • @aschepler Thanks. You mean it's same as copying the value of the pointer variable. Right? So it will have no effect on the object, it is pointing to. Right? – PHcoDer Apr 14 '17 at 17:41
  • @CoryKramer, I came from that above-mentioned "What can I do with a moved-from object?" ("duplicate") question _exactly_ because that one has only referred to, and quoted, and "speculated" about that "unspecified but valid", instead of ever defining it properly. – Sz. Jul 14 '19 at 13:53

0 Answers0