Results 1 to 3 of 3

Thread: 3 qwestions

  1. #1

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    3 qwestions

    1. Is there any performance or memory overheads on using a class wrapping an integrated datatype like char, that is than using a regular char.
    2. How do you define how to (implicitely) cast from a class to integrated datatype?
    3. A class is deriving a template twice with two different sets of parameters, will a function within the template act as overloaded if you pass 2 different datatypes as templates of the passed parameters of the original template instantiations? Can i access both versions without using this workaround? In that case can i use a couple of inline function within the derivative to access the two versions without any overhead? If so, can the original functions within still be inline? Maybe i'm just paranoid, but i want to be sure.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  2. #2
    Megatron
    Guest
    2) I think you can do this with operator overloading.
    Code:
    void operator= (int nNum);
    This will overload the int datatype.

  3. #3

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Thanks Megatron, i'll try that, although i was almost sure it was the other way around.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

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



Click Here to Expand Forum to Full Width