
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Simonson, Lucanus J Sent: Monday, October 08, 2007 4:17 PM To: boost@lists.boost.org Subject: Re: [boost] [GTL] - geometric template library - determininginterest
John Femiani wrote:
I think there is also something about classes with no data members.
I'm not sure what you are driving at. Perhaps I simply don't know
this
one. Please enlighten me.
Luke _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
------------ main.cpp ------------------- #include <iostream> using namespace std; struct A {}; struct B {}; struct C {}; struct ABC_composite { A _a; B _b; C _c; A& a() {return _a;} B& b() {return _b;} C& c() {return _c;} }; struct ABC_inheritted : public A, public B, public C { A& a() { return * static_cast<A*>(this);} B& b() { return * static_cast<B*>(this);} C& c() { return * static_cast<C*>(this);} }; int main() { cout << "Composite: " << sizeof(ABC_composite) << endl; cout << "Inheritted: " << sizeof(ABC_inheritted) << endl; return 0; } --------- program output ------------- Composite: 3 Inheritted: 1 ---------------------------------------- I just thought it might have something to do with why you opted for it. -- John