FEAURE REQUEST: generic IfThen
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
I have this little snippet that is maybe a candidate for inclusion in either sysutils or math:
{$ifdef fpc}{$mode delphi}{$H+}{$endif}
// generic ifthen..
function IfThen<T>(val:boolean;const iftrue:T; const iffalse:T) :T; inline; overload;
begin
Result :=ifFalse;
if val = true then Result := ifTrue
end;
Mantis conversion info:
- Mantis ID: 34012
- OS: all
- OS Build: akk
- Build: 39471
- Platform: all
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 39521 (#1e3f4496)
- Target version: 3.2.0