Boost C++ Libraries: Ticket #491: range, VC 7.1, compile error. https://svn.boost.org/trac10/ticket/491 <pre class="wiki">Compiler: VC 7.1 Example: --------- #include &lt;boost/range/iterator.hpp&gt; template&lt;class Container&gt; typename boost::range_iterator&lt;const Container&gt;::type begin(const Container &amp;X) { return 0; } int main() { char a[3]; int b = begin(a); return 0; } --------- The compile-time error message is --------- c:\Boost\include\boost-1_33\boost\range\iterator.hpp(37) : error C2825: 'C::iterator': cannot form a qualified name main.cpp(12) : see reference to class template instantiation 'boost::range_iterator&lt;C&gt;' being compiled with [ C=char [3] ] --------- It's a VC 7.1 bug but there is possibility to work around. Instead of using C::iterator by default (existing code shown below): --------- namespace boost { namespace detail { template&lt; typename C &gt; struct range_iterator { typedef BOOST_DEDUCED_TYPENAME C::iterator type; }; } } --------- Use C::iterator only if C is a class. Code showing the possible implementation is shown below --------- namespace boost { namespace detail { template&lt; typename C, bool IsClass&gt; struct range_iterator { typedef void type; }; template&lt; typename C&gt; struct range_iterator&lt;C, true&gt; { typedef BOOST_DEDUCED_TYPENAME C::iterator type; }; } } --------- </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/491 Trac 1.4.3 Thorsten Ottosen Fri, 07 Oct 2005 01:11:07 GMT status changed https://svn.boost.org/trac10/ticket/491#comment:1 https://svn.boost.org/trac10/ticket/491#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> Ticket