 <p>BufferSptr is just the shared pointer: you have to assign a buffer to it (you have to create the buffer). If buff is another BufferSptr (another shared pointer), then I would try:</p> <pre><code>BufferSptr subbuffer (buff-&gt;CreateSubbuffer(0,100)); </code></pre> <p>or</p> <pre><code>BufferSptr subbuffer (new Buffer(buff.get(), 0,100)); </code></pre>