Topic: Vote for Aggregate Initialiser Syntax


Author: fgothamNO@SPAM.com (Frederick Gotham)
Date: Wed, 13 Sep 2006 04:23:08 GMT
Raw View
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 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

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: Francis Glassborow <francis@robinton.demon.co.uk>
Date: Wed, 13 Sep 2006 08:35:42 CST
Raw View
In article <x%INg.13657$j7.330154@news.indigo.ie>, Frederick Gotham
<fgothamNO@SPAM.com> writes
>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).
>
Please take the time to read the papers  already on the table about
initialisation. Bjarne Stroustrup, Lois  Goldthwaite, Gabriel Dos Reis
and I are all involved in the issue. What  we are currently working on
is far ahead of what you are suggesting and considers many more aspects
of initialisation than your proposals.

--
Francis Glassborow      ACCU
Author of 'You Can Do It!' and "You Can Program in C++"
see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]