Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/python/pyste/tests/virtual.h @ 45

Last change on this file since 45 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 806 bytes
Line 
1/* Copyright Bruno da Silva de Oliveira 2003. Use, modification and
2 distribution is subject to the Boost Software License, Version 1.0.
3 (See accompanying file LICENSE_1_0.txt or copy at
4 http:#www.boost.org/LICENSE_1_0.txt)
5 */
6namespace virtual_ {
7   
8struct C
9{
10public:
11    virtual int f()
12    {
13        return f_abs();
14    }
15
16    virtual void bar(int) {}
17    virtual void bar(char*) {}
18
19    const char* get_name()
20    {
21        return name();
22    }
23    virtual int dummy() { return 0; }
24
25protected:   
26    virtual int f_abs() = 0;
27
28private:   
29    virtual const char* name() { return "C"; }
30};
31
32struct D
33{
34    virtual int dummy() { return 0; }
35};
36
37inline int call_f(C& c) { return c.f(); }
38inline int call_dummy(C* c) { return c->dummy(); }
39inline int call_dummy(D* d) { return d->dummy(); }
40
41}
Note: See TracBrowser for help on using the repository browser.