... or alternatively:
// Simple integers can be compile-time literals (i.e. C's #define)
enum ADDRESS_BUS_SIZE = 20; // 2^20 address bus
// In D it is more ideomatic to put the array length first.
// For example this wouldn't work: byte x, *y, memory[1 << ADDRESS_BUS_SIZE];
byte[1 << ADDRESS_BUS_S
Am Sun, 30 Jun 2013 07:07:23 -0400
schrieb "Tyro[17]" :
> What is the equivalent of memcpy
>
> module memcopy;
>
> immutable ADDRESS_BUS_SIZE = 20; // 2^20 address bus
> byte memory[1 << ADDRESS_BUS_SIZE];
>
> void main()
> {
> ushort val = 12345;
>
> for (int i = 0x12340; i < 0x12
Am 30.06.2013 22:20, schrieb shuji:
> On Sunday, 30 June 2013 at 20:04:12 UTC, Anthony Goins wrote:
>> On Sunday, 30 June 2013 at 19:03:13 UTC, shuji wrote:
>>> this code is in a .cpp file
>>> //funcs.lib
>>> //windows includes...
>>> HWND hwnd;
>>> int setHWND(HWND extHwnd){
>>> hwnd = extHwnd
On Sunday, 30 June 2013 at 20:04:12 UTC, Anthony Goins wrote:
On Sunday, 30 June 2013 at 19:03:13 UTC, shuji wrote:
this code is in a .cpp file
//funcs.lib
//windows includes...
HWND hwnd;
int setHWND(HWND extHwnd){
hwnd = extHwnd;
return 0;
}
So im trying to import from D like
On Sunday, 30 June 2013 at 19:03:13 UTC, shuji wrote:
this code is in a .cpp file
//funcs.lib
//windows includes...
HWND hwnd;
int setHWND(HWND extHwnd){
hwnd = extHwnd;
return 0;
}
So im trying to import from D like this. I dont think I can
implement this line in C++
extern (C
this code is in a .cpp file
//funcs.lib
//windows includes...
HWND hwnd;
int setHWND(HWND extHwnd){
hwnd = extHwnd;
return 0;
}
So im trying to import from D like this. I dont think I can
implement this line in C++
extern (C++) {}
On Sun, 30 Jun 2013 20:24:17 +0200, shuji wrote:
int setHWND(HWND extHwnd){
hwnd = extHwnd;
return 0;
}
And:
extern (C++) {
int setHWND(HWND hwnd);
}
See how these are different? One of them is an extern (C++) function, the
other is a D function.
In other word
Can someone help me with this:
I have a library which I try to import from D
//funcs.lib
//windows includes...
HWND hwnd;
int setHWND(HWND extHwnd){
hwnd = extHwnd;
return 0;
}
//main.d
pragma(lib, "gdi32.lib");
import core.runtime;
import core.sys.windows.windows;
extern (C++) {
Artur Skawina:
Error reporting for optional templated methods that exist, but
fail
to instantiate, can be very misleading; calling such methods
explicitly
sometimes helps to identify the problem.
http://d.puremagic.com/issues/show_bug.cgi?id=10511
Bye,
bearophile
On Sun, 30 Jun 2013 07:40:31 -0400, monarch_dodra
wrote:
On Sunday, 30 June 2013 at 11:07:24 UTC, Tyro[17] wrote:
What is the equivalent of memcpy
module memcopy;
immutable ADDRESS_BUS_SIZE = 20; // 2^20 address bus
byte memory[1 << ADDRESS_BUS_SIZE];
void main()
{
ushort val = 12
> Try removing the 'const' - static methods have no 'this'.
>
> Error reporting for optional templated methods that exist, but fail
> to instantiate, can be very misleading; calling such methods explicitly
> sometimes helps to identify the problem.
>
> artur
>
Oh wow, so easy ... Thanks I tott
On 06/30/13 12:36, David wrote:
> struct Bla {
> static @property
> Bla opDispatch(string s)() const {
> pragma(msg, s);
> return Bla();
> }
> }
>
> void main() {
> Bla.abc;
> }
>
> ---
>
> abc
> /d675/f256.d(10): Error: no property
On Sunday, 30 June 2013 at 11:47:49 UTC, David wrote:
Doing it this way has the advantage of being CTFE-able, and
(potentially) faster, as everything I ever read about D's
memcpy is that
it is slow.
On Windows? Doesn't memcpy use libc memcpy on Linux?
I honestly have no idea, I'm just repea
30-Jun-2013 15:47, David пишет:
Doing it this way has the advantage of being CTFE-able, and
(potentially) faster, as everything I ever read about D's memcpy is that
it is slow.
On Windows? Doesn't memcpy use libc memcpy on Linux?
Yup on Linux is pretty darn fast just as is with C/C++.
It's th
> Doing it this way has the advantage of being CTFE-able, and
> (potentially) faster, as everything I ever read about D's memcpy is that
> it is slow.
On Windows? Doesn't memcpy use libc memcpy on Linux?
On Sunday, 30 June 2013 at 11:07:24 UTC, Tyro[17] wrote:
What is the equivalent of memcpy
module memcopy;
immutable ADDRESS_BUS_SIZE = 20; // 2^20 address bus
byte memory[1 << ADDRESS_BUS_SIZE];
void main()
{
ushort val = 12345;
for (int i = 0x12340; i < 0x1234A; i+= 2) {
What is the equivalent of memcpy
module memcopy;
immutable ADDRESS_BUS_SIZE = 20; // 2^20 address bus
byte memory[1 << ADDRESS_BUS_SIZE];
void main()
{
ushort val = 12345;
for (int i = 0x12340; i < 0x1234A; i+= 2) {
memcpy (&memory[i], &val, sizeof val); // D wa
On Sunday, 30 June 2013 at 08:18:39 UTC, Johannes Pfau wrote:
Am Sat, 29 Jun 2013 17:38:38 +0200
schrieb "monarch_dodra" :
On Saturday, 29 June 2013 at 08:01:17 UTC, Johannes Pfau wrote:
> Shouldn't doing anything value-related on
> an empty struct be invalid anyway?
Why ?
The fact that the s
struct Bla {
static @property
Bla opDispatch(string s)() const {
pragma(msg, s);
return Bla();
}
}
void main() {
Bla.abc;
}
---
abc
/d675/f256.d(10): Error: no property 'abc' for type 'Bla'
/d675/f256.d(10): Error: Bla i
You must pass a shared object:
Thanks!
Am Sat, 29 Jun 2013 17:38:38 +0200
schrieb "monarch_dodra" :
> On Saturday, 29 June 2013 at 08:01:17 UTC, Johannes Pfau wrote:
> > Shouldn't doing anything value-related on
> > an empty struct be invalid anyway?
>
> Why ?
>
> The fact that the struct has no members is an implementation
> detail
21 matches
Mail list logo