Boost C++ Libraries: Ticket #4296: has_iterator, has_const_iterator metafunctions https://svn.boost.org/trac10/ticket/4296 <p> This function is useful when using enable_if/disable_if for distinguishing between plain types and ranges of types. </p> <p> Ideally, this would be added as an include to boost/range/metafunctions.hpp. </p> <p> Code and test case attached. Tested against boost 1.43.0 with MSVC and gcc 4.2. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4296 Trac 1.4.3 tomas.puverle@… Fri, 04 Jun 2010 17:31:27 GMT attachment set https://svn.boost.org/trac10/ticket/4296 https://svn.boost.org/trac10/ticket/4296 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost.range.zip</span> </li> </ul> <p> A patch for boost range with two new metafunctions and a test case. </p> Ticket Steven Watanabe Fri, 11 Jun 2010 16:32:02 GMT <link>https://svn.boost.org/trac10/ticket/4296#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4296#comment:1</guid> <description> <p> This would be better implemented as </p> <pre class="wiki">BOOST_MPL_HAS_XXX_TRAIT_DEF(type); template&lt;class T&gt; struct has_iterator : has_type&lt;boost::range_iterator&lt;T&gt; &gt; {}; template&lt;class T&gt; struct has_const_iterator : has_type&lt;boost::range_const_iterator&lt;T&gt; &gt; {}; </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Sun, 14 Nov 2010 17:46:20 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/4296#comment:2 https://svn.boost.org/trac10/ticket/4296#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Neil Groves Thu, 23 Dec 2010 18:14:14 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/4296#comment:3 https://svn.boost.org/trac10/ticket/4296#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost 1.46.0</span> </li> </ul> <p> I have implemented a solution based primarily on stevens suggestion since using BOOST_MPL_HAS_XX_TRAIT_DEF improves compiler support. </p> <p> I have chosen to implement this using enable_if to select a base class since this works better on many compilers (due to the base class being dependent on the template parameters) than the snippet posted above. </p> Ticket