title: Check if std::move is done on container
body: <p>Is there any way I can check is std::move done on some STL container?</p>
  
  <p>I have two types of classes (lets say A and B), they keep (some) instances of another class in their internal container. If instance of A keeps instance of B in it's container, that instance of B have to keep the same instance of A in it's container, too.</p>
  
  <p>A can see B's private methods (B has it as it's friend), but I have to implement move constructor on B. As B can see both's internal container, I've implemented B does all adding and removing for both classes.</p>
  
  <p>Problem is: <br />
  I have to implement move constructor for A, and use stl::move on that container. After container is moved to new instance of an A, only way to notify B of detachment of old class is through the method that uses B's, and old A's container and does removing for both of classes.<br />
  Is there any way for B to know that old A's container is moved and it shouldn't acces it?<br />
  It works without checking, but as class doesn't have defined state after std::move, I shouldn't call ::remove() on it (professor says it's an error).<br />
  Please note: this is my homework problem, so I wouldn't like to get illegal help of solving complete problem, only the part of checking of object's consistency to skip calling it's functions after moving it.</p>
  
  <p>EDIT: added example.<br />
  <strong>IMPORTANT</strong>:<br />
  1) I'm required to use std::move. I already know an easy way to do everything in while-loop using iterators. But, std::move is explicitly required.<br />
  2) This snippet is for understanding my problem. As student, I'd like to solve it by myself, I only need info how to skip doing one line when it is not allowed.</p>
  
  <pre><code>class A;
  
  class B {
  public:
      // ...... some constructors, functions and destructor.
      void add(A *a) {
          // .. adds to both containers.
      };
      void remove(A *a) { // I need to remove from both containers at most of the times
          a_container.erase(a);
          a-&gt;b_container.erase(this); // PROBLEM(!!): after doing std::move(b_container) I shouldn't do this! How to check is b_container moved?
      };
  private:
      std::_______&lt;A*&gt; a_container; //type of container is not important
  };
  
  class A {
      friend class B;
  public:
      // ...... some constructors, functions and destructor.
      A(A &amp;&amp; a) :
          b_container(std::move(a.b_container)) {
          //..
          for (B *b : b_container) {
              b-&gt;add(this); //adds to B's connected to the old instance
              a.remove(*b); //I need somehow to disconect old B's from pointer of moved A.
          }
      };
      void add(B &amp; b) {
          b.add(this);
      };
      void remove(B &amp; b) {
          b.remove(this);
      };
  private:
      std::_______&lt;B*&gt; b_container; //type of container is not important
      //...
  };
  </code></pre>