tagged [c++11]
What's the difference between C++0x concepts and The Boost Concept Check Library (BCCL)?
What's the difference between C++0x concepts and The Boost Concept Check Library (BCCL)? Concepts didn't make the C++0x standard, but Boost still provides [The Boost Concept Check Library (BCCL)](http...
- Modified
- 29 Apr at 20:43
Split a string using C++11
Split a string using C++11 What would be easiest method to split a string using c++11? I've seen the method used by this [post](https://stackoverflow.com/questions/236129/how-to-split-a-string-in-c), ...
How to iterate through a list of objects in C++?
How to iterate through a list of objects in C++? I'm very new to C++ and struggling to figure out how I should iterate through a list of objects and access their members. I've been trying this where `...
Use the auto keyword in C++ STL
Use the auto keyword in C++ STL I have seen code which use vector, ``` vectors; s.push_back(11); s.push_back(22); s.push_back(33); s.push_back(55); for (vector::iterator it = s.begin(); it!=s.end(); i...
cc1plus: error: unrecognized command line option "-std=c++11" with g++
cc1plus: error: unrecognized command line option "-std=c++11" with g++ I'm trying to compile using `g++` and either the `-std=c++11` or `c++0x` flags. However, I get this error ``` g++ (GCC) 4.1.2 200...
- Modified
- 4 Jun at 18:20
Scope of pure virtual functions during derived class destruction - In C++
Scope of pure virtual functions during derived class destruction - In C++ During destruction of the derived class object, i first hit the derived class destructor and then the base class destructor (w...
- Modified
- 29 Jun at 09:53
C++11 reverse range-based for-loop
C++11 reverse range-based for-loop Is there a container adapter that would reverse the direction of iterators so I can iterate over a container in reverse with range-based for-loop? With explicit iter...
- Modified
- 29 Aug at 20:51
What does T&& (double ampersand) mean in C++11?
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`. For a star...
- Modified
- 4 Dec at 22:33
How to enable C++11 in Qt Creator?
How to enable C++11 in Qt Creator? The title is pretty self-descriptive. I've downloaded Qt Creator 2.7.0, and I am trying to compile some basic C++11 code: I'm receiving the following error: Yet, acc...
How to get duration, as int milli's and float seconds from <chrono>?
How to get duration, as int milli's and float seconds from ? I'm trying to use chrono library for timers and durations. I want to be able to have a `Duration frameStart;` ( from app start ) and a `Dur...
- Modified
- 18 Jan at 04:24
What elegant method callback design should be used?
What elegant method callback design should be used? I'm surprised this question wasn't asked before on SO (well, at least I couldn't find it). Have you ever designed a method-callback pattern (somethi...
- Modified
- 4 May at 15:28
Generate random numbers using C++11 random library
Generate random numbers using C++11 random library As the title suggests, I am trying to figure out a way of generating random numbers using the new C++11 `` library. I have tried it with this code: T...
How to make my custom type to work with "range-based for loops"?
How to make my custom type to work with "range-based for loops"? Like many people these days I have been trying the different features that C++11 brings. One of my favorites is the "range-based for lo...
- Modified
- 3 Mar at 08:30
How to automatically convert strongly typed enum into int?
How to automatically convert strongly typed enum into int? ``` #include struct a { enum LOCAL_A { A1, A2 }; }; enum class b { B1, B2 }; int foo(int input) { return input; } int main(void) { std::cou...
- Modified
- 25 Jun at 21:14
C++ auto keyword. Why is it magic?
C++ auto keyword. Why is it magic? From all the material I used to learn C++, `auto` has always been a weird storage duration specifier that didn't serve any purpose. But just recently, I encountered ...
Using generic std::function objects with member functions in one class
Using generic std::function objects with member functions in one class For one class I want to store some function pointers to member functions of the same class in one `map` storing `std::function` o...
- Modified
- 23 Sep at 17:32
How do I pass a unique_ptr argument to a constructor or a function?
How do I pass a unique_ptr argument to a constructor or a function? I'm new to move semantics in C++11 and I don't know very well how to handle `unique_ptr` parameters in constructors or functions. Co...
- Modified
- 13 Nov at 22:44
C++11 rvalues and move semantics confusion (return statement)
C++11 rvalues and move semantics confusion (return statement) I'm trying to understand rvalue references and move semantics of C++11. What is the difference between these examples, and which of them i...
- Modified
- 20 Jun at 09:12
How do I convert a std::chrono::time_point to long and back?
How do I convert a std::chrono::time_point to long and back? I need to convert `std::chrono::time_point` to and from a `long` type (integer 64 bits). I´m starting working with `std::chrono` ... Here i...
- Modified
- 10 Jun at 18:49
error: use of deleted function
error: use of deleted function I've been working on some C++ code that a friend has written and I get the following error that I have never seen before when compiling with gcc4.6: ``` error: use of de...
- Modified
- 19 Dec at 00:23
Should I use virtual, override, or both keywords?
Should I use virtual, override, or both keywords? In the last weeks something is bugging my brain about `virtual` and `override`. I've learned that when you do inheritance with virtual function you ha...
Simple library or implementation for a mathematical expression evaluator
Simple library or implementation for a mathematical expression evaluator i have one text file that contains only one line the line only contains one math expression for example 12+(3.0*(4)-1)/sqrt(121...
What exactly is nullptr?
What exactly is nullptr? We now have C++11 with many new features. An interesting and confusing one (at least for me) is the new `nullptr`. Well, no need anymore for the nasty macro `NULL`. Still, I a...
Using member variable in lambda capture list inside a member function
Using member variable in lambda capture list inside a member function The following code compiles with gcc 4.5.1 but not with VS2010 SP1: ``` #include #include #include #include #include #include usin...
- Modified
- 25 Oct at 21:5