Hi all.
I can't seem to get this to work properly. I'm trying to write a
copy-on-write proxy type. I'm using postblit and dtors along with the
usual ctors and opAssign to manage the refcount of the shared memory.
However, testing with dmd-2.026 (and a few previous versions a little
while ago),
CodexArcanum wrote:
> Hey all, I'm trying to rewrite a few .h files into D so I can call a C
> library. One snag I've hit is this guy:
>
> struct _tree_t {
> _tree_t* next;
> _tree_t* father;
> _tree_t* sons;
> }
>
> D won't do the nested struct thing, so I need to convert thi
Hey all, I'm trying to rewrite a few .h files into D so I can call a C library.
One snag I've hit is this guy:
struct _tree_t {
_tree_t* next;
_tree_t* father;
_tree_t* sons;
}
D won't do the nested struct thing, so I need to convert this into something D
will like, but
I find my self in need of some thread safe, lock free code to update a value
by way of a self referential expression
x = min(x,y);
Being the abstraction addict I am, I went for the general solution and came
up with this:
void AtomicEvalAssign(T)(ref T to, lazy T from)
{
T old;
On Tue, Mar 17, 2009 at 11:28 AM, Jarrett Billingsley
wrote:
> On Tue, Mar 17, 2009 at 10:54 AM, Paolo Invernizzi
> wrote:
>> Hi all,
>> Someone can point me to a way of doing something like this with DMD 2.026:
>>
>> class A {
>> invariant(int) rev = std.conv.to!(int)("$Rev: 182 $");
>> }
>>
On Tue, Mar 17, 2009 at 11:32 AM, Jarrett Billingsley
wrote:
Sigh, I'll get it eventually.
template Atoi(string s)
{
static if(s.length == 1)
enum int Atoi = s[$ - 1] - '0';
else
enum int Atoi = 10 * Atoi!(s[0 .. $ - 1]) + (s[$ - 1] - '0');
}
On Tue, Mar 17, 2009 at 10:54 AM, Paolo Invernizzi
wrote:
> Hi all,
> Someone can point me to a way of doing something like this with DMD 2.026:
>
> class A {
> invariant(int) rev = std.conv.to!(int)("$Rev: 182 $");
> }
>
> I've messed up with metastrings and std.conv, but I cannot find a worki
Hi all,
Someone can point me to a way of doing something like this with DMD 2.026:
class A {
invariant(int) rev = std.conv.to!(int)("$Rev: 182 $");
}
I've messed up with metastrings and std.conv, but I cannot find a working way.
Cheers, Paolo