Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2006

    question about copy constructors and operator = ...


    Please, don't you know where i could find some info or if somebody could help me about copy constructors and operator = in symbian classes.

    This thing is for me very strange, because in basic classes like RArray , CArrayFix and lost of other are not these operators defined. Also copying TDesC is a little secret for me.

    If even some classes have defined copy constr. or assignment op., in SDK help, there are only few lines that do not absolutely contain any useful informatrion
    (for example: operator = in TSglQueBase (i would like to use derived TSglQue) .. and in help is written : "This is internal and is not intended for use." ... hmm)

    So ... in C++ ... when there is not defined copy contructor, compiler creates a new one that simply copies all attributes (so for example pointers in old and new RArray object will point to the same place on heap ... this is not really the behavior that i would expect from copy constructor ...)

    Please, could you tell me where i can find more info ... i would be very grateful

  2. #2
    Nokia Developer Champion
    Join Date
    May 2004

    Re: question about copy constructors and operator = ...

    Please search "copy constructor" in the SDK help, you'll find:

    Series 60 2nd Edition SDK for Symbian OS, Supporting Feature Pack 2
    Example Applications >> Coding Conventions
    Coding Conventions Used in Example Application Documentation

    (Symbian) note
    Copy constructors lose their "special status" in Symbian OS. Normally only classes with a destructor need copy constructors, and this means C-classes, but C-classes are only instantiated via NewL() and NewLC(). C-classes derive a private copy constructor from CBase, and since any you define are never public, they cannot be called implicitly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts