Building good error message in templates?

renoX renosky at free.fr
Mon Mar 12 10:07:06 PDT 2007


One problem with the templates is that currently when there is an error, the line number showed in the message is the line in the template and there is no way to print the line number of the caller except by having the caller do myTemplate!(__LINE__, ...) which is quite ugly.

For a mixin, an advice was to return a 'static assert' which would be evaluated in the caller, this works ok when the caller is a function, but it doesn't work very well when the caller is used for example as a function parameter.

Are there other way I'm missing?
renoX


More information about the Digitalmars-d-learn mailing list