Problem: handling a function dependent on release mode.
Namespace
rswhite4 at googlemail.com
Sat Jul 21 10:11:20 PDT 2012
On Saturday, 21 July 2012 at 16:05:24 UTC, Jacob Carlborg wrote:
> On 2012-07-20 23:47, Namespace wrote:
>
>> Maybe something like that?
>>
>> void alCheck(lazy void Func, string filename = __FILE__, uint
>> line = __LINE__) {
>> Func();
>>
>> debug {
>> alCheckError(filename, line);
>> }
>> }
>
> If "filename" and "line" is template parameters they will get
> the default values from the call site.
>
> void alCheck (string filename = __FILE__, uint line = __LINE__)
> (lazy void Func)
> {}
Equally when they are passed as normal parameters.
More information about the Digitalmars-d-learn
mailing list