若欲完全禁止,不但必须把 copy controls 放到 private 内且不可以定义它。 bost::nonocopyable Alias Template (template typdef) template <typename T> using Vec = std::vector<T, MyAlloc<T>>; // standard vector using own allocator ==> Vec<int> coll; // [等价于] <==> std::vector<int, My...
void hexDump (char *desc,void *addr,int len); char* log_Time(void); #ifdef __cplusplus } #endif #endif /* hexdump_h */ #include <stdio.h> #include “hexdump.h” #include <sys/timeb.h> #include char* log_Time(void) { struct tm *ptm; struct timeb stTimeb; static char sz...
文章目录 nocopyable Logger Timestamp InetAddr nocopyable //以前的那种是语言级别的,这个是编译器级别的 #pragma once /* 原理:派生类的拷贝构造和赋值,肯定要先调用基类的拷贝构造跟赋值采用这种方式,可以让派生类直接无法拷贝构造跟赋值 为什么不在子类里面自己delete呢?优雅呗哈哈哈 */ //作为一个没有拷贝构造...