On 4/24/16 6:40 AM, Nick Treleaven wrote:
On Friday, 15 April 2016 at 18:46:01 UTC, Steven Schveighoffer wrote:
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2)
Might be nice if inout applied to template parameter types:
T[] overlap(inout T)(T[] r1, T[] r2);
If it wasn't for the virtual
On Friday, 15 April 2016 at 18:46:01 UTC, Steven Schveighoffer
wrote:
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2)
Might be nice if inout applied to template parameter types:
T[] overlap(inout T)(T[] r1, T[] r2);
If it wasn't for the virtual function issue, I wonder if inout
would
On Friday, 15 April 2016 at 21:01:44 UTC, Andrei Alexandrescu
wrote:
Jesus. C++ has const without inout. We used to have const
without inout - and we probably should again. -- Andrei
What about immutability? E.g. Java gets away with immutable in a
library and it just werks.
On Friday, 15 April 2016 at 17:24:19 UTC, Andrei Alexandrescu
wrote:
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted
BTW, why is overlap undocumented - is ctfe support a good enough
reason?
https://github.com/dlang/phobos/blob/v2.071.0/std/array.d#L715
I've thought about
On Friday, April 15, 2016 13:46:24 Andrei Alexandrescu via Digitalmars-d
wrote:
> On 04/15/2016 01:31 PM, Namespace wrote:
> > Since it is a template: Why these attributes: @trusted pure nothrow ?
>
> @trusted is not inferrable, the others are type-independent and nice for
> the documentation. --
On 04/15/2016 05:27 PM, Steven Schveighoffer wrote:
On 4/15/16 5:01 PM, Andrei Alexandrescu wrote:
On 04/15/2016 04:45 PM, Steven Schveighoffer wrote:
On 4/15/16 4:34 PM, Andrei Alexandrescu wrote:
On 04/15/2016 04:16 PM, Steven Schveighoffer wrote:
If you find such advertisement useless,
On 4/15/16 5:01 PM, Andrei Alexandrescu wrote:
On 04/15/2016 04:45 PM, Steven Schveighoffer wrote:
On 4/15/16 4:34 PM, Andrei Alexandrescu wrote:
On 04/15/2016 04:16 PM, Steven Schveighoffer wrote:
If you find such advertisement useless, you of course do not need inout
or const.
Let's not
othrow
if (is(typeof(r1.ptr < r2.ptr) == bool))
{
import std.algorithm : min, max;
auto b = max(r1.ptr, r2.ptr);
auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
return b < e ? b[0 .. e - b] : null;
}
Who wore it better?
inout(T)[] overlap(T)(inout(T)[] r1, i
On 04/15/2016 04:45 PM, Steven Schveighoffer wrote:
On 4/15/16 4:34 PM, Andrei Alexandrescu wrote:
On 04/15/2016 04:16 PM, Steven Schveighoffer wrote:
If you find such advertisement useless, you of course do not need inout
or const.
Let's not exaggerate by putting them together. -- Andrei
gt; if (is(typeof(r1.ptr < r2.ptr) == bool))
> >> {
> >> import std.algorithm : min, max;
> >> auto b = max(r1.ptr, r2.ptr);
> >> auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
> >> return b < e ? b[0 .. e - b] : null;
>
On 4/15/16 4:34 PM, Andrei Alexandrescu wrote:
On 04/15/2016 04:16 PM, Steven Schveighoffer wrote:
If you find such advertisement useless, you of course do not need inout
or const.
Let's not exaggerate by putting them together. -- Andrei
This is not an exaggeration. inout and const have
On 04/15/2016 04:16 PM, Steven Schveighoffer wrote:
If you find such advertisement useless, you of course do not need inout
or const.
Let's not exaggerate by putting them together. -- Andrei
On 4/15/16 4:05 PM, Andrei Alexandrescu wrote:
On 04/15/2016 03:13 PM, Steven Schveighoffer wrote:
On 4/15/16 2:48 PM, Andrei Alexandrescu wrote:
On 4/15/16 2:46 PM, Steven Schveighoffer wrote:
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure
nothrow
{
import
On 04/15/2016 03:13 PM, Steven Schveighoffer wrote:
On 4/15/16 2:48 PM, Andrei Alexandrescu wrote:
On 4/15/16 2:46 PM, Steven Schveighoffer wrote:
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure
nothrow
{
import std.algorithm: min, max;
auto b = max(r1.ptr, r2.ptr);
On 4/15/16 2:48 PM, Andrei Alexandrescu wrote:
On 4/15/16 2:46 PM, Steven Schveighoffer wrote:
inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow
{
import std.algorithm: min, max;
auto b = max(r1.ptr, r2.ptr);
auto e = min(r1.ptr + r1.length, r2.ptr +
ll;
}
After:
auto overlap(T, U)(T[] r1, U[] r2) @trusted pure nothrow
if (is(typeof(r1.ptr < r2.ptr) == bool))
{
import std.algorithm : min, max;
auto b = max(r1.ptr, r2.ptr);
auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
return b < e ? b[0 .. e - b] : null;
}
Who
rusted pure nothrow
if (is(typeof(r1.ptr < r2.ptr) == bool))
{
import std.algorithm : min, max;
auto b = max(r1.ptr, r2.ptr);
auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
return b < e ? b[0 .. e - b] : null;
}
Who wore it better?
inout(T)[] overlap(T)(ino
On 04/15/2016 01:31 PM, Namespace wrote:
Since it is a template: Why these attributes: @trusted pure nothrow ?
@trusted is not inferrable, the others are type-independent and nice for
the documentation. -- Andrei
Since it is a template: Why these attributes: @trusted pure
nothrow ?
https://github.com/D-Programming-Language/phobos/pull/4201 -- Andrei
== bool))
{
import std.algorithm : min, max;
auto b = max(r1.ptr, r2.ptr);
auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
return b < e ? b[0 .. e - b] : null;
}
Who wore it better?
Andrei
21 matches
Mail list logo