Inc and Dec
|Top Previous Next|
As for the procedures for memory management there are template functions for Inc and Dec, e.g.:
template <class T>
T Inc(T& xT)
int t = (int) xT;
xT = (T) t;
For integer types Inc and Dec are converted automatically to the C++ incrementing and decrementing operators. E.g.
Inc( i ) -> i++
However in cases, where i is an enumerated type the operators cannot be used in C++. So the translator lets a call like Inc( i ) unchanged and the template function are called in C++. By the temporary conversions of the enumerates types to integers the Inc and Dec functions will work for enumerated types too.
This page belongs to the Delphi2Cpp Documentation
|Delphi2Cpp home Content|