Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make std::initializer_list visible. #9

Merged
merged 1 commit into from May 21, 2018
Merged

Commits on May 21, 2018

  1. Make std::initializer_list visible.

    With C++11 uniform initialization and  initializer lists we cannot
    longer easily see whether we are calling a normal constructor or one
    which takes a initializer_list. For example:
    
    struct V {
      V(int x) {}
      V(std::initializer_list<int> x) {}
    
    };
    
    V v{1};
    V vv{1, 2};
    
    Surprisingly to some people, in both cases the second constructor, taking
    a std::initializer_list, is used.
    
    This change shows the difference by putting the name
    std::initializer_list<T> in front of an initializer list.
    Andreas Fertig committed May 21, 2018
    Configuration menu
    Copy the full SHA
    a127948 View commit details
    Browse the repository at this point in the history