On 12/15/10 7:57 PM, Jonathan M Davis wrote:
By the way, what does IFTI stand for?
Implicit Function Template Instantiation, which allows you to do »void
foo(T)(T bar) {}; foo(5);« without manually specifying the template
parameter.
David
On Wednesday, December 15, 2010 05:16:29 Steven Schveighoffer wrote:
> On Wed, 15 Dec 2010 04:34:53 -0500, Daniel Murphy
>
> wrote:
> > "Patrick Down" wrote in message
> > news:ie8kei$1gd...@digitalmars.com...
> >
> >> Would it help to allow 'else' and 'else if' on the template constraints?
> >
On Wed, 15 Dec 2010 08:16:29 -0500, Steven Schveighoffer
wrote:
On Wed, 15 Dec 2010 04:34:53 -0500, Daniel Murphy
wrote:
"Patrick Down" wrote in message
news:ie8kei$1gd...@digitalmars.com...
Would it help to allow 'else' and 'else if' on the template
constraints?
void foo(R)(R r) if
On Wed, 15 Dec 2010 04:34:53 -0500, Daniel Murphy
wrote:
"Patrick Down" wrote in message
news:ie8kei$1gd...@digitalmars.com...
Would it help to allow 'else' and 'else if' on the template constraints?
void foo(R)(R r) if(isRandomAccessRange!R)
{...}
else if(isInputRange!R)
{...}
This could
"Patrick Down" wrote in message
news:ie8kei$1gd...@digitalmars.com...
> Would it help to allow 'else' and 'else if' on the template constraints?
>
> void foo(R)(R r) if(isRandomAccessRange!R)
> {...}
> else if(isInputRange!R)
> {...}
>
> This could basically be translated into two specializations
On Tue, 14 Dec 2010 13:57:43 -0600
Andrei Alexandrescu wrote:
> > Imagine now if I wanted to define a foo that worked only on my specific
> > range, I now have to go back and modify the constraints of all the other
> > functions. What if I don't have control over that module?
>
> It scales poo
On Tue, 14 Dec 2010 16:35:49 -0500, Andrei Alexandrescu
wrote:
On 12/14/10 2:44 PM, Steven Schveighoffer wrote:
On Tue, 14 Dec 2010 15:35:30 -0500, Patrick Down
wrote:
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
Would it help to allow 'else' and 'else if' on the t
On 12/14/10 2:44 PM, Steven Schveighoffer wrote:
On Tue, 14 Dec 2010 15:35:30 -0500, Patrick Down wrote:
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
Would it help to allow 'else' and 'else if' on the template constraints?
void foo(R)(R r) if(isRandomAccessRange!R)
{...}
Steven Schveighoffer wrote:
Any idea how this can be 'solved' or do we need to continue doing things
like this? My naive instinct is to use the declaration order to
determine a match (first one to match wins), but that kind of goes
against other overloads in D.
Yeah, I'd be extremely relucta
On Tue, 14 Dec 2010 16:03:18 -0500, so wrote:
It is exactly your proposal (first one to match wins), with uglier
syntax :D
Not exactly. It fits within the syntax of D (if-else), and order of
evaluation is explicit, whereas one might expect with my original proposal
that order does not m
s/exactly/essentially/
It is exactly your proposal (first one to match wins), with uglier syntax
:D
Would it even fulfill your requirements? For example "What if I don't have
control over that module?"
This one would make it impossible.
On Tue, 14 Dec 2010 15:35:30 -0500, Patrick Down wrote:
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
Would it help to allow 'else' and 'else if' on the template constraints?
void foo(R)(R r) if(isRandomAccessRange!R)
{...}
else if(isInputRange!R)
{...}
This could basical
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
Would it help to allow 'else' and 'else if' on the template constraints?
void foo(R)(R r) if(isRandomAccessRange!R)
{...}
else if(isInputRange!R)
{...}
This could basically be translated into two specializations like this:
void f
On 12/14/10 1:43 PM, Steven Schveighoffer wrote:
On Tue, 14 Dec 2010 13:51:50 -0500, so wrote:
Any idea how this can be 'solved' or do we need to continue doing
things like this? My naive instinct is to use the declaration order
to determine a match (first one to match wins), but that kind of
On Tue, 14 Dec 2010 13:51:50 -0500, so wrote:
Any idea how this can be 'solved' or do we need to continue doing
things like this? My naive instinct is to use the declaration order to
determine a match (first one to match wins), but that kind of goes
against other overloads in D.
One big
Any idea how this can be 'solved' or do we need to continue doing things
like this? My naive instinct is to use the declaration order to
determine a match (first one to match wins), but that kind of goes
against other overloads in D.
One big plus of current solution is that everything you
On Tue, 14 Dec 2010 11:08:04 -0500
"Steven Schveighoffer" wrote:
> Having written a few of these functions with template constraints, I
> wondered if there was ever any discussion/agreement on reducing verbosity
> when specializing template constraints?
>
> For instance, if you want two over
On 12/14/2010 06:09 PM, Andrei Alexandrescu wrote:
On 12/14/10 10:08 AM, Steven Schveighoffer wrote:
On Tue, 14 Dec 2010 10:47:05 -0500, Andrei Alexandrescu
wrote:
On 12/14/10 7:33 AM, biozic wrote:
I have a question about this and some pieces of code in the standard
library, notably std.
On 12/14/10 10:08 AM, Steven Schveighoffer wrote:
On Tue, 14 Dec 2010 10:47:05 -0500, Andrei Alexandrescu
wrote:
On 12/14/10 7:33 AM, biozic wrote:
I have a question about this and some pieces of code in the standard
library, notably std.algorithm: some of the templated functions use
templ
On Tue, 14 Dec 2010 10:47:05 -0500, Andrei Alexandrescu
wrote:
On 12/14/10 7:33 AM, biozic wrote:
I have a question about this and some pieces of code in the standard
library, notably std.algorithm: some of the templated functions use
template constraints even when no template overloadin
21 matches
Mail list logo