On 11/14/15 12:18 AM, Jakob Ovrum wrote:
On Saturday, 14 November 2015 at 04:10:59 UTC, Steven Schveighoffer wrote:
Is it me, or is this a bug?
struct Foo
{
template opDispatch(string s) {
// if you uncomment this, it compiles
//void opDispatch() {}
void opDispatch(T...)()
On 10/18/15 9:00 PM, David Osborne wrote:
On Saturday, 17 October 2015 at 15:31:00 UTC, Nikolay wrote:
I asked on SO question about opDispatch and compile time parameters:
http://stackoverflow.com/questions/32998781/opdispatch-and-compile-time-parameters
[...]
Is it good idea for opDispatch
On Saturday, 14 November 2015 at 04:10:59 UTC, Steven
Schveighoffer wrote:
Is it me, or is this a bug?
struct Foo
{
template opDispatch(string s) {
// if you uncomment this, it compiles
//void opDispatch() {}
void opDispatch(T...)() {}
}
}
void main()
{
Foo f;
On Wednesday, 21 October 2015 at 12:32:37 UTC, Andrei
Alexandrescu wrote:
The quickest way to stop the bleeding is to disallow the code.
It's incorrect for immutable data and misleading for mutable
data. (What an user might expect is that each data comes with a
distinct array.)
It's
On 10/21/2015 02:54 PM, Don wrote:
Fundamentally the problem is that literals of mutable reference types do
not make sense.
I think considering "[x,y,z]" a 'literal' is a problem, but why is it
the problem here? It is not really treated like a literal in this
context. This has the same
On Wednesday, 21 October 2015 at 12:32:37 UTC, Andrei
Alexandrescu wrote:
On 10/21/2015 07:40 AM, Timon Gehr wrote:
On 10/21/2015 12:55 PM, Andrei Alexandrescu wrote:
On 10/19/15 9:49 PM, Jonathan M Davis wrote:
On Monday, 19 October 2015 at 23:37:09 UTC, Timon Gehr wrote:
This is the worst
On 10/21/2015 07:40 AM, Timon Gehr wrote:
On 10/21/2015 12:55 PM, Andrei Alexandrescu wrote:
On 10/19/15 9:49 PM, Jonathan M Davis wrote:
On Monday, 19 October 2015 at 23:37:09 UTC, Timon Gehr wrote:
This is the worst part:
class C{
int[] x=[1,2,3];
}
void main(){
auto mut=new C;
On 10/19/15 9:49 PM, Jonathan M Davis wrote:
On Monday, 19 October 2015 at 23:37:09 UTC, Timon Gehr wrote:
This is the worst part:
class C{
int[] x=[1,2,3];
}
void main(){
auto mut=new C;
auto imm=new immutable(C);
assert(imm.x[0]==1);
mut.x[0]=2;
assert(imm.x[0]==2);
On 10/21/2015 12:55 PM, Andrei Alexandrescu wrote:
On 10/19/15 9:49 PM, Jonathan M Davis wrote:
On Monday, 19 October 2015 at 23:37:09 UTC, Timon Gehr wrote:
This is the worst part:
class C{
int[] x=[1,2,3];
}
void main(){
auto mut=new C;
auto imm=new immutable(C);
On Tuesday, 20 October 2015 at 01:49:08 UTC, Jonathan M Davis
wrote:
On Monday, 19 October 2015 at 23:37:09 UTC, Timon Gehr wrote:
This is the worst part:
class C{
int[] x=[1,2,3];
}
void main(){
auto mut=new C;
auto imm=new immutable(C);
assert(imm.x[0]==1);
mut.x[0]=2;
On Tuesday, 20 October 2015 at 11:36:36 UTC, Marc Schütz wrote:
On Tuesday, 20 October 2015 at 01:49:08 UTC, Jonathan M Davis
wrote:
On Monday, 19 October 2015 at 23:37:09 UTC, Timon Gehr wrote:
This is the worst part:
class C{
int[] x=[1,2,3];
}
void main(){
auto mut=new C;
auto
On Monday, 19 October 2015 at 18:16:15 UTC, Andrei Alexandrescu
wrote:
Tangentially related: since when we allow field initialization
with new? I was surprised to see that this works:
Thanks for this notice. I edited question on SO and I removed
field initialization with new (replace
D template system is very powerful. This is more generic
solution:
import std.stdio;
class B {
auto p1(T)(T arg) { writeln( "p1: ", arg ); }
auto p2(T, int C)(T s) { writeln( "p2: ", s, " / ", C); }
}
class C(T) {
T b = new T;
template opDispatch(string s) {
template
On Monday, 19 October 2015 at 19:53:14 UTC, Andrei Alexandrescu
wrote:
struct A {
int[] x = new int[10];
}
void main() {
import std.stdio;
A a;
a.x[1] = 42;
writeln(a.x);
}
Looks like a bona fide runtime array to me.
It is still in the static data segment. Try this:
On 10/19/2015 01:50 PM, Nikolay wrote:
On Monday, 19 October 2015 at 08:41:46 UTC, Jack Applegame wrote:
D template system is very powerful. This is more generic solution:
http://dpaste.dzfl.pl/791c65d0e4ee
Wow!
I can't believe that it is possible and there is so straightforward way.
You
On Monday, 19 October 2015 at 18:26:45 UTC, Adam D. Ruppe wrote:
On Monday, 19 October 2015 at 18:16:15 UTC, Andrei Alexandrescu
wrote:
Tangentially related: since when we allow field initialization
with new? I was surprised to see that this works:
Since CTFE started supporting it... this
On Monday, 19 October 2015 at 18:16:15 UTC, Andrei Alexandrescu
wrote:
Tangentially related: since when we allow field initialization
with new? I was surprised to see that this works:
Since CTFE started supporting it... this might actually be an
unintentional feature.
Since the initializer
On 10/19/2015 02:26 PM, Adam D. Ruppe wrote:
On Monday, 19 October 2015 at 18:16:15 UTC, Andrei Alexandrescu wrote:
Tangentially related: since when we allow field initialization with
new? I was surprised to see that this works:
Since CTFE started supporting it... this might actually be an
On 10/19/2015 02:44 PM, Jonathan M Davis wrote:
On Monday, 19 October 2015 at 18:26:45 UTC, Adam D. Ruppe wrote:
On Monday, 19 October 2015 at 18:16:15 UTC, Andrei Alexandrescu wrote:
Tangentially related: since when we allow field initialization with
new? I was surprised to see that this
On Monday, 19 October 2015 at 17:50:02 UTC, Nikolay wrote:
On Monday, 19 October 2015 at 08:41:46 UTC, Jack Applegame
wrote:
D template system is very powerful. This is more generic
solution:
http://dpaste.dzfl.pl/791c65d0e4ee
Wow!
I can't believe that it is possible and there is so
On Monday, 19 October 2015 at 08:41:46 UTC, Jack Applegame wrote:
D template system is very powerful. This is more generic
solution:
http://dpaste.dzfl.pl/791c65d0e4ee
Wow!
I can't believe that it is possible and there is so
straightforward way. You should post this answer to SO
Thanks!
On 10/19/2015 09:57 PM, Adam D. Ruppe wrote:
On Monday, 19 October 2015 at 19:53:14 UTC, Andrei Alexandrescu wrote:
struct A {
int[] x = new int[10];
}
void main() {
import std.stdio;
A a;
a.x[1] = 42;
writeln(a.x);
}
Looks like a bona fide runtime array to me.
It is
On Monday, 19 October 2015 at 23:37:09 UTC, Timon Gehr wrote:
This is the worst part:
class C{
int[] x=[1,2,3];
}
void main(){
auto mut=new C;
auto imm=new immutable(C);
assert(imm.x[0]==1);
mut.x[0]=2;
assert(imm.x[0]==2);
}
Oooo. Ouch. Yeah, that pushes it from
On Saturday, 17 October 2015 at 15:31:00 UTC, Nikolay wrote:
I asked on SO question about opDispatch and compile time
parameters:
http://stackoverflow.com/questions/32998781/opdispatch-and-compile-time-parameters
[...]
Is it good idea for opDispatch improvement or may there is some
other
On Saturday, 17 October 2015 at 15:31:00 UTC, Nikolay wrote:
I asked on SO question about opDispatch and compile time
parameters:
http://stackoverflow.com/questions/32998781/opdispatch-and-compile-time-parameters
Currently it looks like it is not possible to use opDispatch
for non trivial
I asked on SO question about opDispatch and compile time
parameters:
http://stackoverflow.com/questions/32998781/opdispatch-and-compile-time-parameters
Currently it looks like it is not possible to use opDispatch for
non trivial template functions. I think opDispatch should get
function name
26 matches
Mail list logo