D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3829 - ddoc of mixed in functions
Summary: ddoc of mixed in functions
Status: RESOLVED DUPLICATE of issue 2420
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-18 12:44 UTC by bearophile_hugs
Modified: 2015-06-09 01:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010-02-18 12:44:53 UTC
This code:
/// this is a ddoc comment
void foo(int i) { printf("%d\n", i); }
/// ditto
void foo(uint i) { printf("%d\n", i); }
/// ditto
void foo(short i) { printf("%d\n", i); }

Generates this correct HTML documentation:

void foo(int i);
void foo(uint i);
void foo(short i);
    this is a ddoc comment 


Then I have tried to generate those similar functions with a mixin(), but then I can't find a way to make ddoc list them (into the generated Html) grouped:

/// this is a ddoc comment
void foo(int i) { printf("int) %d\n", i); }

template Gen(string type) {
    const Gen = `
    /// ditto
    void foo(` ~ type ~ ` i) { printf("` ~ type ~ `) %d\n", i); }`;
}

/// ditto
mixin(Gen!("uint"));

/// ditto
mixin(Gen!("short"));

void main() {
    foo(10);
    foo(cast(uint)20);
    foo(cast(short)30);
}
Comment 1 Alexey Ivanov 2010-02-18 13:54:33 UTC
See: http://d.puremagic.com/issues/show_bug.cgi?id=2420
Comment 2 bearophile_hugs 2010-02-18 14:57:05 UTC
(In reply to comment #1)
> See: http://d.puremagic.com/issues/show_bug.cgi?id=2420

Yes, thank you, this seems a dupe.
Comment 3 Brad Roberts 2010-02-18 21:28:20 UTC
If you find dupes, please mark them as such.. generally preferring to mark the newest one as a dup of the oldest one.

*** This issue has been marked as a duplicate of issue 2420 ***