Top "Std" questions

The C++ Standard Library, and its namespace.

How do I erase elements from STL containers?

How do I erase elements from STL containers, having a specified value, or satisfying some condition? Is there a single …

c++ c++11 stl std
Default capacity of std::string?

When I create a std::string using the default constructor, is ANY memory allocated on the heap? I'm hoping the …

c++ string std dynamic-memory-allocation stdstring
std::variant reflection. How can I tell which type of value std::variant is assigned?

I have a class called foo_t that has a member called bar which could be any one of the …

c++ reflection std variant type-erasure
Why isn't std::initializer_list a language built-in?

Why isn't std::initializer_list a core-language built-in? It seems to me that it's quite an important feature of C++11 …

c++ c++11 std initializer-list
How to create an std::function from a move-capturing lambda expression?

I'm trying to create an std::function from a move-capturing lambda expression. Note that I can create a move-capturing lambda …

c++ lambda std c++14
How to get a pointer to last inserted element of a std::vector?

I came up with the following snipped but it looks quite hacky. vector<int> collection; collection.push_back(42); …

c++ pointers std stdvector push-back
std::out_of_range error

I am working on the following code in opencv in Linux Ubuntu. x_captured and y_captured are "int" type …

c++ opencv std out
std::endl in a string variable?

Hi i want to save multiply lines in a string. I got a string logstring and i want to save …

c++ string std endl
Remove characters from std::string from "(" to ")" with erase ?

I want to remove the substring of my string , it looks something like this : At(Robot,Room3) or SwitchOn(Room2) …

c++ string std erase
Mingw 'std::function' has not been declared?

First of all, I'm using code blocks on windows with the latest mingw release. I am using the sfml library …

c++ c++11 std sfml