Re: Unions and Performer 2.0 structs

New Message Reply Date view Thread view Subject view Author view

Bernard Leclerc (bleclerc++at++cae.ca)
Fri, 16 Feb 1996 11:46:59 -0500


On Feb 16, 11:25am, dheskamp++at++ldsa.com wrote:

> 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?

Dave,

According to the C++ Programming Language, second edition from Bjarne
Stroustrup, page 549, r.9.5

        "An object of a class with a constructor or a destructor or a
         user-defined assigment operator (...) cannot be a member of
         a union."

Take a look at the C++ man page for pfVec3, you'll see there's a constructor
and a operator= defined for it.

Since your task is to port a C program to C++, I suggest you use a mixed model
as mentionned in the programmer's guide, page 488, chap. 14, Porting from C API
to C++ API.

Add

        #define PF_C_API 1

in your C++ module to use the C api.

But carefully read the above mentionned chapter, there are specific mention of
pfVec3 stuff.

--
      ___/      |        ___/	Bernard Leclerc		e-mail: bleclerc++at++cae.ca
     /        / |       /	Systems Engineer	voice: +1 514 341 2000
    /        /  |      __/	CAE Electronics Ltd.		extension 2275
   /        /   |     /		8585 Cote De Liesse	fax:   +1 514 340 5496
  /        ____ |    /		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.