Re: Using replaceInPlace, string and char[]

2015-08-16 Thread TSalm via Digitalmars-d-learn
> Must create a ticket for it ? I think so. Unless others object in 10 minutes... :) :-) Done : https://issues.dlang.org/show_bug.cgi?id=14925 Thanks for your help

Re: Using replaceInPlace, string and char[]

2015-08-15 Thread Ali Çehreli via Digitalmars-d-learn
On 08/15/2015 01:47 AM, TSalm wrote: > Must create a ticket for it ? I think so. Unless others object in 10 minutes... :) > In the other hand using "string" is not > efficient since this certainly make a copy of the original string. Right ? > This is better to use "replaceInPlace" with "char[

Re: Using replaceInPlace, string and char[]

2015-08-15 Thread TSalm via Digitalmars-d-learn
On Saturday, 15 August 2015 at 08:07:43 UTC, Ali Çehreli wrote: This looks like a bug to me. The template constraints of the two overloads are pretty complicated. This case should match only one of them. Yes I understand. I've used ldc2. With DMD (v0.067.1) the error is more clear : inout.d(1

Re: Using replaceInPlace, string and char[]

2015-08-15 Thread Ali Çehreli via Digitalmars-d-learn
This looks like a bug to me. The template constraints of the two overloads are pretty complicated. This case should match only one of them. On 08/15/2015 12:43 AM, TSalm wrote: > Don't understand why this doesn't work: it compiles fine and runs > perfectly if I change "char[]" by "string" You

Using replaceInPlace, string and char[]

2015-08-15 Thread TSalm via Digitalmars-d-learn
Hi, A newbie question : I wrote this simple code : import std.array; import std.stdio; void main() { char[] a = "mon texte 1".dup; char[] b = "abc".dup; size_t x = 4; size_t y = 9; replaceInPlace( a, x , y, b );