AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

"strong alias" / "weak alias"?

Ein Thema von freimatz · begonnen am 24. Feb 2024 · letzter Beitrag vom 24. Feb 2024
 
Rollo62

Registriert seit: 15. Mär 2007
4.213 Beiträge
 
Delphi 12 Athens
 
#2

AW: "strong alias" / "weak alias"?

  Alt 24. Feb 2024, 09:56
Ich denke, es geht nur um die internen Delphi-Typen, wie NativeInt, welche sich beim overload jetzt anders verhalten.
Der NativeIn verändert seinen Typ, je nach Plattform mal Int32 oder Int64, dies hat einige Probleme erzeugt.

Früher war der overload so möglich, jetzt nicht mehr.

Zitat:
You can use it instead of the two counterparts, not in parallel. You can no longer overload like this in Delphi:
Delphi-Quellcode:
procedure doIt( I : Integer ); overload;
procedure doIt( I : Int64 ); overload;
procedure doIt( I : NativeInt ); overload; // Error 120 nativeint      it’s a redeclaration.
Zitat:
Now must either do this if you want distinct behaviors on how to handle 32-bit vs. 64-bit integers:
Delphi-Quellcode:
procedure doIt( I : Integer ); overload;
procedure doIt( I : Int64 ); overload;
Zitat:
Or just write a single version that adapts to the specific platform bittness:
procedure doIt( I : NativeInt ); overload;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:04 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz