Questions tagged [c++11]
C++11 is the name of the C++ standard, approved in 2011. It replaces the previous C++03 standard, adding various core language changes and fixes, and an improved and expanded standard library.
                177 questions
            
            
            
                2
            
            votes
        
        
            
                3
            
            answers
        
        
            
                271
            
            views
        
        
            
            
            
        "use auto" and "declare most abstract type", which guideline has higher priority?
                    According to Why define a Java object using interface (e.g. Map) rather than implementation (HashMap), I know I should declare most abstract type when possible, for example, suppose I'm using an UI ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                667
            
            views
        
        
            
            
            
        C++ memory visibility, passing data between threads
                    I use code like this and it seems to work fine:
void addActions(const vector<zero_arity_function>& _actions)
{
    actionsMutex.lock();
    for (auto entry : _actions) {
        ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                220
            
            views
        
        
            
            
            
        What is the minimum now() functionality required for std::chrono clocks [closed]
                    I would like to use std::chrono::time_point in some simulation software I am writing.  I would like to take advantage of features like the time point arithmetic functions.  However, I run into a snag. ...
                
            
       
        
            
                0
            
            votes
        
        
            
                2
            
            answers
        
        
            
                352
            
            views
        
        
            
            
            
        Modular Design affects compilation time
                    Does modular design decrease compilation time in cpp? My professor said so, but I don't understand how, because the build and compilation time depend on the amount of code, right?
Also, wouldn't ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                1k
            
            views
        
        
            
            
        Is TC++PL 4th Edition by Bjarne Stroustrup outdated?
                    First of all, I hope this question doesn't fall under "Asking For Books Recommendation" Category.
Since TC++PL covers C++11, it is 3 revisions old (C++14, C++17, C++20), the ISO group is ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                2k
            
            views
        
        
            
            
        How does a blocking call work?
                    Effective Modern C++ recommends using void futures as a way to communicate one-off events from one thread to another. Below is a minimal reproduction of that practice.
std::promise<void> promise;...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                62
            
            views
        
        
            
        Dynamically discovering field usages for validation
                    Thanks for reading my question.
I have a class which reads a configuration and based on the configuration, populates a data structure by reading from a database, which is ultimately presented to a ...
                
            
       
        
            
                0
            
            votes
        
        
            
                0
            
            answers
        
        
            
                74
            
            views
        
        
            
            
        Modular design of authentication schemes for a http client
                    I want to make a httpClient wrapper that is able to use a predefined set of authentification methods: basic, digest, token (oauth), ntlm just to name a few that I will have to implement.
My approach ...
                
            
       
        
            
                1
            
            vote
        
        
            
                3
            
            answers
        
        
            
                895
            
            views
        
        
            
            
            
        What is the best object-oriented design approach for a tree with two node types?
                    I have a tree-like structure as shown in below picture (as one small example). The tree consists of two different node types, that are:
Data Nodes: These nodes that are colored in yellow contain about ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                336
            
            views
        
        
            
            
            
        Worker pool running tasks of the same kind serially
                    I would like to run tasks in parallel. At this time, I am using a very simple
worker pool using a single concurrent queue shared by all the threads.
Every task has a non unique "tag" (an integer in ...
                
            
       
        
            
                2
            
            votes
        
        
            
                1
            
            answer
        
        
            
                301
            
            views
        
        
            
            
            
        Why did C++11 add find_if() instead of overloading find()?
                    Why did c++11 add a separate find_if() instead of simply overloading the existing find()?
Wouldn't overloading the function be sufficient?
                
            
       
        
            
                4
            
            votes
        
        
            
                1
            
            answer
        
        
            
                133
            
            views
        
        
            
        Coupling and shared entity classes
                    I am currently working on a problem that has a central controller that is handling inputs and outputs between various modules and maintaining a number of entity classes as these change. When working ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                319
            
            views
        
        
            
            
        Introduce code standard into old code
                    Our main product is written in C++ MFC and follows the same code standard as MFC. 
Now we will start to develop new components, and think about whether we should continue to use the same outdated ...
                
            
       
        
            
                2
            
            votes
        
        
            
                0
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
        multithreading - waiting on a condition without using locks (c++11)
                    i've been wondering about it for a while now but never found any answers. is it possible to use something like a condition variable without a lock?
I have a vector of objects, and a thread pool, and ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                229
            
            views
        
        
            
            
        What OOP design pattern would work best for an overseeing class connecting related objects enforced at compile-time?
                    The Problem
I would like to create a managing "overseer" class that connects several related object groups together where any particular group is able to be easily swapped for another using ...