Best way to "redefine" a std class
From: Nafai (nafai3000_at_yahoo.es)
Date: 12/07/04
- Next message: Peter Koch Larsen: "Re: why is this bad"
- Previous message: yanwan: "Re: about the header file"
- Next in thread: msalters: "Re: Best way to "redefine" a std class"
- Reply: msalters: "Re: Best way to "redefine" a std class"
- Reply: adbarnet: "Re: Best way to "redefine" a std class"
- Reply: James Rafter: "Re: Best way to "redefine" a std class"
- Reply: James Rafter: "Re: Best way to "redefine" a std class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 07 Dec 2004 11:23:24 GMT
Hello I want to define a class myList, which is the same that std::list
except from:
- insert (I want to redefine it)
- elements can only be consulted or deleted but not modified.
- I want
Which is the best way to do that?:
1.
template <typename T> myList : public list<T> {
public:
insert(...) { ... }
...
// what about iterators?
};
OR
2.
template <typename T> myList {
private:
list<T> theList;
public:
// all the methos of list addapted to myList
// i.e.:
int size() {return theList.size(); }
...
// what about iterators?
};
- Next message: Peter Koch Larsen: "Re: why is this bad"
- Previous message: yanwan: "Re: about the header file"
- Next in thread: msalters: "Re: Best way to "redefine" a std class"
- Reply: msalters: "Re: Best way to "redefine" a std class"
- Reply: adbarnet: "Re: Best way to "redefine" a std class"
- Reply: James Rafter: "Re: Best way to "redefine" a std class"
- Reply: James Rafter: "Re: Best way to "redefine" a std class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|