This is the mail archive of the gcc-help@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: Avoid typename repetition in template specialization


Dear all,

Thanks John and Axel!

But, as I have a lot of these constructs typedef is exactly the problem:

  typedef PScalar< PColorMatrix< RComplex<REAL64>, Nc> > T1;
  typedef PSpinVector< PColorVector< RComplex<REAL64>, Nc>, Ns > T2;
  typedef OpMultiply Op;
  template<>
  inline BinaryReturn< T1 , T2 , Op >::Type_t
  operator*(const T1& l, const T2& r )
  {
    BinaryReturn< T1 , T2 , Op >::Type_t d;
    // code
    return d;
  }

now, this conflicts:

  typedef PSpinVector< PColorVector< RComplex<REAL64>, Nc>, Ns > T1;
  typedef PSpinVector< PColorVector< RComplex<REAL64>, Nc>, Ns > T2;
  typedef OpMultiply Op;
  template<>
  inline BinaryReturn< T1 , T2 , Op >::Type_t
  operator+(const T1& l, const T2& r )
  {
    BinaryReturn< T1 , T2 , Op >::Type_t d;
	// code
    return d;
  }

If there would be a way to undefine a typename in the actual namespace this would help a lot in this case. Is there functionality for this or is there a workaround for my case that occurs to you?

Best regards,
Frank Winter



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