Re: custom treemodel?
- From: "Jonathon Jongsma" <jonathon jongsma gmail com>
- To: "Murray Cumming" <murrayc murrayc com>
- Cc: "Andrew E. Makeev" <andrew solvo ru>, gtkmm list <gtkmm-list gnome org>, paul linuxaudiosystems com
- Subject: Re: custom treemodel?
- Date: Wed, 17 May 2006 09:08:45 -0500
On 5/17/06, Murray Cumming <murrayc murrayc com> wrote:
>> > even cooler if it actually derived from some STL abstract type,
>>
>> What kind of type do you mean exactly? Standard C++ containers are not
>> meant to be used as base classes. They do conform to standard
>> types/requirements, but I think those are just concepts rather than
>> actual
>> classes.
>
> i do this quite often actually. but what i really meant was to derive
> from the abstract classes behind the instances. e.g. Sequence, Container
> etc. rather than vector, list. these are real classes i believe.
No, I don't think so, though it might be vendor-specific:
http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1list.html
Yes, I don't believe there's anything in the C++ standard that
specifies common base classes for any of these containers, so it's
probably very implementation-defined.
In addition, they don't have virtual destructors, which is why it's
generally not recommended to inherit from them. So I usually end up
using composition instead of inheritance when I want to 'extend' a
standard container type, even though it is more awkward.
Jonner
(all of these Paul Davises are confusing me. we need some nicknames :)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]