MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] [TECHNICAL] [SOLVED] (template problem).
bruce#puremagic,com wrote:
> Templates with g++ 2.7.2 are so much fun.
>
> > So the question is, anyone know how to get the compiler to spit out the
> > pre-processed code so I can take a look at what line it's complaining about?
>
> gcc -E will send the preprocessed output to stdout and not try to compile
> it.
That worked, but produced nothing that I knew how to make use of,
however...
>
> For the mangled symbol, check out the program c++filt .. it is really
> useful.
That provided the clue I needed!!
(It was the: ObjArray<int>& operator=(const ObjArray<int> blah); method.
The problem was something like this:
#include "MyTemplate.h"
class foo {
ObjArray<int> array;
foo(const foo& src) { *this = src; }
...
// The important part is that no operator=(const foo& src) is defined
};
It looks like when g++ 2.7.2 was creating the default operator= method, it did
not count that as a reason to instantiate/create/whatever the ObjArray<T>
operator= method. (Which was defined and implemented.)
After I put the operator= in class foo (which just did a this->blah = src.blah
for all members blah), it compiled and linked fine (and is now running :))
Thanks for all the help folks!
Ben
--
Ben Greear (greear#cyberhighway,net) http://www.primenet.com/~greear
Author of ScryMUD: mud.primenet.com 4444 (Released under GPL)
http://www.primenet.com/~greear/ScryMUD/scry.html
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev
- Thread context:
- RE: [MUD-Dev] Text Parsing, (continued)
- [MUD-Dev] Searching the archives,
claw claw#kanga,nu, Fri 28 May 1999, 06:10 GMT
- [MUD-Dev] [TECHNICAL] How to generate pre-processor output (template problem).,
Ben Greear greear#cyberhighway,net, Fri 28 May 1999, 04:45 GMT
- Re: [MUD-Dev] [TECHNICAL] How to generate pre-processor output (template problem).,
bruce bruce#puremagic,com, Fri 28 May 1999, 04:55 GMT
- Re: [MUD-Dev] [TECHNICAL] How to generate pre-processor output (template problem).,
Greg Miller gmiller#classic-games,com, Sat 29 May 1999, 00:50 GMT
- Re: [MUD-Dev] [TECHNICAL] How to generate pre-processor output (template problem).,
Oliver Jowett icecube#ihug,co.nz, Sat 29 May 1999, 02:40 GMT
[ Other Periods
| Other mailing lists
| Search
]