clone() only partially doable; how to react?
Suppose we have a class-hierarchy whose base class B
requires a clone()
method to be defined in its derivations. Whilst this works perfectly for most of them there is this one derivation X
that holds an optional reference to a resource/object that can only be referenced from one instance of X
. Whilst the rest of X
can be cloned without problems this reference would have to be set to null/nil/nullptr.
clone() only partially doable; how to react?
Suppose we have a class-hierarchy whose base class B
requires a clone()
method to be defined in its derivations. Whilst this works perfectly for most of them there is this one derivation X
that holds an optional reference to a resource/object that can only be referenced from one instance of X
. Whilst the rest of X
can be cloned without problems this reference would have to be set to null/nil/nullptr.
Which programming idiom to choose for this open source library? [closed]
Closed 8 years ago.
Which programming idiom to choose for this open source library? [closed]
Closed 8 years ago.
Which programming idiom to choose for this open source library? [closed]
Closed 8 years ago.
Is checking return values always required? [duplicate]
This question already has answers here: How should I handle exception that *should* never be thrown? [duplicate] (5 answers) Closed 9 years ago. We know that checking return values prevent our software from unexpected states. (You can see CWE definition.) But, we are sometimes sure about the return value. For example: bool calculateSquareRootReturnFalseIfInputIsNegative(float input, float& […]
Using self.method vs the scope :method DSL
According to the Thoughbot Rails Style Guide, we should
Using self.method vs the scope :method DSL
According to the Thoughbot Rails Style Guide, we should
Using self.method vs the scope :method DSL
According to the Thoughbot Rails Style Guide, we should
Best-Practice for organizing properties in a python class [closed]
Closed 3 months ago.