|
Boost Users : |
Subject: Re: [Boost-users] Obtaining base class type
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-06-09 15:05:17
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 09 June 2009, Robert Dailey wrote:
> Hmm now that I think about it, I don't think this is really possible at
> compile time. You have to consider issues like multiple bases (Through
> either a linear chain of inheritance, or multiple inheritance cases).
>
> If there were only a way to simplify this. Specifying the base class in two
> places is obviously error-prone, and I am hoping there are other solutions
> to cleaning this up.
It sounds like is_base_of and BOOST_STATIC_ASSERT would be enough to catch the
errors at least? That is, you could make your own macro that does the type
checking before passing the arguments on to BEGIN_EVENT_TABLE.
>
> On Tue, Jun 9, 2009 at 1:36 PM, Robert Dailey
> <rcdailey_at_[hidden]<mailto:rcdailey_at_[hidden]>> wrote: Hey everyone,
>
> I'm using wxWidgets, and as you all may know they have a silly macro used
> to define an event table...
>
> BEGIN_EVENT_TABLE( MainWindow, wxFrame )
> EVT_CLOSE( MainWindow::OnClose )
> END_EVENT_TABLE()
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkousm0ACgkQ5vihyNWuA4V4qQCg2FAMkeaXPLyPgUUWdDQFP7wr
KVsAoII3kgShdySIk7yvA8QOgiI/XmQI
=f+pv
-----END PGP SIGNATURE-----
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net