array of const vs. set's |
Top Previous Next |
What is translated > Types > Arrays > Array parameters > array of const > array of const vs. set's
Delphi2Cpp decides by the expected parameter type how the set argument is translated:
type TCharSet = set of Char;
procedure foo(arr : array of const); procedure bar(set : TCharSet);
foo(['h', 'w']); bar(['h', 'w']);
->
typedef System::Set<unsigned char, 0, 255> TCharSet; #define test__0 (TCharSet() << L'h' << L'w')
void __fastcall foo (const TVarRec* ASet, int ASet_maxidx); void __fastcall bar (TCharSet ASet);
foo ( ARRAYOFCONST(( "h", "w" ))); bar ( test__0 );
If such an array is passed further to another function, then Delphi2Cpp takes care that the second parameter is also passed in the C++ code.
procedure foo2(var arr: array of const); begin bar2( arr ); end;
->
void __fastcall foo2 ( TVarRec* arr, const int arr_high ) { bar2 ( arr, arr_high ); }
|
This page belongs to the Delphi2Cpp Documentation |
Delphi2Cpp home Content |