Delphi2Cpp 2 compared to Delphi2Cpp 1

Top  Previous  Next


Delphi2Cpp2 is based on the experiences with the previous program Delphi2Cpp 1, which translates Delphi 7 code only.


Delphi2Cpp 1 supports old style programs based on AnsiChars and AnsiStrings as well as programs based on WideChar and UnicodeStrings.

Delphi2Cpp I2 produces Unicode based code only and preferes the use of a C++11 compiler.

The old Delphi2Cpp also had the option to let "String" be defined as a standard string. This option is removed for the C++Builder target too: for C++Builder Strings are UnicodeStrings, for other compilers there are more options.


Some more differences are:


Delphi2Cpp 2 processes the Delphi language expansions which were added since Delphi 7


Delphi2Cpp 2 also uses the new features of C++11 to improve the translation results.


initializing arrays by means of a std::initializer_list
nested functions are simulated by means of lambda-functions
with-statements can be rewritten by use of a with-variable of the auto-type
the behavior of finally is simulated by use of a lambda expression
for-in loops are converted to range-based for loops.



In addition there are some more changes in Delphi2Cpp 2 to improve or to simplify the translation:


desired type information can be set in the type-map of the options
identifiers with an ampersand prefix can be treated correctly
C-style array return values are converted to reference parameters
array properties become to Getter/Setter-methods with the array as reference parameter
the calculation of operator precedence is much more accurate then in the first version of Delphi2Cpp.
there is an option to create class reference types by which classes can be created.





Classes.pas TList




This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content