Hello Sergey,
foreach() is a runtime construct. It may be *interpreted* at
compile-time, but it's interpreted as if it were run time
nevertheless. It dynamically changes the value of 'member' variable.
OTOH a foreach on a tuple is a compile time construct, but it is a distinct
construct from
Wed, 21 Jan 2009 12:48:07 +0100, Trass3r wrote:
> 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, Cla
Wed, 21 Jan 2009 09:24:01 -0800, 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 opAssign (uint va
Wed, 21 Jan 2009 23:19:48 -0500, reimi gibbons wrote:
> 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 p
Hello tim,
On Mon, 26 Jan 2009 04:58:57 +1300, John Reimer
wrote:
Hello tim,
On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin
<2kor...@gmail.com> wrote:
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote:
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote:
On Mon, 26 Jan 2009 00:18:28
On Mon, 26 Jan 2009 04:58:57 +1300, John Reimer
wrote:
Hello tim,
On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote:
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote:
On Mon, 26 Jan 2009 00:18:28 +1300, Denis
Denis Koroskin wrote:
On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote:
class B : A,I
{
void foo() { A.foo(); }
}
void main()
{
}
It is too verbose and makes twice an overhead. I'd like to avoid this
solution.
Any reasonable compiler would inline the call to A.foo.
In fact, I belie
Hello Daniel,
[snip]
B inherits all the functions from A implicitly. You stil may
override any of the I interface functions if need be:
class B : A, I
{
override void foo() { ... }
// int bar() is inherited from A
}
Having B explicitly override all the base class virtual functions
and forward
Hello tim,
It not a bug though. It's all here
http://www.digitalmars.com/d/1.0/interface.html and it works like it
says. Is there a problem?
The only thing that might be close to a bug, I think, is the inability of
the "alias" to satisfy the interface contract reimplementation.
-JJR
Hello tim,
On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote:
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote:
On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin
<2kor...@gmail.com> wrote:
On Sun, 25 Jan 2009
Hello Daniel,
[snip]
B inherits all the functions from A implicitly. You stil may
override any of the I interface functions if need be:
class B : A, I
{
override void foo() { ... }
// int bar() is inherited from A
}
Having B explicitly override all the base class virtual functions
and forward
Daniel Keep wrote:
This might also be of interest, as it has an example of overriding
allocation/deallocation to use malloc:
http://digitalmars.com/d/1.0/memory.html#newdelete
Thanks! It seems that using freelists is preferable. Are there any
drawbacks ? F.I. How to implement a class using fre
It not a bug though. It's all here
http://www.digitalmars.com/d/1.0/interface.html and it works like it says.
Is there a problem?
[snip]
B inherits all the functions from A implicitly. You stil may
override any of the I interface functions if need be:
class B : A, I
{
override void foo() { ... }
// int bar() is inherited from A
}
Having B explicitly overr
This might also be of interest, as it has an example of overriding
allocation/deallocation to use malloc:
http://digitalmars.com/d/1.0/memory.html#newdelete
On Sun, 25 Jan 2009 17:06:50 +0300, Denis Koroskin <2kor...@gmail.com> wrote:
On Sun, 25 Jan 2009 15:20:19 +0300, Tim M wrote:
On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote:
On Mon, 26 Jan 2009 00:48:21 +13
BLS wrote:
> Hi,
>
> I wonder if this is doable in D ?
>
> class Cpp
> {
> public:
> void* operator new(size_t n);
> void* operator new(size_t n, void* p)
> { return p; }
>
> }
>
> Just guessing that operator new means this in D
> class D
> {
> new(uint n);
>
On Sun, 25 Jan 2009 15:20:19 +0300, Tim M wrote:
On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote:
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote:
On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin
<2kor...
Hi,
I wonder if this is doable in D ?
class Cpp
{
public:
void* operator new(size_t n);
void* operator new(size_t n, void* p)
{ return p; }
}
Just guessing that operator new means this in D
class D
{
new(uint n);
new(uint
On Mon, 26 Jan 2009 01:14:10 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote:
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote:
On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 08:38:18 +
On Sun, 25 Jan 2009 15:06:23 +0300, Tim M wrote:
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote:
On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote:
On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer
wrote:
On Mon, 26 Jan 2009 00:48:21 +1300, Tim M wrote:
On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote:
On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer
wrote:
Hello tim,
On Sun, 25 Jan 2009 16:43:55 +1300, Joh
On Mon, 26 Jan 2009 00:18:28 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote:
On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer
wrote:
Hello tim,
On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer
wrote:
With this code:
---
On Sun, 25 Jan 2009 08:38:18 +0300, Tim M wrote:
On Sun, 25 Jan 2009 17:56:03 +1300, John Reimer
wrote:
Hello tim,
On Sun, 25 Jan 2009 16:43:55 +1300, John Reimer
wrote:
With this code:
module test5;
interface I
{
void foo();
}
class A : I {
void f
24 matches
Mail list logo