@related : C++ static

[[API]] STL

WEIRD CODE

// originaly posted on : http://pastebin.com/364045
#define BUG
extern "C" { void f(int a) {}; }
#ifdef BUG
template <typename T, typename X >
#else
template <typename T>
#endif
class Parent { public: T f(){} };
template <typename X>
class Child
#ifdef BUG
  : public Parent< int , X>
#else
    : public Parent< int>
#endif
{
public:
  void g(){
    this->f(); // ok, conflict avoided
    f(); // too few arguments to function 'void f(int)'
  }
};
int main()
{
  f(2);
  Child<char> o;
  o.g();
}
//EOF

[C++]] static

template.txt · Last modified: 2022/04/16 12:24 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki