Recent

Author Topic: Operator overloading - are there some tricks  (Read 2276 times)

winni

  • Hero Member
  • *****
  • Posts: 2806
Operator overloading - are there some tricks
« on: October 17, 2021, 05:41:52 pm »
Hi!

I am using TBits to implement a Big Set.

Operator overloading works fine - with the exceptiopn of "="

The compiler tells "impossible operator overload" and it is obvious the "=" is used for checking of the same pointer.

But I ask: Are there some tricks or workarounds?

Or am I at the EOS (End OF Syntax) ???

Winni

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 922
Re: Operator overloading - are there some tricks
« Reply #1 on: October 17, 2021, 06:40:59 pm »
The only way to be able to overload all operators is to use a wrapper record type.

winni

  • Hero Member
  • *****
  • Posts: 2806
Re: Operator overloading - are there some tricks
« Reply #2 on: October 17, 2021, 08:02:32 pm »
Hi!

Nice trick.

Thanx.

Winni

 

TinyPortal © 2005-2018