Eclipse 3.7.1 CDT 1.4.1 GCC 4.6.2 This is an example of a piece of C++11 code: auto text = std::unique_ptr<char>(new char...
Every standard container has a begin and end method for returning iterators for that container. However, C++11 has apparently introduced free functions called ...
-
May 28, 2022
- 0 Comments
I originally posted this as a question only about destructors, but now I’m adding consideration of the default constructor. Here’s the original question: ...
-
May 27, 2022
- 0 Comments
I have this code that doesn’t work, but I think the intent is clear: testmakeshared.cpp #include <memory> class A { public: static ::std::shared_ptr<A> ...
-
May 27, 2022
- 0 Comments
For one class I want to store some function pointers to member functions of the same class in one map storing std::function objects. ...
-
May 26, 2022
- 0 Comments
I want to have a static const char array in my class. GCC complained and told me I should use constexpr, although now ...
-
May 26, 2022
- 0 Comments
[dcl.attr.noreturn] provides the following example: [...
This question already has answers here: Is Meyers’ implementation of the Singleton pattern thread safe? (6 answers) Closed 4 years ago. I know ...
-
May 26, 2022
- 0 Comments
#include <iostream> struct a { enum LOCAL_A { A1, A2 }; }; enum class b { B1, B2 }; int foo(int input) { ...
-
May 26, 2022
- 0 Comments