This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++ template parameter constraints
- From: Martin Buchholz <martin at xemacs dot org>
- To: gcc at gcc dot gnu dot org, Nathan Sidwell <nathan at codesourcery dot com>
- Date: Wed, 29 Jan 2003 18:34:22 -0800
- Subject: C++ template parameter constraints
- Reply-to: martin at xemacs dot org
If you are interested in C++ template hacking or the C++ compile-time
reflection branch, then you may want to read my web page on template
parameter constraints:
http://m17n.org/martin/writings/template-parameter-constraints.html
(feedback desired)
Obgcc:
Nathan fixed the following bug
c++/9053: g++ confused about ambiguity of overloaded function templates
Basically, g++ used to consider the following overloaded function
templates ambiguous.
template <class T> typename bar<T>::type foo (T);
template <class T> typename qux<T>::type foo (T);
This has now been fixed in g++ 3.3 (thanks Nathan), but what about
earlier versions?
Here I'd like to point out the following workaround for gcc 3.2:
namespace Dummy1 { template <class T> typename bar<T>::type foo (T); }
namespace Dummy2 { template <class T> typename qux<T>::type foo (T); }
using Dummy1::foo;
using Dummy2::foo;
This is described in greater detail at the above web page.
Martin