From 2e123849fbac387d90005fe71ddefeeffbc3d5f9 Mon Sep 17 00:00:00 2001 From: Bruno da Silva de Oliveira Date: Fri, 14 Mar 2003 23:39:04 +0000 Subject: [PATCH] no message [SVN r17931] --- pyste/example/virtual.h | 23 +++++++++++++++++++++++ pyste/example/virtual.pyste | 1 + 2 files changed, 24 insertions(+) create mode 100644 pyste/example/virtual.h create mode 100644 pyste/example/virtual.pyste diff --git a/pyste/example/virtual.h b/pyste/example/virtual.h new file mode 100644 index 00000000..e31183b4 --- /dev/null +++ b/pyste/example/virtual.h @@ -0,0 +1,23 @@ + +struct C +{ +public: + virtual int f() + { + return f_abs(); + } + + const char* get_name() + { + return name(); + } + +protected: + virtual int f_abs() = 0; + +private: + virtual const char* name() { return "C"; } +}; + +int call_f(C& c) { return c.f(); } + diff --git a/pyste/example/virtual.pyste b/pyste/example/virtual.pyste new file mode 100644 index 00000000..cd9b8669 --- /dev/null +++ b/pyste/example/virtual.pyste @@ -0,0 +1 @@ +Class('C', 'virtual.h')