last changes from bloomberg.
This commit is contained in:
31
cpp/different_linkage.cpp
Normal file
31
cpp/different_linkage.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
VIM: let b:lcppflags="-std=c++14 -O2 -pthread -I."
|
||||
VIM: let b:wcppflags="/O2 /EHsc /DWIN32"
|
||||
*/
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
|
||||
class Test {
|
||||
public:
|
||||
virtual int increment(int num) = 0;
|
||||
|
||||
static int increment(Test& t, int num) {return t.increment(num);}
|
||||
};
|
||||
|
||||
class TestImpl : public Test
|
||||
{
|
||||
public:
|
||||
virtual int increment(int num) {
|
||||
std::cout << "Test " << num;
|
||||
return num;
|
||||
}
|
||||
};
|
||||
|
||||
int main ( void )
|
||||
{
|
||||
TestImpl t;
|
||||
Test::increment(t, 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user