2
votes
Vote UpVote

Can we truly assert that an array returned from a function is always a true copy?

The Wiert Corner – The answer is no: [WayBack] Hi all, Can we truly assert that an array returned from a function is always a new true copy and that this is guaranteed to not change in between compil… – Ugochukwu Mmaduekwe – Google+ From Primož book and comment: Primož Gabrijelčič Depending on how you create this array. For example, the following code outputs 42, not 17. program Project142; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; function Bypass(const a: TArray<integer>): TArray<integer>; begin Result := a; end; var a, b: TArray<integer>; begin SetLength(a, 1); ...
Favorite? Off-Topic? jpluimers @ 2020-09-25 13:02

Statistics

Visits: 115
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Michał Rajewicz
thersippos
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)