Should formattedWrite take the outputrange by ref?

Tobias Pankrath tobias at pankrath.net
Sun Jan 19 07:28:03 PST 2014


On Sunday, 19 January 2014 at 15:12:07 UTC, Tobias Pankrath wrote:
> On Sunday, 19 January 2014 at 15:03:13 UTC, monarch_dodra wrote:
>
>> So, my conclusion, "*" might be a workable solution. But 
>> simply taking by ref would be cleaner, and make more sense as 
>> a whole.
>
> Or a special template constraint path for T*.
>
> foo(T)(T t) if (is(T = Q*)) && manyOtherChecks!(Q)
> foo(T)(T t) if (!is(T = Q*)) && manyOtherChecks!(T)
>
> Maybe that will break less code.

But maybe we really should go for taking the output range by 
reference. See 
https://d.puremagic.com/issues/show_bug.cgi?id=10291
https://d.puremagic.com/issues/show_bug.cgi?id=9102

Created a new report for this: 
https://d.puremagic.com/issues/show_bug.cgi?id=11951


More information about the Digitalmars-d-learn mailing list