C++ features translations
As a general rule, a C++ function or method whose return value is void will give an Ada procedure, whereas a C++ function or method returning anything else will give an Ada function.
- "Normal" methods
-
Assuming the following C++ declaration:
- class C
- {
- public:
- void m();
- };
The corresponding Ada procedure would be:
- type C is ...;
- procedure M(cc: in out C'Class);
Note the use of the
'Classattribute. If the method was qualified byconst, the parameter passing mode ofccwould have beenin. - Virtual methods
-
Assuming the following C++ declaration:
- class C
- {
- public:
- virtual void m();
- };
The corresponding Ada procedure would be:
- type C is ...;
- procedure M(cc: in out C);
Here we don't use the
'Classattribute. If the method was qualified byconst, the parameter passing mode ofccwould have beenin.



