enum tuple subscript as template parameter => Tuple(A(0)) must be an array or pointer type, not Tuple!(A)

2017-05-07 Thread bastien penavayre via Digitalmars-d-learn
Hi, I'm having a bit of an issue here and the compiler is not really explicit. Here's the code: import std.typecons; struct A { int i; } void main() { enum t = tuple(A()); f!(t[0].i); //Error: Tuple(A(0)) must be an array or pointer type, not Tuple!(A) f!(([0]).i) //Ok enum v

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Patrick Schluter via Digitalmars-d-learn
On Sunday, 7 May 2017 at 13:16:16 UTC, bachmeier wrote: On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: Although I found D for being more better, nicer,and fun than C++ is, but there is a few questions on Stack-Over-Flow, videos on Youtube, and some other forums in my country. So, why

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Patrick Schluter via Digitalmars-d-learn
On Sunday, 7 May 2017 at 12:29:20 UTC, Stanislav Blinov wrote: On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: [...] Because everyone is asking this question instead of actually doing something about it :) To be fair, D has a good amount of usage even today, it's just not being

Re: File Input

2017-05-07 Thread k-five via Digitalmars-d-learn
On Sunday, 7 May 2017 at 15:59:25 UTC, JV wrote: On Sunday, 7 May 2017 at 15:16:58 UTC, k-five wrote: On Sunday, 7 May 2017 at 13:57:47 UTC, JV wrote: I'm kinda getting it but how do i write the stored user input(string) varaible into a .txt??im getting confused since D has so many read and

Re: File Input

2017-05-07 Thread JV via Digitalmars-d-learn
On Sunday, 7 May 2017 at 15:16:58 UTC, k-five wrote: On Sunday, 7 May 2017 at 13:57:47 UTC, JV wrote: Hi guys I'd like to know how to get an input from the user to be stored in a .txt file using import std.file and is it possible to directly write in a .txt file without using a variable to

Re: File Input

2017-05-07 Thread Suliman via Digitalmars-d-learn
On Sunday, 7 May 2017 at 13:57:47 UTC, JV wrote: Hi guys I'd like to know how to get an input from the user to be stored in a .txt file using import std.file and is it possible to directly write in a .txt file without using a variable to store the user input? Thanks for the answer in

Deprecation: foo.bar is not visible from module traits

2017-05-07 Thread Anonymouse via Digitalmars-d-learn
I'm reworking my code to use UDAs, and I'm running into a wall of text of deprecation warnings when compiling. import std.traits; private: struct SomeUDA {} @SomeUDA void foo() {} @SomeUDA void bar() {} @SomeUDA void etc() {} public: void main() { mixin("static import thisModule = "

Re: File Input

2017-05-07 Thread k-five via Digitalmars-d-learn
On Sunday, 7 May 2017 at 13:57:47 UTC, JV wrote: Hi guys I'd like to know how to get an input from the user to be stored in a .txt file using import std.file and is it possible to directly write in a .txt file without using a variable to store the user input? Thanks for the answer in

Error writing file a *.obj

2017-05-07 Thread dummy via Digitalmars-d-learn
Hi :) - OS: Winodws 10 Pro KN - DMD: 2.073.2(ofcourse, i tried dmd of 2.074.x version. but same result) When i build some application with dub, i got this error: -- dub build xx ~master: building configuration

File Input

2017-05-07 Thread JV via Digitalmars-d-learn
Hi guys I'd like to know how to get an input from the user to be stored in a .txt file using import std.file and is it possible to directly write in a .txt file without using a variable to store the user input? Thanks for the answer in advance my mind is kinda jumbled about this since im

Re: How can I pass an argument to rdmd --evel=

2017-05-07 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 7 May 2017 at 11:29:30 UTC, k-five wrote: It should be possible! rdmd --eval=, without accepting argument is useless. FWIW, you can still pass input through stdin.

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread bachmeier via Digitalmars-d-learn
On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: Although I found D for being more better, nicer,and fun than C++ is, but there is a few questions on Stack-Over-Flow, videos on Youtube, and some other forums in my country. So, why D is not popular? If by popular you mean C++ or Java

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 7 May 2017 at 10:33:25 UTC, k-five wrote: On Sunday, 7 May 2017 at 09:46:22 UTC, Patrick Schluter wrote: On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: If you want to learn the basis of the range concept and their link to C++ Iterators, you should definitively read

Re: How can I pass an argument to rdmd --evel=

2017-05-07 Thread k-five via Digitalmars-d-learn
On Sunday, 7 May 2017 at 11:11:05 UTC, Vladimir Panteleev wrote: On Sunday, 7 May 2017 at 10:49:25 UTC, k-five wrote: After reading about rdmd and --eval, I tried this: rdmd --eval='auto f=File("ddoc.html");foreach(line;f.byLine) if(line.length<10) writeln(line);f.close' and worked! Now I

Re: How can I pass an argument to rdmd --evel=

2017-05-07 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 7 May 2017 at 11:11:05 UTC, Vladimir Panteleev wrote: Currently it's not possible: https://issues.dlang.org/show_bug.cgi?id=13345

Re: How can I pass an argument to rdmd --evel=

2017-05-07 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 7 May 2017 at 10:49:25 UTC, k-five wrote: After reading about rdmd and --eval, I tried this: rdmd --eval='auto f=File("ddoc.html");foreach(line;f.byLine) if(line.length<10) writeln(line);f.close' and worked! Now I am wonder if there is a way to pass "ddoc.html" to this

How can I pass an argument to rdmd --evel=

2017-05-07 Thread k-five via Digitalmars-d-learn
After reading about rdmd and --eval, I tried this: rdmd --eval='auto f=File("ddoc.html");foreach(line;f.byLine) if(line.length<10) writeln(line);f.close' and worked! Now I am wonder if there is a way to pass "ddoc.html" to this one-liner? that can work with --loop. I mean: // --loop by

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread k-five via Digitalmars-d-learn
On Sunday, 7 May 2017 at 09:46:22 UTC, Patrick Schluter wrote: On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: If you want to learn the basis of the range concept and their link to C++ Iterators, you should definitively read Andrei's article on them in the InformIT magazine. Here is

Re: Looking for an equivalent to C++ std::getline in D

2017-05-07 Thread Patrick Schluter via Digitalmars-d-learn
On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: Although I am not sure but it may Range in D, has the same concept that C++ has on iterator, like InputIterator or OutputIterator, since I realized that the output of [ filter ] does not have RandomAccessRange so I can not use input[ 0