On Monday, 22 August 2016 at 19:56:08 UTC, ag0aep6g wrote:
So this is just to avoid typing out `class Pug : Dog {...}
class Dog : Animal {...} class Animal {...}`?
This allows you to create different inheritance chains with the
same components quickly and easily. I don't know any use case,
but
On 08/22/2016 08:54 PM, Engine Machine wrote:
Yeah, but a name means nothing. Change it if you want ;)
Even with a better name it still requires a good amount of thinking by
the reader to see what's going on.
[...]
What it achieves is a uniform way to create a hierarchical relationship
On Monday, 22 August 2016 at 18:48:12 UTC, ag0aep6g wrote:
You can take this further with template constraints. Gives it a
more uniform appearance at the price of some repetition:
class T()
{
int x;
}
class T(A...) : T!(A[0..$-1])
if (A.length > 0 && A[$-1] == "Animal")
{
int
On Monday, 22 August 2016 at 18:04:43 UTC, Engine Machine wrote:
How do you seriously think this is cleaner/simpler?
1. No extra encrypted things, such as InstantiateOrEmptySeq
2. Much more understandable.
You have two classes.
No. I have one template with two specializations. Class template
On Monday, 22 August 2016 at 18:48:12 UTC, ag0aep6g wrote:
On 08/22/2016 08:04 PM, Engine Machine wrote:
How do you seriously think this is cleaner/simpler? You have
two
classes. Their is no uniformity between them. You have
uniformity
between all the derived classes then have a special case
On 08/22/2016 08:04 PM, Engine Machine wrote:
How do you seriously think this is cleaner/simpler? You have two
classes. Their is no uniformity between them. You have uniformity
between all the derived classes then have a special case for the base
class. A certain easy to follow pattern is set up
On Monday, 22 August 2016 at 07:54:36 UTC, Jack Applegame wrote:
On Monday, 22 August 2016 at 00:43:00 UTC, Engine Machine wrote:
The following code works and does what I want!
template InstantiateOrEmptySeq(alias tmpl, args...)
{
alias Seq(T...)=T;
static if (args.length > 0)
On Monday, 22 August 2016 at 00:43:00 UTC, Engine Machine wrote:
The following code works and does what I want!
template InstantiateOrEmptySeq(alias tmpl, args...)
{
alias Seq(T...)=T;
static if (args.length > 0)
alias InstantiateOrEmptySeq = tmpl!(args[0 .. $-1]);
else
On Monday, 22 August 2016 at 00:22:48 UTC, ag0aep6g wrote:
On 08/22/2016 12:06 AM, Engine Machine wrote:
T!()'s "data" is specified in the class just like all the other
derivations. I don't want to have to specify an external base
class as
in your InstaniateOrBase. Why? Because!!! (There
On 08/22/2016 12:06 AM, Engine Machine wrote:
T!()'s "data" is specified in the class just like all the other
derivations. I don't want to have to specify an external base class as
in your InstaniateOrBase. Why? Because!!! (There should be no need to,
and if one goes this route of creating
On Sunday, 21 August 2016 at 21:11:37 UTC, ag0aep6g wrote:
On 08/21/2016 09:29 PM, Engine Machine wrote:
I know you like to play the right or wrong game, but did you
ever learn
that a single example does not prove the truth of something?
But you can show in a single example that something
On 08/21/2016 09:29 PM, Engine Machine wrote:
I know you like to play the right or wrong game, but did you ever learn
that a single example does not prove the truth of something?
But you can show in a single example that something doesn't work. You
tried to do that, and you did it with a
On Sunday, 21 August 2016 at 20:36:54 UTC, Engine Machine wrote:
On Sunday, 21 August 2016 at 19:42:08 UTC, Lodovico Giaretta
wrote:
[...]
You're right. I didn't realize that variables could be shadowed
in classes. Seems dangerous. D doesn't allow shadowing in a
normal context and gives an
On Sunday, 21 August 2016 at 19:42:08 UTC, Lodovico Giaretta
wrote:
On Sunday, 21 August 2016 at 19:29:26 UTC, Engine Machine wrote:
[...]
The problem of this code has nothing to do with aliases. They
work correctly. The problem is variable shadowing. In the
following code, Child has two x
On Sunday, 21 August 2016 at 19:29:26 UTC, Engine Machine wrote:
I know you like to play the right or wrong game, but did you
ever learn that a single example does not prove the truth of
something?
How about something more complex?
Your demagogy will not help you learn the basics of the D
On Sunday, 21 August 2016 at 19:42:08 UTC, Lodovico Giaretta
wrote:
On Sunday, 21 August 2016 at 19:29:26 UTC, Engine Machine wrote:
[...]
The problem of this code has nothing to do with aliases. They
work correctly. The problem is variable shadowing. In the
following code, Child has two x
On Sunday, 21 August 2016 at 19:29:26 UTC, Engine Machine wrote:
[...]
The problem of this code has nothing to do with aliases. They
work correctly. The problem is variable shadowing. In the
following code, Child has two x variables, one of which is only
accessible from a Parent reference,
On Sunday, 21 August 2016 at 06:28:25 UTC, Jack Applegame wrote:
On Sunday, 21 August 2016 at 00:06:07 UTC, Engine Machine wrote:
On Saturday, 20 August 2016 at 22:21:00 UTC, ag0aep6g wrote:
On 08/21/2016 12:11 AM, Engine Machine wrote:
Is there a way to rebind the arguments of a template?
On Tuesday, 21 June 2016 at 00:31:51 UTC, Adam D. Ruppe wrote:
On Monday, 20 June 2016 at 21:39:45 UTC, Joerg Joergonson wrote:
adding
if (i >= previousLine.length) break;
prevents some crashes and seems to work.
So previousLine should be either the right length or null, so I
put in
On Monday, 20 June 2016 at 21:39:45 UTC, Joerg Joergonson wrote:
adding
if (i >= previousLine.length) break;
prevents some crashes and seems to work.
So previousLine should be either the right length or null, so I
put in one test.
Can you try it on your test image?
BTW I do a few
On Monday, 20 June 2016 at 21:53:42 UTC, Alex Parrill wrote:
You'd probably get better results by filing an issue with the
project's bug tracker [1]. Also by including a sample image
that causes the crash.
It doesn't make much of a difference to me, it all just ends up
in my email inbox
On Monday, 20 June 2016 at 21:39:45 UTC, Joerg Joergonson wrote:
1810:
case 3:
auto arr = data.dup;
foreach(i; 0 .. arr.length) {
auto prev = i < bpp ? 0 : arr[i - bpp];
On Friday, 13 May 2016 at 06:33:40 UTC, Jacob Carlborg wrote:
Even better is to use "rdmd" which will automatically track and
compile dependencies.
but i should warn about annoing bug with local import
http://forum.dlang.org/post/mailman.1984.1373610213.13711.digitalmar...@puremagic.com
On 2016-05-13 08:27, Andrew Edwards wrote:
I fail to see why the compiler would be less capable at this task than
rdmd. Since it is already build to accept multiple input files and knows
more about what's going on during compilation than rdmd will ever know,
in does not make sense that it
On 2016-05-13 08:10, tsbockman wrote:
According to the DMD compiler manual, the -run switch only accepts a
single source file:
-run srcfile args...
After the first source file, any further arguments passed to DMD will be
interpreted as arguments to be passed to the program being run.
To
On 5/13/16 3:10 PM, tsbockman wrote:
On Friday, 13 May 2016 at 01:16:36 UTC, Andrew Edwards wrote:
command: dmd -run mod inc
output:
Undefined symbols for architecture x86_64:
"_D3inc5printFZv", referenced from:
__Dmain in mod.o
ld: symbol(s) not found for architecture x86_64
clang:
On Friday, 13 May 2016 at 01:16:36 UTC, Andrew Edwards wrote:
command: dmd -run mod inc
output:
Undefined symbols for architecture x86_64:
"_D3inc5printFZv", referenced from:
__Dmain in mod.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit
On 5/12/16 9:20 AM, MGW wrote:
Windows 7 32bit
---
import std.stdio;
import std.conv;
class CFormaMain {
~this() {
char[] zz = [ 'A', 'B', 'C' ];
This allocates. Allocations are not allowed in GC collection cycle.
-Steve
On Thursday, 12 May 2016 at 13:20:35 UTC, MGW wrote:
Windows 7 32bit
---
import std.stdio;
import std.conv;
class CFormaMain {
~this() {
char[] zz = [ 'A', 'B', 'C' ];
writeln(to!string(zz));
}
}
int main(string[] args) {
On Saturday, 16 April 2016 at 14:50:07 UTC, ag0aep6g wrote:
On 16.04.2016 02:56, Erik Smith wrote:
I'm getting a strange assertion/crash involving RefCounted and
I've
reduced it down to the isolated case (see below). This is
with D 2.071
and requires this version to compile.
Seems to work
On 16.04.2016 02:56, Erik Smith wrote:
I'm getting a strange assertion/crash involving RefCounted and I've
reduced it down to the isolated case (see below). This is with D 2.071
and requires this version to compile.
Seems to work with git master (8da509d). Digger [1] says it's been fixed
in
V Thu, 14 Jan 2016 17:32:47 +
NX via Digitalmars-d-learn napsáno:
> Please explain.
Regression: something works before does not work anymore
Bug: something does not work as expected (regression is one type of bug)
On Thursday, 14 May 2015 at 00:29:06 UTC, Dennis Ritchie wrote:
Why doesn't the compiler produces an error?
-
import std.stdio;
void main() {
writeln({});
}
-
http://ideone.com/qTZCAd
Somehow reminds me of this lambda:
On Friday, 15 May 2015 at 08:44:41 UTC, Ivan Kazmenko wrote:
Somehow reminds me of this lambda:
https://github.com/Hackerpilot/Idiotmatic-D/blob/master/idiotmatic.d#L127-L128
Maybe it generally blocks for initialization of variables:
On 05/14/2015 03:39 PM, Dennis Ritchie wrote:
On Thursday, 14 May 2015 at 21:55:40 UTC, Alex Parrill wrote:
On Thursday, 14 May 2015 at 00:39:25 UTC, Dennis Ritchie wrote:
On Thursday, 14 May 2015 at 00:33:33 UTC, Brian Schott wrote:
You told it to output a function literal, so it did.
Yes,
On Thursday, 14 May 2015 at 00:39:25 UTC, Dennis Ritchie wrote:
On Thursday, 14 May 2015 at 00:33:33 UTC, Brian Schott wrote:
You told it to output a function literal, so it did.
Yes, but it would be logical to deduce something like:
-
writeln({}); // prints literal[{}]
Or the compiler
On Thursday, 14 May 2015 at 21:55:40 UTC, Alex Parrill wrote:
On Thursday, 14 May 2015 at 00:39:25 UTC, Dennis Ritchie wrote:
On Thursday, 14 May 2015 at 00:33:33 UTC, Brian Schott wrote:
You told it to output a function literal, so it did.
Yes, but it would be logical to deduce something
On Thursday, 14 May 2015 at 22:55:43 UTC, Ali Çehreli wrote:
Yes, it is weird but that value happens to be the address of
the function. Here is another test:
import std.stdio;
void foo() pure nothrow @nogc @safe
{}
void main()
{
void printInfo(T)(T t)
{
writefln(%s %s,
On Thursday, 14 May 2015 at 00:29:06 UTC, Dennis Ritchie wrote:
Why doesn't the compiler produces an error?
-
import std.stdio;
void main() {
writeln({});
}
-
http://ideone.com/qTZCAd
You told it to output a function literal, so it did.
(That or you told it to output a
Turns out that I can put into the function writeln almost any
design language:
-
import std.stdio;
void main() {
writeln( { int n = 5; } );
}
-
http://ideone.com/Rp7gZ2
On Thursday, 14 May 2015 at 00:33:33 UTC, Brian Schott wrote:
You told it to output a function literal, so it did.
Yes, but it would be logical to deduce something like:
-
writeln({}); // prints literal[{}]
Or the compiler will not be able to distinguish the literal from
the ordinary
On Saturday, 9 May 2015 at 08:30:31 UTC, Dave Akers wrote:
The following...
import std.stdio;
void main() {
write(How many students are there? );
int studentCount;
readf(%s, studentCount);
write(How many teachers are there? );
int teacherCount;
On Saturday, 9 May 2015 at 08:41:49 UTC, Dave Akers wrote:
On Saturday, 9 May 2015 at 08:34:42 UTC, Dennis Ritchie wrote:
On Saturday, 9 May 2015 at 08:30:31 UTC, Dave Akers wrote:
The following...
import std.stdio;
void main() {
write(How many students are there? );
int
On Sat, 09 May 2015 09:23:23 +, John Colvin wrote:
On Saturday, 9 May 2015 at 08:41:49 UTC, Dave Akers wrote:
On Saturday, 9 May 2015 at 08:34:42 UTC, Dennis Ritchie wrote:
On Saturday, 9 May 2015 at 08:30:31 UTC, Dave Akers wrote:
The following...
import std.stdio;
void main() {
On Saturday, 9 May 2015 at 08:34:42 UTC, Dennis Ritchie wrote:
On Saturday, 9 May 2015 at 08:30:31 UTC, Dave Akers wrote:
The following...
import std.stdio;
void main() {
write(How many students are there? );
int studentCount;
readf(%s, studentCount);
write(How
On Wednesday, 15 April 2015 at 15:17:32 UTC, Steven Schveighoffer
wrote:
On 4/15/15 10:44 AM, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
register = true;
}
}
void main() {
Foo foo;
On Thursday, 16 April 2015 at 13:52:32 UTC, ixid wrote:
writeln = Now this is abused of the syntax.
The important question is, can you assign a tuple and get the
auto unpacking to kick in ?
On Thursday, 16 April 2015 at 22:48:53 UTC, Idan Arye wrote:
%s %s.writefln = (foo.tuple = bar).expand;
Please make a pull request:
https://github.com/Hackerpilot/Idiotmatic-D
On Thursday, 16 April 2015 at 21:37:39 UTC, deadalnix wrote:
On Thursday, 16 April 2015 at 13:52:32 UTC, ixid wrote:
writeln = Now this is abused of the syntax.
The important question is, can you assign a tuple and get the
auto unpacking to kick in ?
%s %s.writefln = (foo.tuple =
On 4/15/15 10:44 AM, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
register = true;
}
}
void main() {
Foo foo;
foo.register(10);
}
Easy, the bug is in DMD improperly
On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote:
register = true;
Easy, you assigned to the wrong variable, that'd quickly be
obvious at runtime too with a stack overflow.
I think it sucks that true and false will implicitly convert to
int though, that bites people
On Wednesday, 15 April 2015 at 14:46:56 UTC, Adam D. Ruppe wrote:
On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote:
register = true;
Easy, you assigned to the wrong variable, that'd quickly be
obvious at runtime too with a stack overflow.
I think it sucks that true and
On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
register = true;
}
}
void main() {
Foo foo;
foo.register(10);
}
register = true
On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
register = true;
}
}
void main() {
Foo foo;
foo.register(10);
}
Property assignment
On Wednesday, 15 April 2015 at 17:28:01 UTC, John Colvin wrote:
On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
register = true;
}
}
void main() {
On 4/15/15 1:44 PM, Caspar wrote:
On Wednesday, 15 April 2015 at 17:28:01 UTC, John Colvin wrote:
On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
On Wednesday, 15 April 2015 at 15:17:32 UTC, Steven Schveighoffer
wrote:
Easy, the bug is in DMD improperly accepting property
assignment without @property annotation :P
We've found the winner!
On Wednesday, 15 April 2015 at 15:17:32 UTC, Steven Schveighoffer
wrote:
On 4/15/15 10:44 AM, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
register = true;
}
}
void main() {
Foo foo;
On Wednesday, 15 April 2015 at 18:25:33 UTC, w0rp wrote:
On Wednesday, 15 April 2015 at 15:17:32 UTC, Steven
Schveighoffer wrote:
On 4/15/15 10:44 AM, Idan Arye wrote:
import std.stdio;
struct Foo {
bool registered = false;
void register(int x) {
writeln(Registering , x);
On Friday, 30 January 2015 at 13:39:05 UTC, BBaz wrote:
On Friday, 30 January 2015 at 13:34:57 UTC, drug wrote:
On 30.01.2015 16:31, BBaz wrote:
On Friday, 30 January 2015 at 12:32:05 UTC, drug wrote:
static init()
{
auto instance = new typeof(this)();
instance._cont = new
On Friday, 30 January 2015 at 13:56:17 UTC, anonymous wrote:
On Friday, 30 January 2015 at 13:39:05 UTC, BBaz wrote:
On Friday, 30 January 2015 at 13:34:57 UTC, drug wrote:
On 30.01.2015 16:31, BBaz wrote:
On Friday, 30 January 2015 at 12:32:05 UTC, drug wrote:
static init()
{
auto
On 30.01.2015 16:56, anonymous wrote:
Besides, it's a bad idea to call a member init, because it steals the
name of the default initializer. It doesn't override the default
initializer, it just takes its name. The compiler should not accept it,
in my opinion.
Good remark! I'll rename it.
On 30.01.2015 17:04, BBaz wrote:
Yes, that was the point: bad idea to call a member init.
But I've missed something with inference of return type...
let's call this the BMS : big-mouth-syndrom...
I didn't know it could be ommitted...I thought it could be if the
function has
On Friday, 30 January 2015 at 13:11:35 UTC, anonymous wrote:
Lines 846-850:
static if(less == a b)
auto vals = [1, 2, 3, 4, 5];
else
auto vals = [5, 4, 3, 2, 1];
assert(equal(r, vals));
(Tab + Enter strikes again.)
That test looks wrong. So,
The real problem is if I comment my unittest out then it compiles. Why
my unittest causes this behaviour?
On Friday, 30 January 2015 at 12:32:05 UTC, drug wrote:
```
import std.container: RedBlackTree;
class Manager(TT, alias Cmp = ab)
{
alias Container = RedBlackTree!(TT, Cmp);
Container _cont;
static init()
{
auto instance = new typeof(this)();
instance._cont =
On 30.01.2015 16:31, BBaz wrote:
On Friday, 30 January 2015 at 12:32:05 UTC, drug wrote:
static init()
{
auto instance = new typeof(this)();
instance._cont = new Container();
return instance;
}
have you tried
---
static typeof(this) init()
{
On Friday, 30 January 2015 at 12:32:05 UTC, drug wrote:
static init()
{
auto instance = new typeof(this)();
instance._cont = new Container();
return instance;
}
have you tried
---
static typeof(this) init()
{
auto instance = new
On Friday, 30 January 2015 at 13:34:57 UTC, drug wrote:
On 30.01.2015 16:31, BBaz wrote:
On Friday, 30 January 2015 at 12:32:05 UTC, drug wrote:
static init()
{
auto instance = new typeof(this)();
instance._cont = new Container();
return instance;
}
have you
On 30.01.2015 16:14, anonymous wrote:
On Friday, 30 January 2015 at 13:11:35 UTC, anonymous wrote:
Lines 846-850:
static if(less == a b)
auto vals = [1, 2, 3, 4, 5];
else
auto vals = [5, 4, 3, 2, 1];
assert(equal(r, vals));
(Tab + Enter
On 30.01.2015 16:35, drug wrote:
On 30.01.2015 16:14, anonymous wrote:
On Friday, 30 January 2015 at 13:11:35 UTC, anonymous wrote:
Lines 846-850:
static if(less == a b)
auto vals = [1, 2, 3, 4, 5];
else
auto vals = [5, 4, 3, 2, 1];
On Wednesday, 7 January 2015 at 23:31:30 UTC, H. S. Teoh via
Digitalmars-d wrote:
On Wed, Jan 07, 2015 at 10:03:00PM +, Peter Alexander via
Digitalmars-d wrote:
https://issues.dlang.org/show_bug.cgi?id=13806
For the lazy: BitArray has an init() method, which hides the
property
On Thu, Jan 08, 2015 at 09:46:16AM +, Peter Alexander via Digitalmars-d
wrote:
On Wednesday, 7 January 2015 at 23:31:30 UTC, H. S. Teoh via Digitalmars-d
wrote:
On Wed, Jan 07, 2015 at 10:03:00PM +, Peter Alexander via
Digitalmars-d wrote:
On Wed, Jan 07, 2015 at 10:03:00PM +, Peter Alexander via Digitalmars-d
wrote:
https://issues.dlang.org/show_bug.cgi?id=13806
For the lazy: BitArray has an init() method, which hides the property
BitArray.init
This, or something similar, appears every few months. Walter has said
in
On Wednesday, 7 January 2015 at 22:03:01 UTC, Peter Alexander
wrote:
Can we just deprecate it? At the very least deprecate functions
named init().
There's a check for that:
https://github.com/Hackerpilot/Dscanner/blob/master/src/analysis/builtin_property_names.d
On Friday, 21 November 2014 at 19:19:20 UTC, Daniel Murphy wrote:
Furthermore, I'm starting to get very confused:
enum sameTypes(T, U) = is(T: U) is(U: T);
assert(sameTypes!(const int, immutable int)); //Ok, wtf?
assert(sameTypes!(int, immutable int); //Ok, wtf?
All of those types
Meta wrote in message news:wkhobsfnumjpyyrpd...@forum.dlang.org...
Yes, right, as they are POD value types. I'm not sure I like that, as it
can't be guaranteed that T1 and T2 are the same type if is(T1: T2)
is(T2: T1) are true... I will submit a bug report regarding my original
issue,
On Friday, 21 November 2014 at 07:40:31 UTC, Daniel Murphy wrote:
It doesn't print anything for me. This code seems to have the
desired effect:
shared const int i;
void main()
{
static if (is(typeof(i) : shared(U), U))
{
//Prints const(int)
pragma(msg, U);
}
}
Hmm,
Meta wrote in message news:tyfdmprlmreagrrnb...@forum.dlang.org...
Hmm, do you know why is(typeof(i) == shared(U), U)) might fail? I wonder
why : is required over ==... Doesn't the former check if T is a subtype of
U, rather than check that they're the same type?
I have no idea, I tried ==
On Friday, 21 November 2014 at 15:29:05 UTC, Daniel Murphy wrote:
but you could enforce exact type with something like
if (typeof(i) == shared(U), U) is(shared(U) == typeof(i))
I'm assuming you meant if (typeof(i): shared(U), U)
is(shared(U): typeof(i))).
On Friday, 21 November 2014 at 07:40:31 UTC, Daniel Murphy wrote:
It doesn't print anything for me. This code seems to have the
desired effect:
shared const int i;
void main()
{
static if (is(typeof(i) : shared(U), U))
{
//Prints const(int)
pragma(msg, U);
}
}
Now
Meta wrote in message news:nwskxjncbwqndlkie...@forum.dlang.org...
On Friday, 21 November 2014 at 15:29:05 UTC, Daniel Murphy wrote:
but you could enforce exact type with something like
if (typeof(i) == shared(U), U) is(shared(U) == typeof(i))
I'm assuming you meant if (typeof(i):
Meta wrote in message news:szrhmjrinsymyihem...@forum.dlang.org...
Now how about this one:
alias Unshared(T: shared U, U) = U;
pragma(msg, Unshared!(shared const int)); //Prints const(int)
Does the `:` denote subtyping as well, or equality? I'm sure that
Neither. IIRC it's something close
Meta wrote in message news:wzczhiwokauvkkevt...@forum.dlang.org...
shared const int i;
static if (is(typeof(i) T == shared U, U))
{
//Prints shared(const(int))
pragma(msg, U);
}
This seems like subtly wrong behaviour to me. If T == shared U, for some
U, then shouldn't U be
On 11/4/14 4:48 PM, Walter Bright wrote:
On 11/4/2014 9:51 AM, Jonathan Marler wrote:
given the
output of Transform, the compiler cannot deduce what the input of
Transform was
EVEN IF THE TEMPLATE IS AS SIMPLE AS THIS ONE.
To answer a question not asked, why doesn't the compiler see the
Steven Schveighoffer wrote in message
news:m3bap5$khl$1...@digitalmars.com...
https://issues.dlang.org/show_bug.cgi?id=1807
Hm.. interesting to note that Martin's suggestion has come to fruition,
might this be revisited?
Not really, templated aliases behave exactly the same as aliases in
On Tuesday, 4 November 2014 at 21:48:29 UTC, Walter Bright wrote:
On 11/4/2014 9:51 AM, Jonathan Marler wrote:
given the
output of Transform, the compiler cannot deduce what the input
of Transform was
EVEN IF THE TEMPLATE IS AS SIMPLE AS THIS ONE.
To answer a question not asked, why doesn't
On 11/4/14 11:01 AM, Jonathan Marler wrote:
In the past I don't get much response when I file a bug in BugZilla so I
wanted to see if anyone could tell me anything about this issue in the
forums.
I believe a bug has already been created here:
https://issues.dlang.org/show_bug.cgi?id=2372
On Tuesday, 4 November 2014 at 16:55:10 UTC, Steven Schveighoffer
wrote:
This is as designed.
The reason is because the compiler cannot deduce *backwards*
how to instantiate a template to get the right result.
I ran into this a long time ago when porting Tango.
Here is the counter-case:
Steven Schveighoffer wrote in message
news:m3b0dd$6e0$1...@digitalmars.com...
People have argued in the past that anything with a simple alias should be
doable. I don't know if that's true or not, but I don't think it works
today. There may be a bug report somewhere on it, I didn't search.
On 11/4/14 1:05 PM, Daniel Murphy wrote:
Steven Schveighoffer wrote in message
news:m3b0dd$6e0$1...@digitalmars.com...
People have argued in the past that anything with a simple alias
should be doable. I don't know if that's true or not, but I don't
think it works today. There may be a bug
On 11/4/2014 9:51 AM, Jonathan Marler wrote:
given the
output of Transform, the compiler cannot deduce what the input of Transform was
EVEN IF THE TEMPLATE IS AS SIMPLE AS THIS ONE.
To answer a question not asked, why doesn't the compiler see the simple case and
handle it?
The problem is
On Tuesday, 4 November 2014 at 21:48:29 UTC, Walter Bright wrote:
On 11/4/2014 9:51 AM, Jonathan Marler wrote:
given the
output of Transform, the compiler cannot deduce what the input
of Transform was
EVEN IF THE TEMPLATE IS AS SIMPLE AS THIS ONE.
To answer a question not asked, why doesn't
Though, explicit reference to TestClass.instanceMethod is not a
delegate. The delegate is constructed manually later in the code
on attempt to call the method.
I think I've got it figured out.
In my original example, I added the following line inside the
function-template, and the class-template:
pragma(msg, typeof(T).stringof);
in both cases, the (correct)result was a tuple of a function
(void())
But, when it came time to retrieve the address
On Tuesday, 28 October 2014 at 02:34:14 UTC, ketmar via
Digitalmars-d wrote:
On Tue, 28 Oct 2014 01:36:01 +
bitwise via Digitalmars-d digitalmars-d@puremagic.com wrote:
I have actually found a work around as well, which was to wrap
the actual retrieval of the function address in a lambda,
On Monday, 27 October 2014 at 22:17:25 UTC, bitwise wrote:
This error seems like it may be related some how:
enum index = __traits(getVirtualIndex,
TestClass.instanceMethod);
enum p = TestClass.classinfo.vtbl[index];
The above code will produce this error:
Error: typeid(main.TestClass).vtbl
On Tuesday, 28 October 2014 at 02:34:14 UTC, ketmar via
Digitalmars-d wrote:
On Tue, 28 Oct 2014 01:36:01 +
bitwise via Digitalmars-d digitalmars-d@puremagic.com wrote:
I have actually found a work around as well, which was to wrap
the actual retrieval of the function address in a lambda,
That being said, you only need to worry about any of this if
you want to support virtual methods and have it invoke the
actual overridden method, not the one you have saved through
reflection. (For example, if Bar : Foo overrides foo, and you
generated reflection info for Foo, it would call
On 10/27/14 4:52 PM, bitwise wrote:
quotes self
Here is a better example, showing that virtual function pointers are
available at compile time in C++. Essentially, I would expect my D code
to function similarly, but it won't compile.
class TestAddr {
public: virtual void test() { cout
201 - 300 of 531 matches
Mail list logo