从堆栈中手动删除对象是不好/非法的 C++,还是在某些情况下可以接受?
编辑
Constructor(pointer parent, pointer left, pointer right):parent_(parent),left_(left), right_(right)
{ }
~Constructor()
{
delete parent_;
delete left_;
delete right_;
}
main()
{
Object parent;
Object left;
Object right;
Constructor c(&parent,&left,&right);
}
有什么方法可以检查对象是在堆上还是在堆栈上?