Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Who's RIght? ZTC & GNU or SUN? Message-ID: <486@taumet.com> Date: 20 Oct 90 15:16:27 GMT References: <690@vermont.UUCP> Organization: Taumetric Corporation, San Diego Lines: 19 jeffrey@vermont.UUCP (Jeffrey Greenberg) writes: |zortech c++ 2.1 and gnu c++ compile the following code, which I |believe is correct. However, the sun c++ 2.0 gives the error: | "cannot initialize ::x with initializer list" |class dog { |private: | int x; |}; |dog x[4] = { 1,2,3,4 }; According to E&S, an aggregate type may not be initialized in this way if it contains private or protected members, among other things. The idea is that C-like structures can still be initialized in the C way, but once the aggregate looks like a C++ class, you can't do it. -- Steve Clamage, TauMetric Corp, steve@taumet.com