[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: questions about c++ templates
From: Kleag <kleag () free ! fr>
Date: 2006-08-18 21:09:04
Message-ID: 200608182309.05048.kleag () free ! fr
[Download RAW message or body]
Well, with this code, templates have no influence, at least for nm: with or
without them, there is no difference except for addresses.
-0804894a W Base::Base()
+080489ee W Base::Base()
08048920 W Base::~Base()
080488f6 W Base::~Base()
080488cc W Base::~Base()
-080489ec W Child<int>::g()
-08048a1a W Child<int>::pure()
-0804895a W Child<int>::Child()
-080489b4 W Child<int>::~Child()
-0804897c W Child<int>::~Child()
+080489c0 W Child::g()
+080489ba W Child::pure()
+080489fe W Child::Child()
+08048982 W Child::~Child()
+0804894a W Child::~Child()
Regards,
Kleag
Le vendredi 18 août 2006 21:13, Craig Howard a écrit :
> On Friday 18 August 2006 11:03, Frans Englich wrote:
> Interesting. You are correct:
>
> #include <iostream>
>
> using namespace std;
>
> class Base
> {
> public:
> virtual ~Base() {}
>
> virtual void pure() = 0;
> };
>
> template<typename T>
> class Child : public Base
> {
> public:
> virtual ~Child() {}
>
> virtual void pure() {}
> void g() { cout << "T1" << endl; }
> };
>
> int main()
> {
> Child<int> c;
>
> c.g();
>
> return 0;
> }
>
>
> 12:11:38 [21]; nm -C ./a.out | grep Child
> 080489ba W Child<int>::g()
> 080488de W Child<int>::pure()
> 080488c0 W Child<int>::Child()
> 0804890a W Child<int>::~Child()
> 08048988 W Child<int>::~Child()
> 08048b14 V typeinfo for Child<int>
> 08048b20 V typeinfo name for Child<int>
> 08048b00 V vtable for Child<int>
>
> Does anybody know why that is? And why there are two destructors for
> Child?
--
KsirK - a turn-based strategy game for KDE
http://gna.org/projects/ksirk
KGraphViewer - a GraphViz dot graphs viewer
http://gna.org/projects/kgraphviewer
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic