~ubuntu-branches/ubuntu/raring/blitz++/raring

« back to all changes in this revision

Viewing changes to compiler/rtti.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2005-02-28 20:25:01 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050228202501-3i4f2sknnprsqfhz
Tags: 1:0.8-4
Added missing build-depends (Closes: #297323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <typeinfo>
2
 
 
3
 
class Dog {
4
 
public:
5
 
    Dog() { }
6
 
    virtual void fetch() = 0;
7
 
};
8
 
 
9
 
class Dalmation : public Dog {
10
 
public:
11
 
    Dalmation() { }
12
 
    virtual void fetch();
13
 
};
14
 
 
15
 
void Dalmation::fetch()
16
 
{
17
 
}
18
 
 
19
 
int main()
20
 
{
21
 
    Dalmation z;
22
 
    Dog* y = &z;
23
 
 
24
 
    if (typeid(*y) == typeid(Dalmation))
25
 
    {
26
 
        return 0;
27
 
    }
28
 
 
29
 
    return 1;
30
 
}
31