08 2022 档案
摘要:单例模式保证一个类仅有一个实例,并提供一个访问它的全局访问点 泛型单例模式需要变参构造函数,构造函数的参数个数需要支持变化 下面是不用变参模板,支持0~6个参数的单例模式实现 #include <iostream> // 泛型单例模式需要变参构造函数,构造函数的参数个数需要支持变化 // 支持0~6
阅读全文
摘要:#include <iostream> #include <fstream> #include <stdio.h> #include <string.h> #include <dirent.h> #include <sys/stat.h> #include <sys/types.h> #includ
阅读全文