Boost C++ Libraries: Ticket #4409: boost::in_place_factory produces warning https://svn.boost.org/trac10/ticket/4409 <p> Visual C++ 9.0, Warning level 4 </p> <div class="wiki-code"><div class="code"><pre> <span class="cp">#include</span> <span class="cpf">&lt;boost/utility/in_place_factory.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/optional.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/noncopyable.hpp&gt;</span><span class="cp"></span> <span class="k">struct</span> <span class="nl">x</span> <span class="p">:</span> <span class="n">boost</span><span class="o">::</span><span class="n">noncopyable</span> <span class="p">{</span> <span class="k">public</span><span class="o">:</span> <span class="k">static</span> <span class="kt">void</span> <span class="n">init</span><span class="p">(</span><span class="kt">int</span> <span class="n">i</span><span class="p">);</span> <span class="k">private</span><span class="o">:</span> <span class="n">x</span><span class="p">(</span><span class="kt">int</span> <span class="n">i</span><span class="p">)</span> <span class="o">:</span> <span class="n">i</span> <span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span> <span class="k">friend</span> <span class="n">boost</span><span class="o">::</span><span class="n">in_place_factory1</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span><span class="p">;</span> <span class="kt">int</span> <span class="n">i</span><span class="p">;</span> <span class="p">};</span> <span class="n">boost</span><span class="o">::</span><span class="n">optional</span><span class="o">&lt;</span><span class="n">x</span><span class="o">&gt;</span> <span class="n">x_instance</span><span class="p">;</span> <span class="kt">void</span> <span class="n">x</span><span class="o">::</span><span class="n">init</span><span class="p">(</span><span class="kt">int</span> <span class="n">i</span><span class="p">)</span> <span class="p">{</span> <span class="n">x_instance</span> <span class="o">=</span> <span class="n">boost</span><span class="o">::</span><span class="n">in_place</span><span class="p">(</span><span class="n">i</span><span class="p">);</span> <span class="p">}</span> </pre></div></div><pre class="wiki">1&gt;boost\utility\in_place_factory.hpp(68): warning C4512: 'boost::in_place_factory1&lt;A0&gt;' : assignment operator could not be generated 1&gt; with 1&gt; [ 1&gt; A0=int 1&gt; ] 1&gt; a.cpp(26) : see reference to class template instantiation 'boost::in_place_factory1&lt;A0&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; A0=int 1&gt; ] </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4409 Trac 1.4.3 viboes Mon, 29 Nov 2010 15:44:33 GMT component changed; owner set https://svn.boost.org/trac10/ticket/4409#comment:1 https://svn.boost.org/trac10/ticket/4409#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">No-Maintainer</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">utility</span> </li> </ul> Ticket