void template argument

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

 



#include <iostream>

using namespace std;

#ifdef TEMPLATE
template<class arg>
class At {
  public:
   void a(arg) {cout << "a" << endl; }
};
typedef At<void> A;
#else
class A {
  public:
   void a(void) {cout << "a" << endl; }
};
#endif 

int main() {
  A a;
  a.a();
}


i've supposed that two banches (with and without
-DTEMAPLTE) are identical. but gcc 2.95.3 & 3.2.3
compilers fails compiling -DTEMPLATE with errors.
(msvc++ compiles this code without any problem).


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux