我打算有一个构造函数来接受引用,然后创建指向作为引用传递的对象的指针,并将这些指针存储在一个字段中。然而,由于某种原因,我这样做,复制正在创建,我不明白为什么: #include <iostream>
#include <vector>
#include <memory>
// the class with the field of pointers
template<class T,
这些代码工作完美: #include <ctime>
int main()
{
time_t t;
struct tm* now;
t = time(0); // Here is my attention
now = localtime(&t); // and here
return 0;
}
现在我想在if语句以此作为条件,