Compilation error when using a extern function ?

2008-11-20 Thread tsalm
colorPanMonth = convertToColor(cast(uint)ColorValues.MidnightBlue); Thanks in advance for your help, TSalm

Re: Internal delegate and Stack Overflow

2008-11-28 Thread tsalm
Le Sat, 29 Nov 2008 01:08:28 +0100, BCS [EMAIL PROTECTED] a écrit: Reply to TSalm, Hello, I would do something like this, but this return me an execution error : object.Exception: Stack Overflow // CODE class A { void delegate() dg; void doIt() { dg(); } } class B

Re: Internal delegate and Stack Overflow

2008-11-29 Thread tsalm
Le Sat, 29 Nov 2008 01:49:20 +0100, BCS [EMAIL PROTECTED] a écrit: struct C(R, A...) { A args; R function(A) dg; static R delegate() opCall(R function(A) dg, A a) { C!(R, A) ret; ret.dg=dg; foreach(int i,_;A) ret.args[i] = a[i]; return ret.fn; } R fn() {

Re: return *(cast(T*)vPtr) and OutOfMemoryException

2009-02-14 Thread TSalm
Excellent explication ! Thank you Frits Le Sat, 14 Feb 2009 17:58:35 +0100, Frits van Bommel fvbom...@remwovexcapss.nl a écrit: TSalm wrote: Hello, In the code below, why the first Stdout throws a Exception when the second doesn't ? /* CODE */ import

Re: Template function : use the array's one !

2009-02-17 Thread TSalm
take a look at static if and is http://www.digitalmars.com/d/1.0/version.html#staticif http://www.digitalmars.com/d/1.0/expression.html#IsExpression Thanks for this links. But I don't see anything about how to test if it's an array or not... Is it not possible ?

Re: Template function : use the array's one !

2009-02-17 Thread TSalm
Le Tue, 17 Feb 2009 23:03:04 +0100, BCS n...@anon.com a écrit: Hello TSalm, take a look at static if and is http://www.digitalmars.com/d/1.0/version.html#staticif http://www.digitalmars.com/d/1.0/expression.html#IsExpression Thanks for this links. But I don't see anything about how to test

Re: Template function : use the array's one !

2009-02-18 Thread TSalm
TSalm Wrote: int compare(T:T[])(T[] o1,T[] o2) Change this line to: int compare(T:T[])(T o1, T o2) You are right. But despite this function, at compile time, an error is return : .\src\tsalm\tools\Generic.d(20): Error: cannot implicitly convert expression (o2 - o1) of type int[3u

Symbol undefined on interface with public getter and package setter

2009-02-20 Thread TSalm
).newline ; } /* --- END CODE */ Thanks in advance for your help, TSalm

Re: Symbol undefined on interface with public getter and package setter

2009-02-20 Thread TSalm
= 10 ; Stdout(a.func).newline ; } /* --- END CODE */ Thanks in advance for your help, TSalm

Re: Symbol undefined on interface with public getter and package setter

2009-02-20 Thread TSalm
I'm not sure but I think package is not virtual. :-( So there's really no way to have a method declared package in an interface ?

Re: Symbol undefined on interface with public getter and package setter

2009-02-21 Thread TSalm
Le Sat, 21 Feb 2009 04:00:42 +0100, Daniel Keep daniel.keep.li...@gmail.com a écrit: TSalm wrote: I'm not sure but I think package is not virtual. :-( So there's really no way to have a method declared package in an interface ? You also can't have a private function in an interface

Generic functions to convert to void* and from void*

2009-02-22 Thread TSalm
a void* to his value * Params: * ptr = * Returns: */ T fromPtr(T)(void* ptr) { return *(cast(T*)ptr) ; } /* --- END CODE */ Thanks in advance, TSalm

Re: Generic functions to convert to void* and from void*

2009-02-22 Thread TSalm
I'm trying to build function which have the hability to convert a type to void* and from void*. I must use ref in the toPtr function because of this : http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.comgroup=digitalmars.D.learnartnum=15600 Do you think that what I done is

Re: Generic functions to convert to void* and from void*

2009-02-23 Thread TSalm
I'm trying to build function which have the hability to convert a type to void* and from void*. First of all, I have to ask: have you looked at std.variant / tango.core.Variant? Yes, but it seems that Variant class uses more memory than void* . [...] I get the distinct impression that

Re: Generic functions to convert to void* and from void*

2009-02-24 Thread TSalm
TSalm wrote: I'm trying to build function which have the hability to convert a type to void* and from void*. First of all, I have to ask: have you looked at std.variant / tango.core.Variant? Yes, but it seems that Variant class uses more memory than void* . The Phobos Variant will use

Re: Generic functions to convert to void* and from void*

2009-02-25 Thread TSalm
Le Wed, 25 Feb 2009 01:03:32 +0100, Daniel Keep daniel.keep.li...@gmail.com a écrit: TSalm wrote: In my case, there's also no possibility to get the wrong type, because it is managed by the type of the ColumnMem. You still have to get the code right. There's a surprising number of corner

Re: const argument

2009-03-28 Thread TSalm
Le Sat, 28 Mar 2009 12:21:52 +0100, Jarrett Billingsley jarrett.billings...@gmail.com a écrit: On Sat, Mar 28, 2009 at 6:12 AM, TSalm ts...@free.fr wrote: Hello, Is there a way to specifie a constant argument ( I would say an argument for which his value is evaluate at compile time

C equivalent for the D float type

2009-09-18 Thread TSalm
Hello, What is the C equivalent for the D float type ? Thanks in advance, TSalm

Re: C equivalent for the D float type

2009-09-18 Thread TSalm
What is the C equivalent for the D float type ? float and double is double. in c, real support is compiler dependant, it may or may not be available. Thanks !

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

Using replaceInPlace, string and char[]

2015-08-15 Thread TSalm via Digitalmars-d-learn
... don't understand why since the documentation says : String literals are immutable (read only). How this function can change a type that is immutable ? Thanks for your help. TSalm

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 :