array of const for other compilers

Top  Previous  Next

What is translated > Array parameters > array of const > array of const for other compilers

 

array of const is reproduced for other compilers Delphi2Cpp by an OpenArray class defined in d2c_openarray.h, which is based on a std::vector.

 

 

procedure foo(Args : array of const);

 

->

 

void foo ( const OpenArray<TVarRec>& Args );

 

 

For the call of  such functions a type definition ARRAYOFCONST is used:

 

foo(['hello', 'world']);   ->  foo (  ARRAYOFCONST( "hello", "world" ) );

 

 

The type definition is:

 

typedef OpenArray<TVarRec>  ARRAYOFCONST;

 

 

Since this class has the size method an additional parameter isn't necessary.

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content