Re: recurring template problem
From: velthuijsen (velthuijsen_at_hotmail.com)
Date: 04/07/04
- Next message: markus_e: "Re: Calls with a Variable Number of Arguments"
- Previous message: John Harrison: "Re: random number generator"
- In reply to: John Harrison: "Re: recurring template problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Apr 2004 01:52:31 -0700
"John Harrison" <john_andronicus@hotmail.com> wrote in message news:<c4uno6$2o08jm$1@ID-196037.news.uni-berlin.de>...
> "velthuijsen" <velthuijsen@hotmail.com> wrote in message
> news:e54e13ae.0404060149.4187f4cc@posting.google.com...
> > I've been reading (and using the examples in) Thinking in C++ (vol 2).
> >
> > One of the things that the author shows you can do with templates is
> > the following:
> >
> [snip]
> >
> > I know that I'm missing something here since the code will compile
> > without a warning but when I uncomment // Main TestID; I get
> > unresolved externals (ctor & dtor). The question is what is is that am
> > I missing? What rules am I trying to break? And is there a way around
> > the problem?
>
> It's the old, old problem. Put all your template code in the header file,
> that's where it belongs. I'm surprised Bruce Eckel didn't explain that in
> his book, but here it is in the FAQ.
He did. In his first book, chapter 16. Guess this is what I get when I
just copy/paste existing files instead of trying to remember all the
excercises he'd suggested.
> http://www.parashift.com/c++-faq-lite/containers-and-templates.html
>
> questions 34.12 to 34.15
>
- Next message: markus_e: "Re: Calls with a Variable Number of Arguments"
- Previous message: John Harrison: "Re: random number generator"
- In reply to: John Harrison: "Re: recurring template problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|