Forcing new to fail [modified]
-
Hi all =) Is there a way of forcing the operator new to fail?? I need to test something... Best regards [[]] hint_54 -- modified at 18:06 Wednesday 31st May, 2006 Oh.. and one more thing =D If I overload the operator new then the class constructors will not be called when memory is allocated for them. How do I make it call the constructor? Peace =) hint_54
-
Hi all =) Is there a way of forcing the operator new to fail?? I need to test something... Best regards [[]] hint_54 -- modified at 18:06 Wednesday 31st May, 2006 Oh.. and one more thing =D If I overload the operator new then the class constructors will not be called when memory is allocated for them. How do I make it call the constructor? Peace =) hint_54
hint_54 wrote:
If I overload the operator new then the class constructors will not be called when memory is allocated for them. How do I make it call the constructor?
Placement new?
new (ptr_to_memory) Class(args)
-- 100% natural. No superstitious additives.
-
Hi all =) Is there a way of forcing the operator new to fail?? I need to test something... Best regards [[]] hint_54 -- modified at 18:06 Wednesday 31st May, 2006 Oh.. and one more thing =D If I overload the operator new then the class constructors will not be called when memory is allocated for them. How do I make it call the constructor? Peace =) hint_54
Overloading the
new
should not effect whether the constructor is called. Steve -
Hi all =) Is there a way of forcing the operator new to fail?? I need to test something... Best regards [[]] hint_54 -- modified at 18:06 Wednesday 31st May, 2006 Oh.. and one more thing =D If I overload the operator new then the class constructors will not be called when memory is allocated for them. How do I make it call the constructor? Peace =) hint_54
hint_54 wrote:
If I overload the operator new then the class constructors will not be called when memory is allocated for them.
How are you verifying this?
"The largest fire starts but with the smallest spark." - David Crow
-
hint_54 wrote:
If I overload the operator new then the class constructors will not be called when memory is allocated for them.
How are you verifying this?
"The largest fire starts but with the smallest spark." - David Crow
-
Overloading the
new
should not effect whether the constructor is called. Steve