Library standardization -> template hiding suggestion !
Don Clugston
nospam at nospam.com.au
Sun Apr 20 13:25:37 PDT 2008
Edward Diener Wrote:
> As a user of libraries largely based on templates, whether C++ or D,
> once I have faith in the quality of the library I feel I have no need to
> look at the source code in order to use it successfully and the actual
> template declarations should be enough, from the user's point of view,
> to interact with the library. Unfortunately in C++ and D this is not the
> case due to the way templates are currently implemented. But I think it
> could be the case if D pursued the line of thought that the end user of
> the template code, as opposed to the compiler itself, really has no need
> to interact with the template definition, as opposed to the template
> declaration, in order to use the template successfully.
You can always follow the example of Microsoft (who seem to have embraced the open-source concept in .NET???? <g> -- it's trivially decompileable) -- run the template code through an obfustcator before distribution.
CTFE is more interesting. I think we'll see far fewer uses of templates in D than C++; frequently, CTFE will be used instead. And it's easier to imagine CTFE being compiled, than templates being compiled.
More information about the Digitalmars-d
mailing list