Boost C++ Libraries: Ticket #13346: SFINAE-friendly range_value https://svn.boost.org/trac10/ticket/13346 <p> This code compiles: </p> <pre class="wiki">#include &lt;boost/range/value_type.hpp&gt; #include &lt;utility&gt; #include &lt;iterator&gt; template&lt;class T&gt; void f(std::pair&lt;T,T&gt;){} template&lt;class T&gt; auto f(T) -&gt; typename std::iterator_traits&lt;typename boost::range_iterator&lt;T&gt;::type&gt;::value_type {} int main(){ std::pair&lt;int,int&gt; p; f(p); } </pre><p> However, if I change the return type to the more readable <code>typename boost::range_value&lt;T&gt;::type</code>, it now fails to compile because the broken typedef in iterator_value is not in the immediate context. The standard noticed that this was useful and made iterator_traits SFINAE-friendly, it would be nice if boost could do the same for the various range meta-functions. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13346 Trac 1.4.3