
On 29 November 2013 14:12, Daryle Walker wrote:
For C++11, array members can finally be put in member-initializers.
Array members were always allowed in member-initializers.
But brace- initialization must be used,
No, you can value-initialize them with () too.
and they're still not Assignable:
Foo( int p1, Arr3 const &p2, long p3 ) : m1( p1 ), m2{}, m3{ p3 } { std::copy(std::begin(p2), std::end(p2), std::begin(m2)); }
(The "m2" member initialization could have been omitted since the body completely paves those values over.)
That's why I omitted it :-)
Another option is just to provide a wrapper around std::array that offers the implicit conversion to pointer.
The aggressive array-to-pointer decay makes arrays 2nd-class types in the C family of languages and is our (not so) secret shame. A design that needs to emulate this decay is probably broken.
Yes, but that's what the OP specifically asked for.