Top "Std" questions

The C++ Standard Library, and its namespace.

How to get error message when ifstream open fails

ifstream f; f.open(fileName); if ( f.fail() ) { // I need error message here, like "File not found" etc. - // the …

c++ error-handling stream std
string in namespace std does not name a type

This may just be a simple mistake that I'm not seeing, but I think I'm simply doing something wrong. Don't …

c++ string namespaces std
Ambiguous overload call to abs(double)

I have the following C++ code: #include <math.h> #include <cmath.h> // per http://www.cplusplus.…

c++ std cmath
How to convert std::chrono::time_point to calendar datetime string with fractional seconds?

How to convert std::chrono::time_point to calendar datetime string with fractional seconds? For example: "10-10-2012 12:38:40.123456"

c++ datetime c++11 std chrono
Deleting elements from std::set while iterating

I need to go through a set and remove elements that meet a predefined criteria. This is the test code …

c++ iterator set std c++-standard-library
Converting std::__cxx11::string to std::string

I use c++11, but also some libraries that are not configured for it, and need some type conversion. In particular …

c++ string c++11 types std
Compelling examples of custom C++ allocators?

What are some really good reasons to ditch std::allocator in favor of a custom solution? Have you run across …

c++ memory-management std memory-alignment allocator
What's the difference between "STL" and "C++ Standard Library"?

Someone brought this article to my attention that claims (I'm paraphrasing) the STL term is misused to refer to the …

c++ stl std c++-standard-library c++-faq
'vector' in namespace 'std' does not name a type

I am developing a C++ application using CodeBlocks 10.05 on Debian 7.0.0. For some reason, the following code #include <iostream> …

c++ std stdvector
Does std::vector.clear() do delete (free memory) on each element?

Consider this code: #include <vector> void Example() { std::vector<TCHAR*> list; TCHAR* pLine = new TCHAR[20]; list.…

c++ std