On Friday, 8 July 2016 at 05:53:21 UTC, Nicholas Wilson wrote:
So as part of my effort to get D running on GPUs I need to make
a "second class" pointer type that I can alter in the backend
of LDC to the correct address space. to that end I have made
the following
module dcompute.types.pointer
So as part of my effort to get D running on GPUs I need to make a
"second class" pointer type that I can alter in the backend of
LDC to the correct address space. to that end I have made the
following
module dcompute.types.pointer;
enum Private = 0;
enum Global = 1;
enum Shared = 2;
enum Cons
On 07/07/16 15:19, Steven Schveighoffer wrote:
Is this what you are looking for? I don't think you can do this in
D-land, but you can probably hook it from C++:
http://en.cppreference.com/w/cpp/language/typeid
Yeah, that works, thanks.
--
/Jacob Carlborg
On Thursday, July 07, 2016 10:33:39 Basile B. via Digitalmars-d-learn wrote:
> this compiles without error:
>
>
> struct Foo
> {
> int i;
> void bar()
> {
> void foo() const
> {
> i = 1;
> }
> foo;
> }
> }
>
> In this case "const"
On Thursday, July 07, 2016 05:13:56 Ali Çehreli via Digitalmars-d-learn wrote:
> On 07/07/2016 02:57 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
> > then you should probably use a factory function. e.g.
>
> And name that function "opCall" and you have a non-constructor that
> supports the
On Thursday, 7 July 2016 at 03:52:40 UTC, Jonathan M Davis wrote:
However, it looks like you can combine those two types of
variadic functions to get more or less what you want (albeit
more verbosely). e.g.
template isInt(T) { enum isInt = is(std.traits.Unqual!T ==
int); }
void test(Args..
On Wednesday, 6 July 2016 at 19:50:11 UTC, pineapple wrote:
I'd like to do something like this but it doesn't seem to be
legal -
void test(int[] ints...) if(ints.length){
// stuff
}
Not being able to specify this interferes with how I'd like to
define my method overloads. What
On 7/7/16 9:02 AM, Jacob Carlborg wrote:
On 07/07/16 12:31, Namespace wrote:
Maybe with a template?
void class_name(T)(T obj) if (is(T == class)) {
writeln(T.stringof);
}
I want the string of the runtime type, the most derived type.
Is this what you are looking for? I don't
On 07/07/16 12:31, Namespace wrote:
Maybe with a template?
void class_name(T)(T obj) if (is(T == class)) {
writeln(T.stringof);
}
I want the string of the runtime type, the most derived type.
--
/Jacob Carlborg
On Thursday, 7 July 2016 at 10:48:56 UTC, Lodovico Giaretta wrote:
On Thursday, 7 July 2016 at 10:45:12 UTC, Gary Willoughby wrote:
On Thursday, 7 July 2016 at 08:21:53 UTC, Lodovico Giaretta
wrote:
Are you sure that this works in both big-endian and
little-endian systems?
It shouldn't matter
On Thursday, 7 July 2016 at 12:24:08 UTC, Edwin van Leeuwen wrote:
On Thursday, 7 July 2016 at 10:33:39 UTC, Basile B. wrote:
this compiles without error:
struct Foo
{
int i;
void bar()
{
void foo() const
{
i = 1;
}
foo;
}
}
In this
On Thursday, 7 July 2016 at 10:33:39 UTC, Basile B. wrote:
this compiles without error:
struct Foo
{
int i;
void bar()
{
void foo() const
{
i = 1;
}
foo;
}
}
In this case "const" seems to be a noop. Do you think it's a
bug ? Shouldn'
On 07/07/2016 02:57 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
> then you should probably use a factory function. e.g.
And name that function "opCall" and you have a non-constructor that
supports the default-constructor syntax. :p
static B opCall()
{
// ...
}
On 07/07/2016 12:33 PM, Basile B. wrote:
Do you think it's a bug ?
Yes.
On Thursday, 7 July 2016 at 10:45:12 UTC, Gary Willoughby wrote:
On Thursday, 7 July 2016 at 08:21:53 UTC, Lodovico Giaretta
wrote:
Are you sure that this works in both big-endian and
little-endian systems?
It shouldn't matter. You're just interested in the high and low
4 byte chunks (which a
On Thursday, 7 July 2016 at 08:21:53 UTC, Lodovico Giaretta wrote:
Are you sure that this works in both big-endian and
little-endian systems?
It shouldn't matter. You're just interested in the high and low 4
byte chunks (which are to be interpreted as an int) which will
return in the relevant
this compiles without error:
struct Foo
{
int i;
void bar()
{
void foo() const
{
i = 1;
}
foo;
}
}
In this case "const" seems to be a noop. Do you think it's a bug
? Shouldn't "const" be applied, despite of foo() inaccessibility ?
On Thursday, 7 July 2016 at 09:59:23 UTC, Jacob Carlborg wrote:
Is it possible to get the name of a C++ class, "extern(C++)
class Foo {}", at runtime just as it's possible to do the same
for a D class, like "object.classinfo.name"?
Maybe with a template?
void class_name(T)(T obj) if (is(
Is it possible to get the name of a C++ class, "extern(C++) class Foo
{}", at runtime just as it's possible to do the same for a D class, like
"object.classinfo.name"?
--
/Jacob Carlborg
On Thursday, 7 July 2016 at 09:46:25 UTC, Lodovico Giaretta wrote:
On Thursday, 7 July 2016 at 09:40:57 UTC, Lodovico Giaretta
wrote:
Initially it looks very surprising, but then if you add
`writeln(B.init.col[]);` you can easily find out what's going
on.
And I'm quite sure it's expected beha
On Thursday, July 07, 2016 09:33:38 Arafel via Digitalmars-d-learn wrote:
> public struct B {
> public auto col = new RedBlackTree!(A,"a.i < b.i");
> }
If you default-initialize a member of a struct, then every instance of that
struct gets that exact same value. In the case of a value type, this
On Thursday, 7 July 2016 at 09:40:57 UTC, Lodovico Giaretta wrote:
Initially it looks very surprising, but then if you add
`writeln(B.init.col[]);` you can easily find out what's going
on.
And I'm quite sure it's expected behaviour.
An RBTree is just a pointer to the memory containing the ac
On Thursday, 7 July 2016 at 09:33:38 UTC, Arafel wrote:
Hi!
I am seeing what it seems to me a very strange behavior with
rbtrees:
---
import std.stdio;
import std.container.rbtree;
public struct A {
public int i;
public this (int _i) {
this.i = _i;
Hi!
I am seeing what it seems to me a very strange behavior with
rbtrees:
---
import std.stdio;
import std.container.rbtree;
public struct A {
public int i;
public this (int _i) {
this.i = _i;
}
}
public struct B {
public auto col = ne
On Thursday, 7 July 2016 at 08:14:40 UTC, Gary Willoughby wrote:
What about something like:
import std.stdio;
union Value
{
ulong full;
static struct Bits
{
uint high;
uint low;
}
Bits bits;
alias bits this;
this(ulong value)
{
this.fu
On Wednesday, 6 July 2016 at 21:44:37 UTC, BitGuy wrote:
I'm trying to implement a feistel cipher that'll give the same
results regardless of the endianness of the machine it runs on.
To make the cipher I need to split a 64bit value into two 32bit
values, mess with them, and then put them back
On Tuesday, 5 July 2016 at 20:38:53 UTC, Eugene Wissner wrote:
On Tuesday, 5 July 2016 at 08:24:43 UTC, O/N/S wrote:
Hi ("Grüss Gott")
I like the asynchronous events in Javascript.
Is something similar possible in D?
Found Dragos Carp's asynchronous library
(https://github.com/dcarp/asynchron
27 matches
Mail list logo