This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7136: Template constants deduction


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/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]