[fpc-pascal] Re: Troubles with overloaded operators

Sven Barth pascaldragon at googlemail.com
Wed Oct 27 08:20:22 CEST 2010


On 16.10.2010 14:49, Sven Barth wrote:
> Is this a bug (I'm using 2.4.0, but I've tested it with a 2.5.1 from end
> of August as well)? Or is it not possible to use such an overload (which
> would be a pity...)?

I've searched Mantis a bit and stumpled upon this bug report: 
http://bugs.freepascal.org/view.php?id=13473

Jonas writes in the comments:

==== quote begin ====

 > It is not possible to overload operators involving ordinal types

Well, operators involving only combinations of ordinals, enums and strings.

==== quote end ====

Is this the case for sets as well?

The following are the cases that I'd like to overload:

SomeSet := SomeLongInt (converting a C-style flags int to a set)
SomeLongInt := SomeSet (converting a set to a C-style flags int)
SomeString := SomeSet (for writing a set to console)

Regards,
Sven



More information about the fpc-pascal mailing list