是否有可能使用像“2016-07-13T25:50”这样的日期解析时间来获取值为“2016-07-14T01:50”的LocalDateTime?我只想使用 Joda 时间和 java.util。
我测试了一些c ++ 14的新功能,我想知道为什么这些指针没有相同的地址
#include <iostream>
#include <memory>
class Test
{
public :
Test(){std::cout << "Constructor" << std::endl;}
Test(int val){value = val;}
~Test(){std::cout << "Destructor" << std::endl;}
private :
unsigned int value;
};
int main(int argc, char *argv[])
{
std::unique_ptr<Test> ptr(new Test(45));
std::cout << &ptr << std::endl;
std::unique_ptr<Test> ptr2 (std::move(ptr));
std::cout << &ptr2 << std::endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
Output :
0xffffcbb0
0xffffcba0 //Why it's not the same as previous
Destructor
Run Code Online (Sandbox Code Playgroud)
谢谢你,有一个美好的一天