Re: Coding Challenges at Dconf2018: Implement Needleman–Wunsch and Smith–Waterman algorithms

2018-04-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/30/18 2:47 PM, biocyberman wrote: Hellow D community. I am attending Dconf 2018 and giving a talk there on May 4. Link: https://dconf.org/2018/talks/le.html. It will be very interesting to talk about the outcome of the following challenges. If we can't have at least 3 solutions by three

Coding Challenges at Dconf2018: Implement Needleman–Wunsch and Smith–Waterman algorithms

2018-04-30 Thread biocyberman via Digitalmars-d-learn
Hellow D community. I am attending Dconf 2018 and giving a talk there on May 4. Link: https://dconf.org/2018/talks/le.html. It will be very interesting to talk about the outcome of the following challenges. If we can't have at least 3 solutions by three individuals by 10:00 GMT+2 May 4, I wil

Re: Passing to c++ std::string and vector

2018-04-30 Thread Seb via Digitalmars-d-learn
On Monday, 30 April 2018 at 01:07:35 UTC, NewUser wrote: Hi, How do I pass a d string to a c++ std::string? NewUser There's https://github.com/dlang/druntime/pull/1316 (an attempt at making C++ standard library)

Re: Passing to c++ std::string and vector

2018-04-30 Thread NewUser via Digitalmars-d-learn
On Monday, 30 April 2018 at 10:48:40 UTC, Jonathan M Davis wrote: On Monday, April 30, 2018 01:07:35 NewUser via Digitalmars-d-learn wrote: Hi, How do I pass a d string to a c++ std::string? The most straightforward way would be to create a C or C++ function which accepts const char* and siz

Re: cast const pointer to non-const and change value yields neither result nor error

2018-04-30 Thread Stefan Koch via Digitalmars-d-learn
On Monday, 30 April 2018 at 12:35:06 UTC, Timoses wrote: Hey, reading through https://dlang.org/articles/const-faq.html and experimenting a bit: ``` immutable int i = 3; const(int)* p = &i; int* q = cast(int*)p; assert(q == p && p == &i); writeln(i); // 3 *q = 1;

cast const pointer to non-const and change value yields neither result nor error

2018-04-30 Thread Timoses via Digitalmars-d-learn
Hey, reading through https://dlang.org/articles/const-faq.html and experimenting a bit: ``` immutable int i = 3; const(int)* p = &i; int* q = cast(int*)p; assert(q == p && p == &i); writeln(i); // 3 *q = 1; // Why does this have no effect at all? No error no not

Re: readonly member (but assignable at constructor time)

2018-04-30 Thread bauss via Digitalmars-d-learn
On Monday, 30 April 2018 at 10:57:51 UTC, Jonathan M Davis wrote: On Monday, April 30, 2018 10:36:52 bauss via Digitalmars-d-learn wrote: On Saturday, 28 April 2018 at 04:56:26 UTC, lempiji wrote: > On Friday, 27 April 2018 at 02:59:16 UTC, Dr.No wrote: >> In C# you can have a readonly member as

Re: readonly member (but assignable at constructor time)

2018-04-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 30, 2018 10:36:52 bauss via Digitalmars-d-learn wrote: > On Saturday, 28 April 2018 at 04:56:26 UTC, lempiji wrote: > > On Friday, 27 April 2018 at 02:59:16 UTC, Dr.No wrote: > >> In C# you can have a readonly member assignable either at > >> declaration or constructor time, like t

Re: Passing to c++ std::string and vector

2018-04-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 30, 2018 01:07:35 NewUser via Digitalmars-d-learn wrote: > Hi, > > How do I pass a d string to a c++ std::string? The most straightforward way would be to create a C or C++ function which accepts const char* and size_t and then creates the std::string, in which case you pass it ar

Re: readonly member (but assignable at constructor time)

2018-04-30 Thread bauss via Digitalmars-d-learn
On Saturday, 28 April 2018 at 04:56:26 UTC, lempiji wrote: On Friday, 27 April 2018 at 02:59:16 UTC, Dr.No wrote: In C# you can have a readonly member assignable either at declaration or constructor time, like this: class C { readonly myClass mc; this() { mc = new myClass(); }

Re: Passing to c++ std::string and vector

2018-04-30 Thread Uknown via Digitalmars-d-learn
On Monday, 30 April 2018 at 01:07:35 UTC, NewUser wrote: Hi, How do I pass a d string to a c++ std::string? NewUser There is no trivial way to do this as far as I'm aware, mostly due to C++ mangling issues in DMD. You can try calypso [0] or dpp [1], which might work. You can also see this P