title: How to cycle through smart pointer to a class with custom iterator
body: <p>I have a smart pointer to a class with custom iterator. I need to iterate through it and couldn't find any examples.</p>
  <pre class="lang-cpp prettyprint-override"><code>struct SomeContrainer
  {
     int a;
  }
  
  struct ListClass
  {
     std::vector&lt;SomeContrainer&gt;::iterator begin() { return m_devs.begin(); }
     std::vector&lt;SomeContrainer&gt;::iterator end()   { return m_devs.end();   }                                         
  
     void add( const SomeContrainer&amp; dev ) { m_devs.push_back( dev ); }
  
     private:
        std::vector&lt;SomeContrainer&gt; m_devs;
  };
  
  typedef std::unique_ptr&lt;ListClass&gt; ListPtr_t;
  
  
  void Foo_Add( const ListPtr_t&amp; list )
  {
     SomeContrainer dev1, dev2;
     dev1.a = 10;
     dev2.a = 100;
     list-&gt;add(dev1);
     list-&gt;add(dev2);
  }
  
  void DoSomeWorkOtherList( const ListPtr_t&amp; list )
  {
     for( auto const&amp; dev : list )    // &lt;-- how to iterate over list ???
     {}
  }
  
  // -----------
  
  ListPtr_t pMyList( new ListClass() );
  
  Foo_Add( pMyList );
  DoSomeWorkOtherList(pMyList );
  </code></pre>
  <p>It works fine if I don't use a smart pointer and have just an object <code>ListClass list</code> I'm using C++11 and can't upgrade.</p>