Why is it wrong to use std::auto_ptr<> with standard containers? 6 Answers 6
I want to examine the contents of a std::vector in GDB, how do I do it? Let’s say it’s a std::vector<int> for the ...
-
May 26, 2022
- 0 Comments
So, I wrote a bunch of code that accesses elements in an stl vector by index...
I was looking at STL containers and trying to figure what they really are (i.e. the data structure used), and the deque stopped ...
-
May 25, 2022
- 0 Comments
I’ve always thought it’s the general wisdom that std::vector is “implemented as an array,” blah blah blah. Today I went down and tested ...
-
May 24, 2022
- 0 Comments
The question is how to convert wstring to string? I have next example : #include <string> #include <iostream> int main() { std::wstring ws ...
-
May 23, 2022
- 0 Comments
What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a ...
-
May 22, 2022
- 0 Comments
Using C++, and hopefully the standard library, I want to sort a sequence of samples in ascending order, but I also want to ...
-
May 21, 2022
- 0 Comments
What is wrong with this program? #include <memory> #include <vector> int main() { std::vector<std::unique_ptr<int>> vec; int x(1); std::unique_ptr<int> ptr2x(&x); vec.push_back(ptr2x); //This tiny command ...
-
May 21, 2022
- 0 Comments