Difference between revisions of "CPP/unique ptr"
From ProgrammingExamples
< CPP
(→unique_ptr.cpp) |
(→CMakeLists.txt) |
||
| Line 21: | Line 21: | ||
cmake_minimum_required(VERSION 2.6) | cmake_minimum_required(VERSION 2.6) | ||
| − | PROJECT( | + | PROJECT(unique_ptr) |
| − | ADD_EXECUTABLE( | + | ADD_EXECUTABLE(unique_ptr unique_ptr.cpp) |
</source> | </source> | ||
Revision as of 09:14, 6 April 2011
unique_ptr.cpp
#include <iostream> #include <memory> int main(int argc, char *argv[]) { std::unique_ptr<int> myInt(new int); *myInt = 5; std::cout << *myInt << std::endl; return 0; }
CMakeLists.txt
cmake_minimum_required(VERSION 2.6) PROJECT(unique_ptr) ADD_EXECUTABLE(unique_ptr unique_ptr.cpp)