标签:padding argv back let space ios amp pad clu
记录一下一个最简单的单例类的实现。
#include "stdafx.h" #include <stdio.h> #include <iostream> using namespace std; class Singleton { public: static Singleton& GetInstance() { static Singleton instance_; return instance_; } ~Singleton() { cout << "~Singleton" << endl; } public: Singleton() { cout << "Singleton " << endl; } Singleton(const Singleton &other); Singleton & operator=(const Singleton &other); }; int _tmain(int argc, _TCHAR* argv[]) { Singleton& slt = Singleton::GetInstance(); return 0; }
标签:padding argv back let space ios amp pad clu
原文地址:https://www.cnblogs.com/betterwgo/p/10372150.html