Programming for std.log

Paulo Pinto pjmlp at progtools.org
Sun Feb 12 13:43:05 PST 2012


Am 12.02.2012 21:18, schrieb Jose Armando Garcia:
> Hey all,
>
>> From my experience implementing std.log and trying to keep it up to
> date with commits to Phobos. I think I have become fairly frustrated
> with writing D programs and debugging D program compilations
> (specially templates). I swear that feels like every other commit
> breaks the std.log module. This is the latest one:
>
> std/format.d(782): Error: template std.algorithm.startsWith(alias pred
> = "a == b",Range,Ranges...) if (isInputRange!(Range)&&  Ranges.length
>> 1&&  is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[0]))
> : bool)&&  is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[1..__dollar]))
> : uint)) does not match any function template declaration
> std/format.d(782): Error: template std.algorithm.startsWith(alias pred
> = "a == b",Range,Ranges...) if (isInputRange!(Range)&&  Ranges.length
>> 1&&  is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[0]))
> : bool)&&  is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[1..__dollar]))
> : uint)) cannot deduce template function from argument types
> !()(const(char)[],char)
>
> How am I suppose to know what is wrong with std.log base on the
> information above in a 3000 line implementation? I don't even include
> std.format (as that template could have been instantiated from
> somewhere else). Having a lot of "experience" trying to solve this
> kind of problem, I normally remove all my imports and try add the
> symbols one at a time until I figure out what is wrong. This time I
> honestly think that I am stumped! I know that this is not a lot of
> information and I don't expect help resolving this problem but I hint
> this issues with the following imports:
>
> import core.sync.rwmutex: ReadWriteMutex;
> import std.datetime: SysTime;
> import std.array: Appender;
>
> Is there anyway that dmd can tell me why a template is being
> instantiated? Something like like:
>
> template foo instantiated from std/log.d(###)
> template bar instantiated from std/datetime.d(###)
> template startsWith instantiated from std/format.d(###) ...
>
> Thanks. Hopefully I'll figure this out sooner rather than later,
> -Jose

Ooch. It looks like C++ template error messages. :(

--
Paulo


More information about the Digitalmars-d mailing list