This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Fwd: Re: [Patch] Remove workaround for copy_backward
Douglas Gregor <gregod@cs.rpi.edu> writes:
| On Saturday 27 September 2003 02:30 pm, Gabriel Dos Reis wrote:
| > Douglas Gregor <gregod@cs.rpi.edu> writes:
| > | Has anyone considered replacing the dispatching mechanism with one based
| > | on enable_if? That would eliminate the need for multiple levels of
| > | indirection (__copy, __copy_aux, __copy_aux2, etc.).
| >
| > I never had the time to do a thourough auditing of the library;
|
| We don't need the library per se, because our favorite compiler can handles
| the idiom fine.
I was not referring to the fact that our compiler could handle that
idiom or not. I was talking about the set of places that could
effectively benefit from that idiom. That needs auditing.
| We need only:
|
| template<bool Cond, typename _Tp = void> struct __enable_if {};
|
| template<bool Cond, typename _Tp>
| struct __enable_if<true, _Tp>
| { typedef _Tp type; };
grep for __enable_if in bits/cpp_type_traits.h
[...]
| Compare it to what libstdc++ currently does. I can tell you that it doesn't
| fit in two extra lines of code.
Doug, do me a favor: I understrand the benefit of the enable-if
idiom.
-- Gaby