#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
class Human {
public:
void test() {
printf("Human--------\n");
}
static Human* create(){
return new Human;
}
void destory(){
delete this;
}
private:
Human(){
printf("constructor is called!\n");
}
~Human(){
printf("destrcutor is called!\n");
}
};
int main(int argc, char* argv[]) {
Human *hp = Human::create();
hp->destory();
return 0;
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-1521.html