c++-faq
What is a lambda expression in C++11?
What is a lambda expression in C++11? When would I use one? What class of problem do they solv开发者_如何学Goe that wasn\'t possible prior to their introduction?[详细]
2023-04-10 06:33 分类:问答Different floating point result with optimization enabled - compiler bug?
The below code works on Visual Studio 2008 with and without optimization. But it only works on g++ without optimization (O0).[详细]
2023-04-06 23:06 分类:问答What happens when an exception goes unhandled in a multithreaded C++11 program?
If I have a C++11 program running two threads, and one of them throws an unhandled exception, what happens? Will the entire program die a fiery death? Will the thread where the exception is thrown die[详细]
2023-04-01 02:19 分类:问答How come a non-const reference cannot bind to a temporary object?
Why is it not allowed to get non-const reference to 开发者_运维百科a temporary object, which function getx() returns? Clearly, this is prohibited by C++ Standard[详细]
2023-03-16 03:16 分类:问答Why should C++ programmers minimize use of 'new'?
I开发者_JAVA百科 stumbled upon Stack Overflow question Memory leak with std::string when using std::list<std::string>, and one of the comments says this:[详细]
2023-03-15 23:54 分类:问答Iterator invalidation rules for C++ containers
This question's answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions.[详细]
2023-03-14 10:22 分类:问答Is the safe-bool idiom obsolete in C++11?
This answer of @R. Martinho Fernandes shows, that the safe-bool idiom is apperently deprecated in C++11, as it can开发者_如何学Python be replaced by a simple[详细]
2023-03-10 06:34 分类:问答What to watch out for when converting a std::string to a char* for C function?
I have read many posts asking the question on how to convert a C++ std::string or const std::string& to a char* to pass it to a C function and it seems there is quite a few caveat\'s in regards to[详细]
2023-02-24 04:52 分类:问答Why is iostream::eof inside a loop condition (i.e. `while (!stream.eof())`) considered wrong?
I just found a comment in this answer saying that using iostream::eof in a loop condition is \"almost certainly wrong\". I generally use something like while(cin>>n) - which I guess i开发者_Pyth[详细]
2023-02-23 00:22 分类:问答What does T&& (double ampersand) mean in C++11?
I\'ve been looking into some of the new features of C++11 and one I\'ve noticed is the double ampersand in declaring variables, like T&& var.[详细]
2023-02-20 12:22 分类:问答