Boost C++ Libraries: Ticket #2015: boost::format::operator% does not work with anonymous types inside a namespace https://svn.boost.org/trac10/ticket/2015 <p> Using g++ version 3.3.3. Actual sources are from 1.33.1 but these don't seem to be different from what is currently in the repository. I get the following error message. If I remove the template specification from the calls in the body of several functions, the errors go away. In the attached file, the function foo2 suffers the same problem as operator% but foo1 does not. </p> <p> With g++ 4.2.1, this change does not work either. </p> <p> .../boost/format/format_class.hpp: In </p> <blockquote> <p> member function `boost::basic_format&lt;Ch, Tr, Alloc&gt;&amp; boost::basic_format&lt;Ch, Tr, Alloc&gt;::operator%(const T&amp;) [with T = bcu::&lt;anonymous enum&gt;, Ch = char, Tr = std::char_traits&lt;char&gt;, Alloc = std::allocator&lt;char&gt;]': </p> </blockquote> <p> format_bug.cc:52: instantiated from here .../boost/format/format_class.hpp:64: error: template-argument </p> <blockquote> <p> `const bcu::&lt;anonymous enum&gt;&amp;' uses anonymous type </p> </blockquote> <p> .../boost/format/format_class.hpp:64: error: no </p> <blockquote> <p> matching function for call to `feed(boost::basic_format&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;, const bcu::&lt;anonymous enum&gt;&amp;)' </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2015 Trac 1.4.3 Geoff Barrett <gbarrett@…> Tue, 17 Jun 2008 11:36:36 GMT attachment set https://svn.boost.org/trac10/ticket/2015 https://svn.boost.org/trac10/ticket/2015 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">format_bug.cc</span> </li> </ul> <p> program that reproduces the problem </p> Ticket Steven Watanabe Sat, 23 May 2009 20:12:59 GMT attachment set https://svn.boost.org/trac10/ticket/2015 https://svn.boost.org/trac10/ticket/2015 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">format.patch</span> </li> </ul> <p> Fix for the problem </p> Ticket anonymous Sun, 15 Nov 2009 23:13:22 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2015#comment:1 https://svn.boost.org/trac10/ticket/2015#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> fixed by applying suggested patch (in revision 57695) Thanks to Steven Watanabe for the fix. </p> Ticket