Comparison of ALGOL 68 and C++


C++ doesn't have:
ALGOL 68 doesn't have:

Code Examples

Union declaration and use

Assigning values into an A68 union variable is automatic,
the type is "tagged" to the variable, but pulling the value back out is
syntactically awkward as a conformity-clause is required.
ALGOL 68 example:
union x:=666;
printf)
C/C++ example:

union x = ;
std::cout << x.i << std::endl;

The net effect of "type-tagging" is that Algol68's strong typing
"half" encroaches into the union.

Mode declaration

A new mode may be declared using a mode declaration:
int max=99;
mode newtype = struct ;
This has the similar effect as the following C++ code:

const int max=99;
typedef struct newtype;

Note that for ALGOL 68 only the newtype name appears to the left of the equality, and most notably the construction is made - and can be read - from left to right without regard to priorities.