[fpc-devel] Little feature teaser
Marco van de Voort
marcov at stack.nl
Sat Aug 3 12:17:19 CEST 2013
In our previous episode, Sven Barth said:
> > And the same (problem) in C++. Is there some proposal to mitigate the
> > code duplication? Or the official position is that if the project is
> > big enough to suffer from the bloat it should avoid itself the
> > duplicate declarations?
> The problem is that it's not really possible with the unit concept FPC
> uses. If you want to share the code with other units the code needs to
> be callable from the interface section, but when you are working in the
> implementation section (where most specializations take place) you
> should not modify the interface section anymore as this needs to trigger
> a recompilation of all units that depend on that unit.
I thought this is where constraints come in? If the specialization is
completely defined by the constraint class type, you can already generate
the specialization and reuse it?
At least that should avoid re-specialization of common container types for
basic class types.
But admitted, Delphi doesn't support inline with generics, in that FPC is
covering new ground.
More information about the fpc-devel