Click here to Skip to main content
15,909,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unique ID of a computer. Pin
Waldermort30-Aug-07 21:46
Waldermort30-Aug-07 21:46 
GeneralRe: Unique ID of a computer. Pin
Nishad S30-Aug-07 22:18
Nishad S30-Aug-07 22:18 
AnswerRe: Unique ID of a computer. Pin
Russell'30-Aug-07 22:00
Russell'30-Aug-07 22:00 
AnswerRe: Unique ID of a computer. Pin
Sarath C30-Aug-07 22:09
Sarath C30-Aug-07 22:09 
QuestionA linked list is some kind of collection. [modified] Pin
6Qing8830-Aug-07 21:05
6Qing8830-Aug-07 21:05 
AnswerRe: A linked list is some kind of collection. Pin
Cedric Moonen30-Aug-07 21:29
Cedric Moonen30-Aug-07 21:29 
AnswerRe: A linked list is some kind of collection. Pin
jhwurmbach30-Aug-07 21:32
jhwurmbach30-Aug-07 21:32 
GeneralRe: A linked list is some kind of collection. Pin
Emilio Garavaglia30-Aug-07 22:04
Emilio Garavaglia30-Aug-07 22:04 
jhwurmbach wrote:
without inheriting any interface


That's not proper.
They don't inherit by class inheritance, but they all "inherit" (make use of)a same "interface" (set of public methods) from a common "model" (not a C++ concept, but an abstract concept) so that a generic algorithm can invoke them regardless of the kind of collection you are using. Unless your dealing with specific method not supported by all the collection types.

Template generic programming don't inherits function from the bottom, but construct it on top. But always "inheritance" (in plain English) is.

An "idiot" append algorithm like
template<clas A, class C>
void add(const A& item, C& collection)
{ collection.push_back(item); }

works the same for vector, list, deque, stack.
And does'nt compile for collection that don't support push_back or if you try it with not properly related A and C.

Unfortunately for STL, in all the cases where value semantics is not desirable (i.e: A is a huge structure you don't want to continuously copy), or when classic C++ inheritance is needed, (you need proper translation units, not template instantiation) its not the way to go...



2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:

GeneralRe: A linked list is some kind of collection. Pin
jhwurmbach30-Aug-07 22:12
jhwurmbach30-Aug-07 22:12 
GeneralRe: A linked list is some kind of collection. Pin
Emilio Garavaglia30-Aug-07 22:44
Emilio Garavaglia30-Aug-07 22:44 
GeneralRe: A linked list is some kind of collection. Pin
jhwurmbach30-Aug-07 22:48
jhwurmbach30-Aug-07 22:48 
AnswerRe: A linked list is some kind of collection. Pin
Emilio Garavaglia30-Aug-07 22:15
Emilio Garavaglia30-Aug-07 22:15 
QuestionEdit box Pin
Kiran Pinjala30-Aug-07 20:21
Kiran Pinjala30-Aug-07 20:21 
AnswerRe: Edit box Pin
Nishad S30-Aug-07 20:44
Nishad S30-Aug-07 20:44 
AnswerRe: Edit box Pin
chandu00430-Aug-07 20:51
chandu00430-Aug-07 20:51 
GeneralRe: Edit box [modified] Pin
Kiran Pinjala30-Aug-07 21:10
Kiran Pinjala30-Aug-07 21:10 
GeneralRe: Edit box [modified] Pin
chandu00430-Aug-07 21:18
chandu00430-Aug-07 21:18 
AnswerRe: Edit box Pin
6Qing8830-Aug-07 21:31
6Qing8830-Aug-07 21:31 
GeneralRe: Edit box Pin
Nishad S30-Aug-07 21:34
Nishad S30-Aug-07 21:34 
GeneralRe: Edit box Pin
jhwurmbach30-Aug-07 21:34
jhwurmbach30-Aug-07 21:34 
AnswerRe: Edit box Pin
jhwurmbach30-Aug-07 21:36
jhwurmbach30-Aug-07 21:36 
AnswerRe: Edit box Pin
Anurag Gandhi30-Aug-07 23:41
professionalAnurag Gandhi30-Aug-07 23:41 
AnswerRe: Edit box Pin
Iain Clarke, Warrior Programmer31-Aug-07 0:05
Iain Clarke, Warrior Programmer31-Aug-07 0:05 
QuestionWaitForSingleObject Not working.. Help Plzz Pin
megha_gharote30-Aug-07 20:09
megha_gharote30-Aug-07 20:09 
Answersome more details required ot solve. Pin
chandu00430-Aug-07 20:19
chandu00430-Aug-07 20:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.