bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Template problem


From: Helmut Zeisel
Subject: Re: Template problem
Date: Fri, 25 May 2001 00:28:29 -0500

In the meanwhile I found a work around by making
the operator a friend.
If someone else is interested in the workaround, here it is:

#include <iostream>

template <typename T, T A> class C1
{
  friend
  std::ostream& operator<<(std::ostream& os, const C1<T,A>& a)
  {
    return os;
  }
};

int main()
{
  C1<int,5> c1;
  std::cout << c1 << std::endl;
  return 0;
}

<<application/ms-tnef>>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]