Consider a class with two std::atomic<int>
members, initialized as below.
I'm looking for a language lawyer answer, with references, to the question: is
there any difference between the two of these syntaxes according to the C++11
standard?
class Foo {
std::atomic<int> a {17}; // 1.
std::atomic<int> b = {17}; // 2.
}
My reading of [dcl.init] in the standard is that these are both list-initialization, but I'm having trouble keeping all of the relevant bits in my head and am not confident about that.
If there's no difference for std::atomic<int>
, would there be for any other
type?
Edit: This was marked as a dupe of another question that does answer the basic issue, but doesn't contain references in the standard. I'm looking for particular sections that define these to be equivalent, or define their differences. In particular, I can't find the exact place where the syntax for #2 is defined.