473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Aggregate Initialiser Syntax

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
Sep 13 '06 #1
1 1692
In article <z0*******************@news.indigo.ie>, fg*******@SPAM.com
says...
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:
If you're going to suggest this, wouldn't it make more sense to follow
the same syntax used in C99, as in:

struct { int a[3], b; } w[] =
{ [0].a = {1}, [1].a[0] = 2 };

(from C99, $6.7.8/35).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Sep 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steven An | last post by:
Howdy, I need to write an update query with multiple aggregate functions. Here is an example: UPDATE t SET t.a = ( select avg(f.q) from dbo.foo f where f.p = t.y ), t.b = ( select sum(f.q)...
1
by: Job Lot | last post by:
Is it possible to use Aggregate functions with GROUP BY Clauses on DataTable. I have a DataTable with following values: Date Amount Int Balance 1/1/2004 5000.00 50.00 5050.00...
2
by: jc | last post by:
Hi. Just as we have AVG(COLUMN_NAME) and MAX(COLUMN_NAME) how can I write my own variation of a such a function. If I can appreciate how to do this, then I hopefully I can write a...
2
by: Kiel | last post by:
===== My error is: error C2512: no appropriate default constructor available I'm trying to use the default args for class B when it is an aggregate of class A. I could solve this problem with...
1
by: nfrodsham | last post by:
In Microsoft's help literature, it states: "You can filter out non-unique rows by using the DISTINCT option of an aggregate function" I am trying to do this in Access 2003 with the COUNT...
10
by: neb | last post by:
Dear member of the forum, Ms access has built-in aggregate function like: -Sum, Max, First, Avg, ... Is it possible to build user-defined aggregate? (if you have any clue, do not hesitate to...
1
by: R.A.M. | last post by:
Hello, I am learning SQL Server 2005. I have (correctly) written in .NET assembly DemoSQLServer with aggregate function AvgNoMinMax in class Demo and I have added assembly to database...
11
by: alan.larkin | last post by:
Is anyone familiar with the following syntax? <type<id>:<expression>; e.g. double d:2+3; Ive found it in a "standard C" grammar. gcc wont accept it.
22
by: Tomás Ó hÉilidhe | last post by:
I've been developing a C89 microcontroller application for a while now and I've been testing its compilation using gcc. I've gotten zero errors and zero warnings with gcc, but now that I've moved...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.