incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Far...@kyiv.vdiweb.com>
Subject RE: [PATCH] MSVC 7.0 stdlib compatibility patch
Date Wed, 27 Sep 2006 08:16:14 GMT
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Friday, September 22, 2006 4:33 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: [PATCH] MSVC 7.0 stdlib compatibility patch
> 
> >    VC7.0 also do not support "Partial Ordering of Function 
> Templates"
> > (http://support.microsoft.com/kb/240869/).
>>
> >    And due this bug was another error:
> > 
> > include\loc\_num_put.cc(197) : error C2667: 
> '__rw::__rw_iter_failed' :
> > none of 2 overloads have a best conversion
> >          include\loc\_num_put.cc(47): could be 'bool 
> > __rw::__rw_iter_failed(const 
> std::ostreambuf_iterator<_CharT,_Traits> &)'
> >          include\loc\_num_put.cc(43): or       'bool
> > __rw::__rw_iter_failed(const _OutputIter &)'
> >          while trying to match the argument list 
> > '(std::num_put<_CharT,_OutputIter>::iter_type)'
> >          with
> >          [
> >              _CharT=wchar_t,
> > 
> > 
> _OutputIter=std::ostreambuf_iterator<wchar_t,std::char_traits<
> wchar_t>>
> >          ]
> 
> Yes, this was a fairly recent change of mine:
> http://svn.apache.org/viewvc?view=rev&revision=420970
> 
> Since we're not testing with MSVC 7.0 I never found out about 
> it (until now). Thanks for investigating and coming up with a 
> fix for it.
> 
> >    * _num_put.cc (__rw_iter_failed): The same.
> 
> I'm going to have to think about this one. I appreciate the 
> effort you put into the workaround but it seems pretty 
> involved and I'm not sure we want to complicate our code 
> quite so much just to work around a bug in an old and fairly 
> rarely used compiler. I wonder if there's a simpler way to 
> deal with it.

  The simple solution is replace template <class _OutputIter> version of
the
__rw_iter_failed (const _OutputIter&) to the non-template
__rw_iter_failed (...).
Disadvantage of this solution is possibility to call __rw_iter_failed
with more
than one parameter, but this situation will be discovered by compiling
the
library with another compiler.

#ifndef _RWSTD_NO_PART_SPEC_OVERLOAD

template <class _OutputIter>
inline bool
__rw_iter_failed (const _OutputIter&) { return false; }

#else   // ifdef _RWSTD_NO_PART_SPEC_OVERLOAD

inline bool
__rw_iter_failed (...) { return false; }

#endif  // _RWSTD_NO_PART_SPEC_OVERLOAD

Farid.

Mime
View raw message