From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2003-08-01 08:02:01
> -----Original Message-----
> From: boost-bounces_at_[hidden]
> On Behalf Of Douglas Gregor
> Sent: Friday, August 01, 2003 12:40 AM
> To: Boost mailing list
> Subject: Re: [boost] GUI/GDI template library
> I believe that one bit that falls out of the above agrees 100% with
> poster that suggested the following:
> class list_control; // implemented by the library. Uses some sort
> generic "list element" type
> template<typename Element>
> class typed_list_control; // thin wrapper over list_control.
> is the type of the data in the list
> As noted earlier, this design has a huge number of benefits:
> 1) list_control is not a template, so we can use the simplified
> cross-platform model used in Boost.Threads, and of course this gives
> ability to create a much more dynamic system (e.g., loaded from a
> file) if we choose to.
> 2) typed_list_control gives us all of the great static-checking
> we would want, but in a lightweight veneer.
> I've used this model extensively before (e.g., Boost.Signals uses it
> shrink the size of boost::signal template instantiations), and it has
> very well.
This is exactly what I've got in my control library. The base classes
are called callback_list_ctrl, callback_combo_box, and so on, so named
because my focus at the time was in translating Win32 message maps into
boost::function<>. I actually have a class named 'typed_list_ctrl',
also 'typed_combo_box', etc... These are typically vector based. On top
of them I there is mapped_list_ctrl, mapped_combo_box, etc...
You would be amazed at the amount of code that is saved with the 'typed'
I'm going to try getting some sample code into the sandbox, which I've
never used before.