When is std::weak_ptr useful?
I started studying smart pointers of C++11 and I don’t see any useful use of std::weak_ptr. Can someone tell me when std::weak_ptr is useful/necessary? 15 Answers 15
I started studying smart pointers of C++11 and I don’t see any useful use of std::weak_ptr. Can someone tell me when std::weak_ptr is useful/necessary? 15 Answers 15
When I try to run a CMake generated makefile to compile my program, I get the error that range based for loops are not supported in C++ 98 mode. I tried adding add_definitions(-std=c++0x) to my CMakeLists.txt, but it did not help. I tried this too: if(CMAKE_COMPILER_IS_GNUCXX) add_definitions(-std=gnu++0x) endif() When I do g++ –version, I get: … Read more