Jump to content

Search the Community

Showing results for tags 'operator-overloading'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. Hello, When overloading operators in a Delphi record, it is possible to specify a result type that the documentation does not recognize: TCondRec = record public Text: string; Params: TParams; class operator LogicalAnd (aLeft, aRight: TCondRec): TCondRec; // return TCondRec instead of Boolean class operator LogicalOr (aLeft, aRight: TCondRec): TCondRec; // here as well This allows us to write expressions such as the below, to generate an SQL string as the result of joining `aLeft` and `aRight` with an `AND` or `OR` operator. It seems this technique is internally used by EntityDAC components in order to provide an "SQL Builder", somewhat similar to the idea exposed here. My worry however, is that this syntax showed above is not documented: according to the Embarcadero docs, these class operators are supposed to return a Boolean. Here's some screenshots of what can be done: The question is: How concerned should I be about using such a library, in the eventuality that Embarcadero decides to enforce the syntax described by its documentation? Or alternatively (if lucky), any chance the documentation itself is wrong? (docs are often known to be missing, maybe they just didn't write it correctly here?) Thanks
×