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

Use double braces for std:array initialization to avoid clang warning. #1397

Merged
merged 1 commit into from Oct 25, 2014

Conversation

comex
Copy link
Contributor

@comex comex commented Oct 25, 2014

std::array does not have an initializer list constructor, instead (for
some reason) being defined to contain one public array member, allowing
it to be directly initialized. Thus the most explicit way to initialize
it is with two braces, one for the struct and one for the array. C++
allows the second pair of braces to be omitted, but clang complains
about it.

std::array does not have an initializer list constructor, instead (for
some reason) being defined to contain one public array member, allowing
it to be directly initialized.  Thus the most explicit way to initialize
it is with two braces, one for the struct and one for the array.  C++
allows the second pair of braces to be omitted, but clang complains
about it.
@lioncash
Copy link
Member

I believe it is only in C++14 that the second pair can be left out (for object types, that is. They can already be left out for primitive types). Either way, thanks for catching this.

lioncash added a commit that referenced this pull request Oct 25, 2014
Use double braces for std:array initialization to avoid clang warning.
@lioncash lioncash merged commit 26adb3c into dolphin-emu:master Oct 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants