> 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
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
iating
Don't understand why this doesn't work: it compiles fine and runs
perfectly if I change "char[]" by "string" ... 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
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 !
Hello,
What is the C equivalent for the D "float" type ?
Thanks in advance,
TSalm
Le Wed, 03 Jun 2009 02:40:11 +0200, Diwaker Gupta
a écrit:
I've just started to play around with D, and I'm hoping someone can
clarify this. I wrote a very simple program that just allocates lots of
objects, in order to benchmark the garbage collector in D. For
comparison, I wrote the pr
Le Wed, 06 May 2009 10:33:33 +0200, TSalm a écrit:
Le Wed, 06 May 2009 10:17:47 +0200, gabrielsylar a
écrit:
can anybody please tell me how to properly convert from void* to void[]
as the code below?
void[] get_bytes(int n) { return sqlite3_column_blob(stmt, n); }
Something like could
Le Wed, 06 May 2009 10:17:47 +0200, gabrielsylar a
écrit:
can anybody please tell me how to properly convert from void* to void[]
as the code below?
void[] get_bytes(int n) { return sqlite3_column_blob(stmt, n); }
Something like could works :
return *( cast(void[]*) sqlite3_column_blob(s
Le Sat, 28 Mar 2009 17:52:54 +0100, TSalm a écrit:
Le Sat, 28 Mar 2009 12:21:52 +0100, Jarrett Billingsley
a écrit:
On Sat, Mar 28, 2009 at 6:12 AM, TSalm wrote:
Hello,
Is there a way to specifie a constant argument ( I would say an
argument for
which his value is evaluate at
Le Sat, 28 Mar 2009 12:21:52 +0100, Jarrett Billingsley
a écrit:
On Sat, Mar 28, 2009 at 6:12 AM, TSalm 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 )
For example, something like this
)
Stdout("Yes").newline;
else
Stdout("No").newline;
}
void main()
{
func( true );
func( false );
}
/* END CODE - */
Thanks in advance,
TSalm
Le Sun, 01 Mar 2009 03:07:16 +0100, Christopher Wright
a écrit:
TSalm wrote:
Does something have an idea on how to do something like this ?
You don't. Templates cannot participate in polymorphism. I've dealt with
this in the past and ended up making another class with
something have an idea on how to do something like this ?
Thanks in advance,
Tsalm
Le Wed, 25 Feb 2009 01:03:32 +0100, Daniel Keep
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 cases tryin
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 wil
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 you
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.com&group=digitalmars.D.learn&artnum=15600
Do you think that what I done
se
{
p = &val ;
}
return p ;
}
/***
* Convert a void* to his value
* Params:
* ptr =
* Returns:
*/
T fromPtr(T)(void* ptr)
{
return *(cast(T*)ptr) ;
}
/* --- END CODE */
Thanks in advance,
TSalm
Le Sat, 21 Feb 2009 04:00:42 +0100, Daniel Keep
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
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 ?
w A ;
a.func = 10 ;
Stdout(a.func).newline ;
}
/* --- END CODE */
Thanks in advance for your help,
TSalm
.func).newline ;
}
/* --- END CODE */
Thanks in advance for your help,
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
Le Tue, 17 Feb 2009 23:03:04 +0100, BCS 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 if it
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 ?
ating
It seems it's the first compare function (without array in parameter)
which is hook.
How can I declare this compare function to use specific code to compare
arrays ?
Thanks in advance,
TSalm
Excellent explication !
Thank you Frits
Le Sat, 14 Feb 2009 17:58:35 +0100, Frits van Bommel
a écrit:
TSalm wrote:
Hello,
In the code below, why the first Stdout throws a Exception when the
second doesn't ?
/* CODE */
import tango.io.Stdout;
struct Void
s works good
}
/* -- END CODE -- */
Thanks in advance for your help,
TSalm
Le Wed, 10 Dec 2008 03:16:49 +0100, Denis Koroskin <[EMAIL PROTECTED]> a
écrit:
On Wed, 10 Dec 2008 03:24:48 +0300, Jarrett Billingsley
<[EMAIL PROTECTED]> wrote:
On Tue, Dec 9, 2008 at 7:00 PM, BCS <[EMAIL PROTECTED]> wrote:
class C
{
final void add(T...)(T t)
{
foreach(int i,_
Hello,
How to implement an object that can do this :
myClass.add(something)(otherthings)(thisToo);
Is it possible ?
TIA,
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()
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
() { }
}
void main()
{
auto b = new B;
b.a.doIt();
}
// --END CODE--
Is this a bug or have I do something wrong ?
Thanks in advance for your help,
TSalm
Le Fri, 21 Nov 2008 00:34:03 +0100, Denis Koroskin <[EMAIL PROTECTED]> a
écrit:
union ColorProxy {
uint color;
struct {
ubyte red;
ubyte green;
ubyte blue;
ubyte alpha;
}
}
ColorProxy proxy;
proxy.color = ColorValues.Aqua;
return Color(proxy.red, proxy.gre
o "const Color colorPanMonth =
convertToColor(cast(uint)ColorValues.MidnightBlue);"
Thanks in advance for your help,
TSalm
35 matches
Mail list logo