reimi gibbons wrote:
> Hi all,
>
> I'm currently developing a software with D and Tango. I don't have much
> knowledge on DLL, but i do know when linking to static lib you need a .h
> header file, but do i need .h for linking with DLL as well?
>
> also can anybody please provide a quick and s
Christopher Wright wrote:
Check this out!
class Foo { int someField; }
pragma (msg, Foo.tupleof[0].stringof); // int
pragma (msg, Foo.tupleof[0].mangleof); // someField
Why is this? It's counterintuitive.
Okay, no, this example is a shorter version of something else that
exemplified this beha
Hi all,
I'm currently developing a software with D and Tango. I don't have much
knowledge on DLL, but i do know when linking to static lib you need a .h header
file, but do i need .h for linking with DLL as well?
also can anybody please provide a quick and small example to link with DLL.
*im t
Christopher Wright wrote:
Christopher Wright wrote:
Check this out!
class Foo { int someField; }
pragma (msg, Foo.tupleof[0].stringof); // int
pragma (msg, Foo.tupleof[0].mangleof); // someField
Why is this? It's counterintuitive.
Oops, no. mangleof does report the mangled name of the input s
Christopher Wright wrote:
Check this out!
class Foo { int someField; }
pragma (msg, Foo.tupleof[0].stringof); // int
pragma (msg, Foo.tupleof[0].mangleof); // someField
Why is this? It's counterintuitive.
Oops, no. mangleof does report the mangled name of the input string.
It's just that mang
Check this out!
class Foo { int someField; }
pragma (msg, Foo.tupleof[0].stringof); // int
pragma (msg, Foo.tupleof[0].mangleof); // someField
Why is this? It's counterintuitive.
On Wed, 21 Jan 2009 20:26:08 +0300, Charles Hixson
wrote:
P.S.: This is Digital Mars D Compiler v2.023 running on Linux
Charles Hixson wrote:
In this test I'm trying to emulate how I want a typedef to act, but I
run into a problem:
import std.stdio;
struct BlockNum
{ uint value;
Reply to Qian,
Frits van Bommel wrote:
Qian Xu wrote:
Hi All,
can D check, whether a class A an Interface B supports?
like:
if (supports(class_A, intf_B))
if (is(class_A : intf_B))
tests if 'class_A' is implicitly convertible to 'intf_B'. If the
first
is a class and the second an interf
P.S.: This is Digital Mars D Compiler v2.023 running on Linux
Charles Hixson wrote:
In this test I'm trying to emulate how I want a typedef to act, but I
run into a problem:
import std.stdio;
struct BlockNum
{ uint value;
uint opCast() { return value; }
void opAssig
In this test I'm trying to emulate how I want a typedef to act, but I
run into a problem:
import std.stdio;
struct BlockNum
{ uint value;
uint opCast() { return value; }
void opAssign (uint val) { value = val; }
uint opCall() { return value; }
}
voi
Qian Xu schrieb:
Thanks. Could you tell me, how to make a function for this? I do not know
how to pass an Interface as parameter.
like
bool supports(T)(T obj, interface_type t)
{
return (is(obj : t));
}
Guess something like
bool supports(T, I) (T obj)
{
return (is(obj : I));
Frits van Bommel wrote:
> Qian Xu wrote:
>> Hi All,
>>
>> can D check, whether a class A an Interface B supports?
>>
>> like:
>>
>> if (supports(class_A, intf_B))
>
> if (is(class_A : intf_B))
> tests if 'class_A' is implicitly convertible to 'intf_B'. If the first
> is a class and the
On Wed, Jan 21, 2009 at 10:30 AM, Qian Xu wrote:
> Hi All,
>
> can D check, whether a class A an Interface B supports?
>
> like:
>
> if (supports(class_A, intf_B))
> {
> cast(intf_B) (class_A).hello();
> }
At compile time, like Frits said, you can use is(class_A : intf_B).
At runtime, you
Qian Xu wrote:
Hi All,
can D check, whether a class A an Interface B supports?
like:
if (supports(class_A, intf_B))
if (is(class_A : intf_B))
tests if 'class_A' is implicitly convertible to 'intf_B'. If the first
is a class and the second an interface, that's equivalent to the class
Qian Xu wrote:
> Hi All,
>
> can D check, whether a class A an Interface B supports?
>
> like:
>
> if (supports(class_A, intf_B))
> {
> cast(intf_B) (class_A).hello();
> }
>
> --Qian
what I have found is:
if (is(class_A == intf_B))
{
cast(intf_B) (class_A).hello();
}
Is
Hi All,
can D check, whether a class A an Interface B supports?
like:
if (supports(class_A, intf_B))
{
cast(intf_B) (class_A).hello();
}
--Qian
Christopher Wright schrieb:
On the other hand, you can get the non-final, non-private methods of a
class with something like:
foreach (member; __traits (allMembers, Class))
{
foreach (overload; __traits (getVirtualFunctions, Class, member))
{
// do stuff
}
}
Naturally, __tra
17 matches
Mail list logo