derived-class
Is it possible to set smarty directories in a derived constructor?
Hey, I\'m trying to do something like this: <?php class MySmarty extends Smarty { public function __construct() {[详细]
2023-02-17 10:12 分类:问答Can I have a base class where each derived class has its own copy of a static property?
I have something like the following situation below: class Base { public static int x; public int myMethod()[详细]
2023-02-12 09:45 分类:问答C++ member-function chaining return types and derived classes
Given this contrived example: struct point_2d { point_2d& x( int n ) { x_ = n; return *this; } point_2d& y( int n ) {[详细]
2023-02-11 16:19 分类:问答Accessing Values in a Class Similar to boost::any
I\'m making a simple boost::any-like class for educational purposes, but I can\'t figure out how to access the stored value.I can set the value perfectly, but when I try to access any member in the \"[详细]
2023-02-11 02:48 分类:问答Problem allocating derived class array with new
I have a simple program $ cat a.cpp #include <iostream> class MyClass { public: virtual void check() {[详细]
2023-02-10 13:44 分类:问答problems accessing derived class in array
class BaseObj { public: int position; }; class EnemyObj: public BaseObj { public: int quantity; }; class PlayerObj: public BaseObj[详细]
2023-02-09 05:16 分类:问答calling __coerce__() method on derived classes results in an error
My trial was like below, but it didn\'t work. class MyNum: def __init__(self , n): self.n = n class MyNum2(MyNum):[详细]
2023-02-09 05:10 分类:问答Class derivation on the fly - Visitor Pattern
I would like to create visitor pattern in such a way public interface Visitable<T>{ public void accept(T visitor);[详细]
2023-02-08 01:44 分类:问答Creating Delegate methods in a Protocol
I cannot seem to build my protocol the way I would like and I have narrowed down to a problem with using derived classes.If I use a cocoa class it seems to work.Here is what I have...[详细]
2023-02-07 09:04 分类:问答How can I serialize base class when working with instance of derived class?
Have the following structure [Serializable] public class Parent { public int x = 5; } [Serializable] public class Child : Parent[详细]
2023-02-07 06:02 分类:问答