countUntil with negated pre-defined predicate?

Robert M. Münch robert.muench at saphirion.com
Mon May 4 17:09:16 UTC 2020


On 2020-05-03 21:59:54 +0000, Harry Gillanders said:

> I'm unsure as to which part is unclear,

Well, I was trapped by this formatting/syntax:

	size_t drawableCharacterCount (CodePoints) (auto ref CodePoints codePoints)
	if (isInputRange!CodePoints && is(ElementType!CodePoints : dchar))
	{

and was wondering what the first line contributes... now understanding 
that it's the function signature and the following "if" line is 
template contraint (IIRC). So it's actually:

	size_t drawableCharacterCount (CodePoints) (auto ref CodePoints codePoints)
		if (isInputRange!CodePoints && is(ElementType!CodePoints : dchar))
	{

However, I find this sytax a bit unfortunate because I can't spot 
quickly that this "if" is a tempalte constraint... but maybe I get more 
used to it.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list