Greetings,
In the development of the "Fornux C++ Superset" source-to-source compiler and its Open Source memory manager counterpart "root_ptr":
Like previously mentioned I noticed the following problems with the C++ language:
- There is no distinction between a pointer and an iterator.
- There is no distinction between pointers to arrays of derived classes and pointers to arrays of base classes.
But I just realized the following also:
- The C++ language disallows top-level forward declarations of nested classes.
The latter becomes a problem if you want to, for example, specialize metadata template classes. Ex:
struct A
{
struct B
{};
};
The transpiler will generate:
struct A::B;
namespace metadata
{
template <>
struct construct<A::B>
{
template <typename... Args>
A::B operator () (Args const &... args);
};
}
But the problem is the following statement is not legal:
struct A::B;
So nested structures aren't commutative with template specializations which makes it impossible to generate metadata on-the-fly. The problem was always omnipresent but now it causes important problems in this case but also prevents further extensions of the language.
It's just a matter of making C++ less strict in this case...
Regards,
-Phil