Boost C++ Libraries: Ticket #8452: Conflict between Boost.Format and filtered_graph in Boost.Graph https://svn.boost.org/trac10/ticket/8452 <p> I am using <code>boost::format</code> in my logging macros and some graphs from Boost.Graph. But whenever I include <code>boost/graph/filtered_graph.hpp</code>, GCC starts to complain that </p> <pre class="wiki">boost/graph/graph_traits.hpp: In instantiation of 'struct boost::graph_traits&lt;char&gt;': boost/graph/filtered_graph.hpp:131:57: required from 'struct boost::filtered_graph_base&lt;char&gt;' boost/graph/filtered_graph.hpp:141:9: required from 'class boost::filtered_graph&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;' boost/format/feed_args.hpp:253:17: required from 'void boost::io::detail::distribute(boost::basic_format&lt;Ch, Tr, Alloc&gt;&amp;, T) [with Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; T = const SomeWrapper&lt;lots of boost::graph things here&gt; &amp;]' boost/format/feed_args.hpp:263:9: required from 'boost::basic_format&lt;Ch, Tr, Alloc&gt;&amp; boost::io::detail::feed(boost::basic_format&lt;Ch, Tr, Alloc&gt;&amp;, T) [with Ch = char; Tr = std::char_traits&lt;char&gt;; Alloc = std::allocator&lt;char&gt;; T = const SomeWrapper&lt;lots of boost::graph things here&gt; &amp;]' [... more required froms, don't seem relevant anymore ...] boost/graph/graph_traits.hpp:33:52: error: 'char' is not a class, struct, or union type </pre><p> The <code>SomeWrapper</code> is my class for customizing <code>operator&lt;&lt;</code>. It's template argument has few hundred characters. It is pair of iterators into something complex involving <code>boost::directed_graph</code>. The <code>filtered_graph</code> is not actually used, only included. </p> <p> Both GCC 4.5.2 and 4.7.2 show the above error, but Visual C++ 15.00.30729.01 (Visual Studio 9 2008) compiles it just fine. I am not sure whether it is bug in GCC or whether MSVC considers SFINAE something that isn't, but it seems to be the later. The template from <code>boost/graph/filtered_graph.hpp</code> will be found by ADL and because the template parameters are provided explicitly, compiler must instantiate it to find out whether it is better candidate or not. That fails, but not in immediate context, so it is not SFINAE. </p> <p> It can be worked around by qualifying the <code>put</code> in <code>boost/format/feed_args.hpp</code>, renaming it, or by modifying the templates in graph_traits and filtered_graph to make the failure SFINAE (might have some advantages elsewhere). </p> <p> I had the problem with 1.51 and updated to 1.53, because there are some changes to <code>graph_traits</code> that looked like they may be relevant, but it didn't help. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8452 Trac 1.4.3 Jeremiah Willcock Thu, 18 Apr 2013 20:18:28 GMT component changed; owner set https://svn.boost.org/trac10/ticket/8452#comment:1 https://svn.boost.org/trac10/ticket/8452#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Samuel Krempp</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">format</span> </li> </ul> <p> Would it make sense to just add a namespace qualification (<code>boost::io::detail</code>, most likely) to the call to <code>put</code>? Or does that need to use ADL, even with the explicit template arguments? </p> Ticket James E. King, III Thu, 12 Oct 2017 17:39:54 GMT <link>https://svn.boost.org/trac10/ticket/8452#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8452#comment:2</guid> <description> <p> Can you provide a concrete and minimal example of this? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Wed, 18 Oct 2017 19:09:46 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8452#comment:3 https://svn.boost.org/trac10/ticket/8452#comment:3 <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">invalid</span> </li> </ul> <p> Sample code showing this failure is required as the explanation is complex. </p> Ticket