Hi,
does anyone know how I can cast a string to an enum which also
contains strings? For example:
enum MyENUM : string {
x = "123"
y = "456"
z = "789"
}
...
string myString = X;
to!(MyENUM)(myString); // Error: cannot implicitly convert
expression (_adDupT((& D12TypeInfo_Aya6__initZ),s)) of
Hey guys,
I've the following problem... when I write a simple class, for
example:
...
module myclasses.exampleClass;
class exampleClass {
void writeHelloWorld() {
writeln("Hello World");
}
And import myclasses.exampleClass in the following:
...
module mainfile;
import myclasses.exampleClass;
rdmd has some problems with my lib-files. Instead of rdmd I just tried
xfbuild and it works great on windows, but as I can see there is no
linux 32 bit version which I would like to use?!
I just compiled xfbuild on 32bit ubuntu, but when I try to compile, I
get the following error:
Build failed: /usr/include/d/dmd/druntime/import/core/stdc/errno.o:
Invalid cross-device link.
Does anyone know how to solve this problem?
I solved the problem by copying the source files from my shared vm-
folder to my desktop in my vm.
Is it possible to create a template which only accepts functions or
delegates like this example:
class Example(T : void function()) { // or ..(T : void delegate())..
T callback;
}
Where T is a function or a delegate...
Thanks for every suggestion!
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> On Wed, 09 Feb 2011 14:35:42 -0500, useo wrote:
> > Is it possible to create a template which only accepts functions
or
> > delegates like this example:
> >
> > class Example(T : void function
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> On Wed, 09 Feb 2011 14:35:42 -0500, useo wrote:
> > Is it possible to create a template which only accepts functions
or
> > delegates like this example:
> >
> > class Example(T : void function
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> On Wed, 09 Feb 2011 14:59:33 -0500, useo wrote:
> > == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> >> On Wed, 09 Feb 2011 14:35:42 -0500, useo wrote:
> >> > Is it
I just have a problem with my variables.
For example... my class/template just looks like:
class Example(T) if (is(T == delegate) || is(T == function))
{
T callback;
void setCallback(T cb) {
callback = cb;
}
}
This means that I need variables like Example!(void function())
myVar
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> On Wed, 09 Feb 2011 16:14:04 -0500, useo wrote:
> > I just have a problem with my variables.
> >
> > For example... my class/template just looks like:
> >
> > class Example(T) if
== Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel
> useo:
> > I just have a problem with my variables.
> >
> > For example... my class/template just looks like:
> >
> > class Example(T) if (is(T == delegate) || is(T == function))
> > {
>
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> On Wed, 09 Feb 2011 16:41:25 -0500, useo wrote:
> > == Auszug aus bearophile (bearophileh...@lycos.com)'s Artikel
> >> useo:
> >> > I just have a problem with my variables.
> >&g
I implemented all I wanted and it works perfectly ;).
But I'm using the "if (is(T == delegate) || is(T == function))"-
statement in another class/template.
class Example(T) if (is(T == delegate) || is(T == function)) {
...
}
Now, when I declare Example!(void function()) myVar; I always get:
Err
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> On Thu, 10 Feb 2011 09:09:03 -0500, useo wrote:
> > I implemented all I wanted and it works perfectly ;).
> >
> > But I'm using the "if (is(T == delegate) || is(T == function))"
== Auszug aus useo (u...@start.bg)'s Artikel
> == Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> > On Thu, 10 Feb 2011 09:09:03 -0500, useo wrote:
> > > I implemented all I wanted and it works perfectly ;).
> > >
> > > Bu
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
> On Thu, 10 Feb 2011 09:48:14 -0500, useo wrote:
> > I created a complete, new file with the following code:
> >
> > module example;
> >
> > void main(string[] args) {
> > Example!
Hey guys,
I've a small problem implementing multiple opCall()-methods. At first, I've the
following interface:
interface Invoker {
void opCall(uint i);
}
... and an abstract class which inherits from the Invoker-interface like the
following:
abstract class AbstractInvoker : Invoker {
priva
== Auszug aus Mafi (m...@example.org)'s Artikel
> Am 21.02.2011 11:18, schrieb useo:
> > Hey guys,
> >
> > I've a small problem implementing multiple opCall()-methods. At
first, I've the following interface:
> >
> > interface Invoker {
> >
Hey guys,
is it possible to declare a enum where all entries are instances of a
class (or struct), like the following:
class a {
...
public this(uint i) {
...
}
...
}
enum myEnum : a {
entry1 = new a(0);
entry2 = new a(1);
}
... or does enumerations only support constant-
== Auszug aus Jonathan M Davis (jmdavisp...@gmx.com)'s Artikel
> On Thursday, March 10, 2011 11:28:04 bearophile wrote:
> > useo:
> > > is it possible to declare a enum where all entries are
instances of a
> >
> > > class (or struct), like the following:
&
Hey guys,
is there any chance to create an abstract constructor like:
abstract class ABC {
abstract this();
}
DMD always says "...this non-virtual functions cannot be abstract" -
when I use an interface like:
interface ABC {
this();
}
I get a similar error: "...constructors, destruct
Hi,
I'm trying to clear big associative arrays, but I always get an
object error - what I currently doing is:
private string[uint] myAA;
void main() {
fill(myAA);
myAA.clear();
fill(myAA); // object.Error: Access Violation
}
void fill(string[uint] aa) {
for (uint i = 0; i < 10_000_
== Auszug aus David Nadlinger (s...@klickverbot.at)'s Artikel
> I realize that this might sound strange, but try setting myAA to
null
> after clear(), this should fix the crash.
> David
> On 5/31/11 4:00 PM, useo wrote:
> > Hi,
> >
> > I'm trying to clear
> useo:
> > Is there anything I forgot to consider?
> If the key and values are primitive values or structs of primitive
values then you may try another AA implementation that doesn't use
the GC.
> Bye,
> bearophile
I tried some different implementations and I also reduce
25 matches
Mail list logo