c++/7136: Template constants deduction
Wolfgang Bangerth
bangerth@ticam.utexas.edu
Thu Jan 23 15:07:00 GMT 2003
On Thu, 23 Jan 2003, Philippe A. Bouchard wrote:
> Yes you're right but the following won't work either under gcc 2.95:
>
> struct Type
> {
> int i;
> };
>
> template <typename _T, int _T::* _I>
> struct Number {};
>
> template <typename _T, int _T::* _I>
> void foo(Number<_T, _I> const &)
> {
> }
>
> int main()
> {
> foo(Number<Type, & Type::i>());
> }
>
> Returns:
> template.cpp: In function `int main()':
> template.cpp:15: no matching function for call to `foo
> (Number<Type,&Type::i>)'
True, but there's not much that we can do about it: that's simply a bug in
gcc2.95 that was fixed in 3.0. gcc2.95 is not maintained any more, so I
fear that you will have to find a workaround for gcc2.95.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth/
More information about the Gcc-bugs
mailing list