I have set up an online poll:
http://snappoll.com/poll/130337.php
to ask C++ programmers whether they want aggregate initialiser syntax to be
added to the Standard. Here's is how it works:
struct MyAgg { int a; double b; };
class MyClass {
private:
int const arr[3];
MyAgg const agg;
public:
MyClass(int const a,int const b,int const c)
: arr( {a,b,c} ), agg( {b, c * 5.4} )
{
/* Function Body */
}
};
And also:
int *const p = new int[3]({5,4,3});
MyAgg *const p = new MyAgg({3,56.3});
The reason I set up the poll is to possibly demonstrate to the Standards
Committee that programmers feel that this is a fundamental programming
function, and should be provided by the language. (They haven't paid much
attention to the request of late).
--
Frederick Gotham