Re: LINK : fatal error LNK1104: cannot open file '_CMDLINE' --- errorlevel 1104

2016-01-11 Thread Tobi G. via Digitalmars-d-learn
On Monday, 11 January 2016 at 20:19:50 UTC, Jason Jeffory wrote: Sheesh, why is it so hard to do simple stuff? 1) Have you tryed passing --arch=x86_64 to dub? 2) > "versions-x86_64": ["XYZ"] This is like a architecture dependent condition for version definition. So if your project will

Re: Using std.conv.to with std.typecons.Typedef

2016-01-11 Thread Tobi G. via Digitalmars-d-learn
On Monday, 11 January 2016 at 08:03:19 UTC, Saurabh Das wrote: How can I get std.conv to understand std.typecons.Typedef? You can do something like this: QuestionId q = to!(TypedefType!QuestionId)("43"); In general, is there a better solution to orthogonal types than Typedef? Typedef is

Re: Using std.conv.to with std.typecons.Typedef

2016-01-11 Thread Tobi G. via Digitalmars-d-learn
On Monday, 11 January 2016 at 12:15:55 UTC, Saurabh Das wrote: Any ideas? Yes. Because Typedef is introducing new Types, which csvReader doesn't know what they are, you'll need a little workaround and cast the values yourself. import std.csv, std.stdio, std.algorithm, std.range; enum

Re: Function accepts const ubyte[], const char[], immutable ubyte[], immutable char[]

2016-01-10 Thread Tobi G. via Digitalmars-d-learn
On Sunday, 10 January 2016 at 10:10:46 UTC, zabruk70 wrote: Hello. 1st Novice question: i want function, operates sometimes with char[], sometimes with ubyte[]. internally it works with ubyte. i can use overloading: void myFunc(ubyte[] arg) {...}; void myFunc(char[] arg) { ubyte[] arg2 =

Re: Bug in csv or byLine ?

2016-01-10 Thread Tobi G. via Digitalmars-d-learn
The bug has been fixed...

Re: Bug in csv or byLine ?

2016-01-10 Thread Tobi G. via Digitalmars-d-learn
On Sunday, 10 January 2016 at 09:41:16 UTC, Keywan Ghadami wrote: On Friday, 8 January 2016 at 13:53:06 UTC, Guillaume Chatelet wrote: I still do not understand half of the syntax(still learning) but my guess is that it is a bug in the csv reader: In

Re: Bug in csv or byLine ?

2016-01-10 Thread Tobi G. via Digitalmars-d-learn
On Sunday, 10 January 2016 at 19:07:52 UTC, Jesse Phillips wrote: On Sunday, 10 January 2016 at 18:09:23 UTC, Tobi G. wrote: The bug has been fixed... Do you have a link for the fix? Is there a BugZilla entry? Yes sure.. https://issues.dlang.org/show_bug.cgi?id=15545 and the fix at github

Re: Is this rdmd bug or my fault ?

2016-01-08 Thread Tobi G. via Digitalmars-d-learn
On Friday, 8 January 2016 at 15:45:52 UTC, zabruk70 wrote: Should i create bugreport, or this is my mistake? I get also a compilation error (with rdmd and -g). Fortunately building manually with dmd works. So there has to be a bug in rdmd.. togrue

Re: Bug in csv or byLine ?

2016-01-08 Thread Tobi G. via Digitalmars-d-learn
On Friday, 8 January 2016 at 09:59:26 UTC, Guillaume Chatelet wrote: Any idea ? No, sorry. Under Windows DMD v2.069.2 it works perfectly in both cases. Which compiler do you use? You could run DMD with the -g option. This will print often more useful output, if it fails. togrue

Re: Bug in csv or byLine ?

2016-01-08 Thread Tobi G. via Digitalmars-d-learn
On Friday, 8 January 2016 at 12:13:59 UTC, Guillaume Chatelet wrote: On Friday, 8 January 2016 at 12:07:05 UTC, Tobi G. wrote: No, sorry. Under Windows DMD v2.069.2 it works perfectly in both cases. Which compiler do you use? - DMD64 D Compiler v2.069.2 on Linux. - LDC 0.16.1 (DMD v2.067.1,

Re: RedBlackTree and myClass

2016-01-03 Thread Tobi G. via Digitalmars-d-learn
On Sunday, 3 January 2016 at 14:49:59 UTC, tsbockman wrote: On Sunday, 3 January 2016 at 10:55:05 UTC, AntonSotov wrote: import std.container.rbtree; class myClass { string str; } int main() { auto tree = new RedBlackTree!myClass; return 0; } Error: mutable method

Re: RedBlackTree and myClass

2016-01-03 Thread Tobi G. via Digitalmars-d-learn
On Sunday, 3 January 2016 at 16:44:35 UTC, tsbockman wrote: If it's a private internal data structure which is only used a few places, then sure - just use the minimum code required to get the job done. But, if it's a part of the public API for a module and the class logically has a natural

Re: immutable promise broken in unions?

2016-01-02 Thread Tobi G. via Digitalmars-d-learn
On Saturday, 2 January 2016 at 10:04:47 UTC, Shriramana Sharma wrote: I thought the promise of `immutable` was: never changes. The compiler doesn't protect you by carrying a bomb. :) But there is another usecase where it makes sense to allow writing to other union members despite the

Re: Why does this not work?

2016-01-01 Thread Tobi G. via Digitalmars-d-learn
On Friday, 1 January 2016 at 14:00:41 UTC, TheDGuy wrote: writeln("Which number should i guess?"); string input = readln(); int i = to!int(input); The solution is that readln() returns a string that also contains the newline this can be solved by easily stripping the

Re: Why does this not work?

2016-01-01 Thread Tobi G. via Digitalmars-d-learn
On Friday, 1 January 2016 at 14:20:26 UTC, Tobi G. wrote: The solution is that readln() returns a string that also contains the newline this can be solved by easily stripping the newline off import std.string; int i = to!int(input.strip); Sorry my bad english.. i wrote solution but meant

DList access the previous element

2016-01-01 Thread Tobi G. via Digitalmars-d-learn
I'd like to implement a Skyline Rectangle packing algorithm. A DList should store the actual Skyline. (So the order is important, it will mostly have to access the right or left node element) And a Binary Heap which should hold a pointer to every DList element. (Mostly for fast accessing the

Re: How to build dfmt?

2016-01-01 Thread Tobi G. via Digitalmars-d-learn
On Friday, 1 January 2016 at 14:20:05 UTC, Suliman wrote: https://github.com/Hackerpilot/dfmt After run build.bat nothing do not happens. How can I build it? The easiest way to do it is to download and install dub - the package manager from https://code.dlang.org/ and then run dub fetch