March 14th, 2009, 01:50 PM
Lindley: agreed, it often even helps me find the cause of segfaults faster than gdb...
htonivi: You may have to compile your code with debug symbols using -g to get backtraces (more detail). This...
March 12th, 2009, 11:36 AM
Got it.
OK, FYI it has nothing to do with constness because I just tried it and it works with and without the const. The idea is that the collection/container not be a subtype but to hold...
March 12th, 2009, 11:15 AM
So, why not? I think I ran into this problem when I was coding a generic subclass in Java and just expected for it to be true.. I don't remember the explanation.. was it only because of the example...
March 12th, 2009, 11:09 AM
Just for completion I tried out the subtyping relationship I mentioned in my last post. It fails using a dynamic_cast, which I'm puzzled by.. but it works with reinterpret_cast (code below).
I...
March 12th, 2009, 10:49 AM
Thanks for all the responses! This is a great forum to have when I need help with C++. As you may tell I've been using Java for the past 5 years and so now re-learning C++ .. last time I'd used it...
March 11th, 2009, 05:38 PM
Yes, A, B, and C ave virtual functions. That's the point. I'd like listOfStuff<B> to be a sub-type of listOfStuff<A>. In Java you can do that, why wouldn't you be able to in C++? Or are you saying I...
March 11th, 2009, 03:05 PM
Hi,
I'm using g++ 4.3.2. I have templated base class, an inherited subclass with specific template types, and I'd like to subclass that type further with subtypes of the template types.. but I...