Boost C++ Libraries: Ticket #7361: Forbid compilation of leaking mistake. https://svn.boost.org/trac10/ticket/7361 <p> I was adding program_option to my prorgam when I discovered a related leak. Fortunately it was false positive, but it pointed a hidden problem. I used: </p> <ul><li>Visual Studio 2012 </li><li>Boost 1.51.0 </li><li>Visual Leak Detector to detect the leak </li></ul><p> This, generate the leak: </p> <pre class="wiki">#include &lt;boost/program_options.hpp&gt; int main() { namespace bpo = boost::program_options; bpo::options_description options( "Options" ); options.add_options() ( "test" , "Test." ) , ( "value" , bpo::value&lt;int&gt;(), "Value." ) ; } </pre><p> The second option is leaking. The reason is because of the comma in the beginning of the line. I first added it by reflex when using function arguments so it took me some time to find what was leaking. Part of the time I spend was figuring out why it don't leak if you don't set a value type: </p> <pre class="wiki"> #include &lt;boost/program_options.hpp&gt; int main() { namespace bpo = boost::program_options; bpo::options_description options( "Options" ); options.add_options() ( "test" , "Test." ) , ( "value" , "Value." ) // no leak but still wrong! ; } </pre><p> The main problem I see with this is that it is compiled without any problem nor warning. </p> <p> So here is my question: Would it be possible to forbid comma operator with options_description_easy_init? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7361 Trac 1.4.3 anonymous Wed, 27 Mar 2013 06:52:48 GMT <link>https://svn.boost.org/trac10/ticket/7361#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7361#comment:1</guid> <description> <p> It does leaks for me as well, when specified bpo::value&lt;std::string&gt;(). </p> </description> <category>Ticket</category> </item> </channel> </rss>