Files
kotlin-fork/kotlin-native/backend.native/tests/interop/cpp/cppClass.def
T
2021-07-30 12:54:51 +03:00

43 lines
751 B
Modula-2

language = C++
compilerOpts = -std=c++14
plugin = org.jetbrains.kotlin.native.interop.skia
---
class CppTest {
public:
CppTest() { ++counter; }
CppTest(const CppTest&) = default;
explicit CppTest(int i, double j = 3.14) : iPub(i + int(j + 0.5)) {}
~CppTest() { --counter; }
int iPub = 42;
virtual int foo() { return iPub; }
static int counter;
static int s_fun() { return counter; }
class Nested {
public:
int nestedFoo() { return -2; }
} nested;
// not supported yet
operator CppTest::Nested() const;
template <class X> void fooTmplMember() const;
private:
CppTest* funPrivate() const;
static int s_funPrivate();
int iPriv;
};
int CppTest::counter;
CppTest retByValue(CppTest* s) {
return s ? *s : CppTest();
}