Boost C++ Libraries: Ticket #6525: format atldbgmem.h m_storage VS2010 https://svn.boost.org/trac10/ticket/6525 <p> Hi, </p> <p> Format component of Boost 1.48 doesn't compile with memory debugging enabled in VS2010. </p> <p> With &lt;atldbgmem.h&gt; included in stdafx.h (precompiled header), compiler says error: </p> <pre class="wiki">1&gt;d:\boost\boost_1_48_0\boost\optional\optional.hpp(346): error C2061: syntax error : identifier 'm_storage' 1&gt; d:\boost\boost_1_48_0\boost\optional\optional.hpp(345) : while compiling class template member function 'void boost::optional_detail::optional_base&lt;T&gt;::construct(const std::locale &amp;)' 1&gt; with 1&gt; [ 1&gt; T=boost::io::detail::locale_t 1&gt; ] 1&gt; d:\boost\boost_1_48_0\boost\optional\optional.hpp(500) : see reference to class template instantiation 'boost::optional_detail::optional_base&lt;T&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; T=boost::io::detail::locale_t 1&gt; ] 1&gt; d:\boost\boost_1_48_0\boost\format\internals.hpp(56) : see reference to class template instantiation 'boost::optional&lt;T&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; T=boost::io::detail::locale_t 1&gt; ] 1&gt; d:\boost\boost_1_48_0\boost\format\internals.hpp(57) : see reference to class template instantiation 'boost::io::detail::stream_format_state&lt;Ch,Tr&gt;' being compiled 1&gt; 1&gt;Build FAILED. </pre><p> The code itself: </p> <pre class="wiki">#include &lt;boost/format.hpp&gt; int _tmain(int argc, _TCHAR* argv[]) { boost::format fmt("Value: %d\nString: %s\n"); fmt % 10 % _T("My string"); printf(fmt.str().c_str()); return 0; } </pre><p> Without atldbgmem.h included the code compiles with no error messages </p> <p> Regards, Evgeniy </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6525 Trac 1.4.3 anonymous Tue, 26 Mar 2013 14:38:26 GMT <link>https://svn.boost.org/trac10/ticket/6525#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6525#comment:1</guid> <description> <p> This is still the case with boost 1.53.0 and VS2012. If I include e.g. boost property tree, and compile in debug mode, I get a </p> <pre class="wiki">1&gt;c:\boost\boost_1_53_0\boost\optional\optional.hpp(346): error C2061: syntax error : identifier 'm_storage' </pre><p> I use the following for memory debugging: </p> <pre class="wiki">#ifdef WIN32 #include &lt;crtdbg.h&gt; #endif #ifdef _DEBUG #ifndef DBG_NEW #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) #define new DBG_NEW #endif #endif // _DEBUG </pre><p> Without that, or in release mode, it's working fine. </p> <p> Can we somehow fix this? </p> </description> <category>Ticket</category> </item> <item> <author>dbk25@…</author> <pubDate>Fri, 09 Jan 2015 20:26:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6525#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6525#comment:2</guid> <description> <p> I have what appears to be a workaround; at least it helped when I hit this problem. </p> <p> Check whether the <code>#ifdef _DEBUG/#endif</code> that redefines <code>new</code> is before or after the <code>#include &lt;boost/format.hpp&gt;</code>. I hit this problem when <code>new</code> is redefined <em>before</em> including format.hpp, but do not have this problem if <code>new</code> is redefined <em>afterwards</em>. (I'm using a slightly different way to redefine <code>new</code>, but that's most likely not material.) </p> <p> In other words, this caused the compile error that you are reporting: </p> <pre class="wiki">#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #include &lt;boost/format.hpp&gt; </pre><p> and this worked for me: </p> <pre class="wiki">#include &lt;boost/format.hpp&gt; #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Thu, 12 Oct 2017 14:47:08 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/6525#comment:3 https://svn.boost.org/trac10/ticket/6525#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Samuel Krempp</span> to <span class="trac-author">Fernando Cacciola</span> </li> <li><strong>component</strong> <span class="trac-field-old">format</span> → <span class="trac-field-new">optional</span> </li> </ul> <p> This is an issue in Boost.Optional; reassigning. </p> Ticket