dynamic-cast
How to dynamic_cast in objective c
I\'d like to write this code on objective c: bool BordVertical::collisionwith( Jeu& jeu, ElementJeu& element )[详细]
2023-02-09 01:01 分类:问答Does dynamic_cast behave as a static_cast, if there is not a single virtual function?
In a c开发者_如何学编程lass hierarchy without any virtual functions, will dynamic_cast behave as a simple static_cast since it doesn\'t have any information stored for RTTI, or it will give an error?I[详细]
2023-02-07 07:53 分类:问答C++ dynamic_cast - polymorphic requirement and downcasting
In the following code, while constructing obj in case 1, we construct a derived class object too, but its member functions are just inaccessible to obj. So while downcasting (i.e., in case 2), using o[详细]
2023-02-03 14:54 分类:问答Why can't I dynamic_cast "sideways" during multiple inheritence?
The following code throws std::bad_cast struct Foo { void foo () {} }; struct Bar { Bar () { dynamic_cast <Foo &> (*this) .foo ();[详细]
2023-02-03 13:17 分类:问答boost::shared_ptr and dynamic cast
I have a problem using a shared_ptr of a base class, I can\'t seem to be able to call the derived class\'s methods when dereferencing it. I believe code will be more verbose than me:[详细]
2023-01-26 18:01 分类:问答java: combined instanceof and cast?
(Please no advise that I should abstract X more and add another method to it.) In C++, when I have a variable x of type X* and I want to do something specific if it is also of type Y* (Y being a subc[详细]
2023-01-20 09:58 分类:问答Is it possible to dynamic_cast from one base class to another?
For instance I have code like that class Base1 { virtual void wonderFULL() = 0; }; class Base2 { // all this weird members[详细]
2023-01-18 02:50 分类:问答cast const Class using dynamic_cast
I want to cast this: class Base { public: virtual ~Base(){}; }; class Der : public Base {}; int main() { const Base* bas开发者_如何学Ce = new Der;[详细]
2023-01-13 15:27 分类:问答Dynamic cast and multiple inheritance
The dynamic_cast operator is returning zero (0) when I apply to a pointer that points to an instance of a multiply inherited object.I don\'t understand why.[详细]
2023-01-12 05:48 分类:问答Avoiding dynamic_cast in implementation of virtual functions in derived class
Here is some sample code explaining what I am trying to achieve. Basically, I have an algorithm that depends on some basic operations available in a class. I have defined those operations in a pure a[详细]
2023-01-05 22:29 分类:问答
加载中,请稍侯......