title: shared_ptr<> is to weak_ptr<> as unique_ptr<> is to... what?
body: <p>In C++11, you can use a <code>shared_ptr&lt;&gt;</code> to establish an ownership relation with an object or variable and <code>weak_ptr&lt;&gt;</code> to safely reference that object in a non-owned way.</p>
  
  <p>You can also use <code>unique_ptr&lt;&gt;</code> to establish an ownership relation with an object or variable. But what if other, non-owning objects want to also reference that object? <code>weak_ptr&lt;&gt;</code> isn't helpful in this case. Raw pointers are helpful but bring various downsides (e.g. they can be <a href="https://stackoverflow.com/questions/17534210/trivial-raw-pointer-that-self-initializes-to-nullptr-in-c">automatically initialized to nullptr</a> but this is accomplished through techniques that are not consistent with the <code>std::*_ptr&lt;&gt;</code> types).</p>
  
  <p>What is the equivalent of <code>weak_ptr&lt;&gt;</code> for non-owning references to objects owned via <code>unique_ptr&lt;&gt;</code>?</p>
  
  <p>Here's a clarifying example that resembles something in a game I'm working on.</p>
  
  <pre><code>class World
  {
  public:
  
      Trebuchet* trebuchet() const { return m_trebuchet.get(); }
  
  private:
      std::unique_ptr&lt; Trebuchet &gt; m_trebuchet;
  };
  
  class Victim
  {
  public:
      Victim( Trebuchet* theTrebuchet ) : m_trebuchet( theTrebuchet ) {}
  
      ~Victim()
      {
          delete m_trebuchet;     // Duh. Oops. Dumb error. Nice if the compiler helped prevent this.
      }
  
  private:
  
      Trebuchet* m_trebuchet;    // Non-owning.
  };
  
  shared_ptr&lt; Victim &gt; createVictim( World&amp; world )
  {
      return make_shared&lt; Victim &gt;( world.trebuchet() );
  }
  </code></pre>
  
  <p>Here we use a raw pointer to maintain a non-owning relationship with an object owned via <code>unique_ptr&lt;&gt;</code> elsewhere. But is raw the best we can do?</p>
  
  <p>The hope is a type of pointer that:</p>
  
  <ul>
  <li>Looks like the other modern pointer types. E.g. <code>std::raw_ptr&lt;T&gt;</code>.</li>
  <li>Replaces raw pointers so that a codebase that uses modern pointer types throughout can find <em>all</em> pointers via a search for <code>_ptr&lt;</code> (roughly).</li>
  <li>Auto-initializes to nullptr.</li>
  </ul>
  
  <p>Thus:</p>
  
  <pre><code>int* p;                  // Unknown value.
  std::raw_ptr&lt; int &gt; p;   // null.
  </code></pre>
  
  <p>Does this type already exist in C++ now, is it proposed for the future, or is another implementation broadly available in e.g. Boost?</p>