Lazarus

Free Pascal => General => Topic started by: winni on October 17, 2021, 05:41:52 pm

Title: Operator overloading - are there some tricks
Post by: winni 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
Title: Re: Operator overloading - are there some tricks
Post by: Jonas Maebe 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.
Title: Re: Operator overloading - are there some tricks
Post by: winni on October 17, 2021, 08:02:32 pm
Hi!

Nice trick.

Thanx.

Winni
TinyPortal © 2005-2018