We need better documentation for functions with ranges and templates

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 14 14:12:15 PST 2015


On Mon, 14 Dec 2015 20:53:53 +0000, Andrei Alexandrescu wrote:

> One thing we definitely need to do is make the template constraints
> rendered better in documentation, and also allow user content in them.
> We've discussed this several times but no clear path emerged so far.
> Maybe a strong champion would come forward?
> 
> I'm thinking along the lines of:
> 
> * Change ddoc to output the constraint separately under a
> DDOC_CONSTRAINT macro.
> 
> * Allow ddoc comments inside macros:
> 
> bool isSameLength(Range1, Range2)(Range1 r1, Range2 r2)
> if (isInputRange!Range1 && isInputRange!Range2 && !isInfinite!Range1 &&
> !isInfinite!Range2 /**
> `Range1` and `Range2` must be both non-infinite input ranges.
> */
> );
> 
> then format that comment as a DDOC_CONSTRAINT_USERTEXT or something.
> 
> These would be good steps to take.
> 
> 
> Andrei

>From your lips to God's ears.


More information about the Digitalmars-d mailing list