On Wednesday, 27 December 2017 at 16:36:59 UTC, H. S. Teoh wrote:
On Tue, Dec 26, 2017 at 11:28:56AM +, Mark via
Digitalmars-d wrote:
On Monday, 25 December 2017 at 22:48:39 UTC, H. S. Teoh wrote:
> [...]
Maybe we can document the interface of the return type using
signature constraints?
On Tue, Dec 26, 2017 at 01:50:06AM +, Neia Neutuladh via Digitalmars-d
wrote:
> On Monday, 25 December 2017 at 22:48:39 UTC, H. S. Teoh wrote:
> > The exact type does not and should not need to be known by user
> > code.
>
> It's a public type reported by some of the documentation but not
On Wednesday, 27 December 2017 at 16:36:59 UTC, H. S. Teoh wrote:
The best we can do currently, which unfortunately won't show up
in the docs, is to use a static assert to force compilation
failure when the return type doesn't match expectations, e.g.:
[...]
static
On Tue, Dec 26, 2017 at 11:28:56AM +, Mark via Digitalmars-d wrote:
> On Monday, 25 December 2017 at 22:48:39 UTC, H. S. Teoh wrote:
> > While I agree that all template parameters ought to be documented
> > and all auto return types thoroughly described, I disagree with
> > explicit naming of
On Monday, 25 December 2017 at 22:48:39 UTC, H. S. Teoh wrote:
On Mon, Dec 25, 2017 at 04:26:52PM +, Piotr Klos via
Digitalmars-d wrote:
On Monday, 25 December 2017 at 03:23:33 UTC, Neia Neutuladh
wrote:
> If you have a function with a return type listed as `auto`,
> please thoroughly
On Monday, 25 December 2017 at 22:48:39 UTC, H. S. Teoh wrote:
While I agree that all template parameters ought to be
documented and all auto return types thoroughly described, I
disagree with explicit naming of auto return types. The whole
point of auto return types is to return an *opaque*
On Monday, 25 December 2017 at 22:48:39 UTC, H. S. Teoh wrote:
The exact type does not and should not need to be known by user
code.
It's a public type reported by some of the documentation but not
other parts. Its capabilities are given vaguely in the docs for
the functions that return it.
On Mon, Dec 25, 2017 at 04:26:52PM +, Piotr Klos via Digitalmars-d wrote:
> On Monday, 25 December 2017 at 03:23:33 UTC, Neia Neutuladh wrote:
> > If you have a function with a return type listed as `auto`, please
> > thoroughly describe what interface the return value provides.
> >
>
> I
On Monday, 25 December 2017 at 03:23:33 UTC, Neia Neutuladh wrote:
If you have a function with a return type listed as `auto`,
please thoroughly describe what interface the return value
provides.
I would just like to say that I strongly agree. Lack of
documentation of template parameters
I would like to fix this using signatures[0].
Signatures have a number of benefits here, including removing of
TypeInfo (which prevents code-bloat).
There is a few other examples based upon allocators here[1].
But this isn't a short term goal even if it does get approved ;)
[0]
If you have a function with a return type listed as `auto`,
please thoroughly describe what interface the return value
provides.
"Returns a forward range of Elem", where Elem is a template
parameter, is fine, for instance.
But look at std.regex.RegexMatch.front:
"Functionality for
11 matches
Mail list logo