dynamic-cast
Explicit instantiation of a templated class and dynamic_cast in a shared library
I stumbled into a problem today that I can\'t seem to solve. I am compiling a shared library that includes a templated class (Derived<T>, whose base is Base) and some explicit instantiations of[详细]
2023-03-07 21:53 分类:问答How expensive are dynamic casts in C++?
For my GUI API which works with a variety of backends (sdl, gl, d3d开发者_如何学JAVA, etc) I want to dynamically cast the generic type image to whatever it may happen to be.[详细]
2023-02-25 23:02 分类:问答C++: Comparing pointers of base and derived classes
I\'d like some information about best practices when comparing pointers in cases such as this one: class 开发者_StackOverflowBase {[详细]
2023-02-24 09:39 分类:问答dynamic_cast issues: typeid object is not equal, but name is equal
I found that dynamic_cast didn\'t work 开发者_C百科in a situation where I expected it to, and looking at the typeid of the objects at runtime has made the situation even less clear. I just want a cast[详细]
2023-02-24 04:34 分类:问答dynamic cast throws pointer is not std::__non_rtti_object
I\'m having problem with dynamic_cast. i just compiled my project and tested every thing in debug mode and then i tried compiling it in release mode, i have copied every configuration from debug mode[详细]
2023-02-23 07:19 分类:问答c++ dynamic_cast
class CBase { }; class CDerived: public CBase { }; CBaseb; CBase*pb; CDerivedd; CDerived* pd; pb = dynamic_cast<CBase*>(&d);// ok: derived-to-base[详细]
2023-02-17 06:21 分类:问答Checking whether a cross-cast could possibly work?
I know that it\'s legal to use dynamic_cast to do a \"cross-cast\" across a class hierarchy.For example, if I have classes that look like this:[详细]
2023-02-16 22:21 分类:问答C++ Design question: Passing functions via templates?
Thanks in advance for reading.This is a picky design question in that I have an adequate solution, but question if there isn\'t a better way via templates, which I\'m not very experienced with.[详细]
2023-02-15 13:45 分类:问答Dynamic casts returns null when library with C++ python extensions is used as a plugin on RHEL5
I have a library with C++ python extensions (C++ calls python which in turn calls C++) using boost::python and python libraries (this is messy, but a lot of it is legacy) which when tested standalone[详细]
2023-02-14 01:35 分类:问答C++ boost::shared_ptr & boost::weak_ptr & dynamic_cast
I have something like this: enum EFood{ eMeat, eFruit }; class Food{ }; class Meat: public Food{ void someMeatFunction();[详细]
2023-02-10 05:23 分类:问答
加载中,请稍侯......