Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: object initialization syntax Keywords: objects initialization syntax aggregates Message-ID: <366@taumet.com> Date: 31 Jul 90 16:49:10 GMT References: <7@wotk.UUCP> Organization: Taumetric Corporation, San Diego Lines: 18 root@wotk.UUCP writes: >I'm curious why the following syntax was chosen for initializing an instance >of a class - >MyClass X(1,2,3,); >instead of the syntax used in C aggregate data types - >MyStruct X = {1,2,3}; The latter syntax says the first element gets 1, the second gets 2, etc. For an ordinary (non-class) aggregate type, this is still valid in C++. But there is no requirement that the parameters to a constructor bear any relationship whatever to the data members of a class. Using data-aggregate initialization syntax to call a function would seem to me to be confusing and non-intuitive. -- Steve Clamage, TauMetric Corp, steve@taumet.com