[Boost-bugs] [ boost-Bugs-1313543 ] range, VC 7.1, compile error.

Bugs item #1313543, was opened at 2005-10-05 16:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1313543&group_id=7586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Sergey Shandar (sergey_shandar) Assigned to: Nobody/Anonymous (nobody) Summary: range, VC 7.1, compile error. Initial Comment: Compiler: VC 7.1 Example: --------- #include <boost/range/iterator.hpp> template<class Container> typename boost::range_iterator<const Container>::type begin(const Container &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<C>' 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< typename C > 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< typename C, bool IsClass> struct range_iterator { typedef void type; }; template< typename C> struct range_iterator<C, true> { typedef BOOST_DEDUCED_TYPENAME C::iterator type; }; } } --------- ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1313543&group_id=7586 ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Boost-bugs mailing list Boost-bugs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/boost-bugs
participants (1)
-
SourceForge.net