Re: Unions and Performer 2.0 structs

New Message Reply Date view Thread view Subject view Author view

Nicolas Gauvin (nicolas++at++cae.ca)
Fri, 16 Feb 1996 12:04:02 -0500


dheskamp++at++ldsa.com was saying:

>Would someone please tell me why the Performer C++ API's basic structs
>(pfVec3, pfCoord, etc.) are not capable of being part of a union. What
>advantage would have been lost if that capability were retained?

Because those structs are now more than simple C structs with only datas
associated to them. In C++ a struct is a class with all members public
by default.

The reference book 'C++ programming language' written by Bjarne Stroustrup
inventor of the language says the following on constructors (p571 second ed):

"An object of a class with a contrusctor cannot be a member of a union"

pfVec* are C++ structures and thus class having constructors. To me this
is a small to price to pay for the convenience that we get from having
constructors and methods associated to them.

     ___/ | ___/ Nicolas Gauvin e-mail: nicolas++at++cae.ca
    / / | / Software Developper voice: (514) 341-2000 x2275
   / / | __/ CAE Electronics Ltd. fax: (514) 340-5496
  / ___ | / 8585 Cote De Liesse, P.O. Box 1800
_____/ _/ _| _____/ Saint-Laurent, Quebec, Canada, H4L-4X4


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:25 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.