On Monday, 2 March 2015 at 15:01:55 UTC, Tobias Pankrath wrote:
I'm really clueless... :P
Something is wrong with your Material class, but you'll need to
show us a reduced example.
After a really long time I finally found what was wrong.
http://dpaste.dzfl.pl/16d202b7124d
Wow, I honestly c
On Monday, 2 March 2015 at 14:46:31 UTC, ketmar wrote:
On Mon, 02 Mar 2015 14:40:50 +, Francesco Cattoglio wrote:
did you tried to dustmite[1] it?
[1] https://github.com/CyberShadow/DustMite/wiki
I tried to "dub dustmite", but it failed with a
"object.Exception@DustMite
On Monday, 2 March 2015 at 14:14:19 UTC, Tobias Pankrath wrote:
Try to reduce your Material class for a small failing example.
It's probably your constructors or opAssign or something like
that. Anyway, it's a bug if template errors from the
implementation bubble up, so please file a report.
I
I'm trying to instantiate a std.container.Array of a given class
(named Material), by a simple
Array!Material _myStuff;
I get two compile errors stating the following:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\container\array.d(85):
Error: template std.algorithm.initializeAll cannot deduce
fun
On Tuesday, 13 January 2015 at 18:52:25 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 13 Jan 2015 18:36:15 +
aldanor via Digitalmars-d-learn
wrote:
On Tuesday, 13 January 2015 at 18:19:42 UTC, ketmar via
Digitalmars-d-learn wrote:
> and then you can go with structures in the first p
Today I just realized that in DMD optimize flag does not imply
inlining, therefore I promptly added the "inline" to my dub build
settings and recompiler, expecting to see speedups in my code
execution.
To my surprise, I could not see anything at all: all that I get
now is a blank screen.
The
Really simple question:
how do I get the compiler-generated hash function for a given
type?
For example:
Struct S
{
int i;
}
can be used in an associative array. That means the compiler
generates a "toHash" function. Is there any simple way to call it
directly?
On Thursday, 24 July 2014 at 09:38:14 UTC, bearophile wrote:
francesco cattoglio:
should this code compile? I understand that the literal "1" is
"int" therefore it can screw type deduction, but I wonder if
the compiler should be smart enough to deduce it correctly.
To ke
So, I have this code (also on http://dpaste.dzfl.pl/3f767b17e83c)
This Vector(T) struct is taken from gfm.math.vector.
struct Vector(T) {
T x, y, z;
this(X : T, Y : T, Z : T)(X x_, Y y_, Z z_)
{
x = x_; y = y_; z = z_;
}
}
void main()
{
Ve
On Friday, 11 July 2014 at 11:43:44 UTC, Joakim wrote:
On Thursday, 10 July 2014 at 15:36:53 UTC, francesco cattoglio
wrote:
A code I'm working on stops working and starts printing an
infinite loop of
core.exception.InvalidMemoryOperationError
to the command line output. The code is
A code I'm working on stops working and starts printing an
infinite loop of
core.exception.InvalidMemoryOperationError
to the command line output. The code is quite complex and the bug
seems to present itself almost in random situation so I would
like to try to understand the issue better befor
On Saturday, 5 July 2014 at 17:08:01 UTC, Olivier Pisano wrote:
No, import is different from include. It does not stupidly copy
and paste its content but tells the compiler to take the module
into account for name resolution. The result may seem similar,
but is much more efficient.
In fact, try
http://dlang.org/phobos/std_typecons.html#Typedef
Take a look at it. Docs is scarce (pretty sure you will need to
take a look around to find something) but it should just do what
you need.
On Friday, 30 May 2014 at 12:57:52 UTC, anonymous wrote:
And why is "const(Foo) getQ" so much different? (e.g: this is
an explicit cast, right? Is there anything that might go
wrong?)
It's not a cast. It's the unambiguous notation for a qualified
type. Often you can omit the parentheses. With
Today I got the following compile error:
"Cannot implicitly convert expression () of type
const() to "
and this is a reduced example ( also on
http://dpaste.dzfl.pl/f2f3bd921989):
module test;
import std.stdio;
class Foo {
int i = 42;
}
class MyClass {
private { Foo _Q;
On Wednesday, 28 May 2014 at 17:46:23 UTC, David wrote:
Ok, now I just wonder wich Engine. (I know everybody hates the
discussion about the "best" engine.) CryEngine, UDK, Unity or a
less known Engine?
I'll be honest, perhaps I risk being misunderstood, but the
questions you are asking denote
On Thursday, 22 May 2014 at 15:48:50 UTC, John Colvin wrote:
On Thursday, 22 May 2014 at 15:39:36 UTC, David wrote:
Hey, I'm really new to D, and pretty new to programming
overall too,
But I want to make a 3d Game, (just sth. small). I really like
D and want to do it in D, but in the Internet t
On Wednesday, 21 May 2014 at 13:52:47 UTC, John Colvin wrote:
On Wednesday, 21 May 2014 at 11:45:57 UTC, Stefan Frijters
wrote:
I would have expected the last case to work as well, but I get
testarr.d(20): Error: incompatible types for ((dfoo) *
(ibar[])): 'double' and 'int[]'
Is this by des
On Monday, 12 May 2014 at 08:37:43 UTC, JR wrote:
What am I missing?
Error messages!
If your code is not compiled, you can't know whether it is valid
or not.
I must say that since we have unittests, this is somewhat less
relevant, but still...
One nice thing would be stripping the executab
On Tuesday, 25 February 2014 at 14:30:23 UTC, Francesco Cattoglio
wrote:
On Tuesday, 25 February 2014 at 14:26:13 UTC, Tobias Pankrath
wrote:
Something like "static if(fileExists!"config.d")
mixin(import("config.d")) else ...".
Thoughts?
Regards
- Cherry
On Tuesday, 25 February 2014 at 14:26:13 UTC, Tobias Pankrath
wrote:
Something like "static if(fileExists!"config.d")
mixin(import("config.d")) else ...".
Thoughts?
Regards
- Cherry
--
static if(__traits(compiles, import("config.d")))
{
// import/parse/mixin
}
else
{
// default here
}
--
May
On Monday, 24 February 2014 at 12:08:31 UTC, Nordlöw wrote:
On Monday, 24 February 2014 at 11:29:39 UTC, bearophile wrote:
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is
what you want.
Wouldn't it be nice to have some kind of syntactic sugar for
this similar
On Saturday, 22 February 2014 at 22:42:24 UTC, simendsjo wrote:
The problem isn't about optional parenthesis or properties.
It's the fact that
you can redefine a symbol to be something entierly different,
and that this
difference will only be seen if you are looking at the symbol
through the
"
On Saturday, 22 February 2014 at 17:21:50 UTC, luka8088 wrote:
It seems to me that the following code should be illegal, but I
am
uncertain of it so I am posting here for a confirmation before
I post it
on bug tracker:
[snip]
Nice find. I guess we could add this to the list of "ugly code
cau
On Monday, 17 February 2014 at 20:21:30 UTC, simendsjo wrote:
I wouldn't call it randomly. In that case you should call it
randomly that it suddenly doesn't run once you try to step
downward.
I didn't had time to work more on the iota. Perhaps after 2.065
is out I can resume working on that,
On Sunday, 16 February 2014 at 09:53:08 UTC, bearophile wrote:
Be instead amazed of the sometimes near-C++ performance levels
they have pushed Java to :-)
Sorry, but I fail to be amazed by what huge piles of money thrown
to a project for 10+ years can achieve. Those kind of
achievements are bor
On Sunday, 16 February 2014 at 01:25:13 UTC, bearophile wrote:
Many of the things you say and write are still wrong or
confused. Usually the hard optimization of code is one the last
things you learn about a language
Well, actually, sometimes squeezing as much performance as you
can from a te
On Monday, 3 February 2014 at 20:10:59 UTC, Brenton wrote:
6) Any other comments or suggestions?
I know that the "I'm learning the language" factor plays a huge
role, but after you are done studying your vector implementation,
I think you could forget about it and use the ones provided by
ot
On Saturday, 1 February 2014 at 22:52:24 UTC, Andrej Mitrovic
wrote:
On Saturday, 1 February 2014 at 22:47:54 UTC, deed wrote:
Docs also say:
/**
Note:
Each $(D front) will not persist after $(D
popFront) is called, so the caller must copy its contents (e.g.
by
calling $(D to!string)) if rete
On Monday, 27 January 2014 at 13:08:28 UTC, Colin Grogan wrote:
In my defense, I believe C initializes arrays with the curly
brackets
Can I keep making excuses?
Yes you can... And don't worry, I mess up initialization too.
Lots of time.
Especially when I tried initializing an array of st
On Monday, 27 January 2014 at 10:13:08 UTC, Colin Grogan wrote:
On Monday, 27 January 2014 at 09:34:04 UTC, Namespace wrote:
Arrays are enclosed in [] ;)
I'm an idiot.
Can I delete this thread to save further embarrassment? :)
HA-HA!
(read it with Nelson voice, ofc)
Sorry, MY BAD!
You can just write
auto handler = new Handler;
receive(&handler.MyFunc);
Somehow when I tried this before it failed to compile, and I
thought I had to go through loops for achieving this.
Suppose that I receive a message, but instead of defining a
function inside the receive() block, I want to call a member of a
class instance. (This is useful to me for several reasons). Right
now my code looks like:
class Handler {
auto handle() {
return (string msg) {
writeln("rec
So, while I was studying the apropriate template constraints for
my shiny new iota implementation, I found out this funny thing:
import std.stdio;
class Test{
int x = 41;
Test opOpAssign(string op)(int rhs) if (op == "+") {
x += rhs;
return this;
}
}
void main() {
On Friday, 20 December 2013 at 17:18:01 UTC, Timon Gehr wrote:
On 12/20/2013 05:40 PM, monarch_dodra wrote:
That's normal, because "T.init" is not an lvalue.
If you need an lvalue, we have `std.traits.lvalueOf!T` which
you
can use.
is(typeof((T v){ /+ use v +/ }))
I think this is a lot cl
On Friday, 20 December 2013 at 16:40:23 UTC, monarch_dodra wrote:
Everything works as it should, but according to "D Templates:
A Tutorial" book, you should not use arguments in constraints.
That's news to me.
It seems strange to me too, but: page 69 on the PDF:
"Do not use argument in your co
I'm trying to experiment a bit around the iota function.
If I try to impose the following constraits:
auto my_iota(B, E)(B begin, E end)
if (is (typeof(++begin)) && is (typeof(begin < end))) {}
Everything works as it should, but according to "D Templates: A
Tutorial" book, you should not use ar
37 matches
Mail list logo