I guess you have to live using NSObject for now, until I fixed
that. But in practice NSObject is the only root class. So far
I've seen one other class, NSProxy, that doesn't inherit from
NSObject.
Ok, I had a quick look at this issue. It is implemented but
it's not working. There is a test
gchunt is a tool is to help D developers identify and keep in check the
usage of GC in their projects.
So far it just postprocesses D compiler's -vgc output into a nice Wiki
table. Results looks like this (Phobos):
http://wiki.dlang.org/Stuff_in_Phobos_That_Generates_Garbage#Labeled_data
Wait !
x.value -= 100; would call the invariant ?
Alias this only rewrites your expression:
x -= 100; becomes x.value -= 100;
No method is called. Then there is no reason (is there ?) to call
the invariant.
If you would create getter/setter properties ...
On Tuesday, 11 November 2014 at 08:18:36 UTC, angel wrote:
Wait !
x.value -= 100; would call the invariant ?
Alias this only rewrites your expression:
x -= 100; becomes x.value -= 100;
No method is called. Then there is no reason (is there ?) to
call the invariant.
If you would create
Am Mon, 10 Nov 2014 10:06:01 -0500
schrieb Steven Schveighoffer schvei...@yahoo.com:
I don't know about your specific issue. But I do know how the runtime
calls static ctors/dtors because I rewrote that part a few years ago.
First, any ctors/dtors in a specific module are called in the
what's the status?
I tried building druntime with 'make -f posix.mak dll' and got
src/rt/sections.d(52): Error: static assert (is(typeof(__error)
== void* function())) is false
I'd be happy to put in some work to improve the situation, but a
brief overview of the status quo would be
Filed as:
https://issues.dlang.org/show_bug.cgi?id=13712
AFAIU, even if you had a getter in the alias this:
---
import std.stdio;
struct ValueRestrictedInteger(int lowerBound, int upperBound) {
int value;
auto ref get() { return value; }
alias get this;
this (int rhs) { value = rhs; }
invariant() {
assert (value = lowerBound
On Saturday, 1 November 2014 at 16:42:31 UTC, Walter Bright wrote:
My ideas are what are implemented on airplanes.
For components, not for a system. Nobody said a word against
component design, it's systems that people want to be able to
design, yet you prohibit it.
I didn't originate
On 11/11/14 6:48 AM, ZombineDev wrote:
AFAIU, even if you had a getter in the alias this:
---
import std.stdio;
struct ValueRestrictedInteger(int lowerBound, int upperBound) {
int value;
auto ref get() { return value; }
alias get this;
this (int rhs) { value = rhs; }
I'm not at all sure that how a type is allocated should be
part of the type itself. There are an infinite way things can
be allocated.
Nitpick: it's about memory _management_, not _allocation_.
Exactly. I don't care much *where* the object lives, as long as
it has deterministic properties.
No, a trait or template to find out if a function is @nogc.
__trait(getFunctionAttributes, F) -- but it returns flags that
are applicable only to function attributes
-tomer
I suspect you are compiling the druntime/phobos library with
the 64-bit VC compiler. Make sure cl.exe is the compiler
targeting 32-bit when running make -fwin64.mak
MODEL=m32mscoff.
I've done it as you said:compiling the druntime/phobos library
with the 64-bit VC compiler.and cl.exe is the
On 2014-11-11 11:42, John Colvin wrote:
what's the status?
I tried building druntime with 'make -f posix.mak dll' and got
src/rt/sections.d(52): Error: static assert (is(typeof(__error) ==
void* function())) is false
I'd be happy to put in some work to improve the situation, but a brief
On 2014-11-11 14:19, Tomer Filiba wrote:
__trait(getFunctionAttributes, F) -- but it returns flags that are
applicable only to function attributes
Hmm, yeah. Using that trait on a type might be a bit weird.
--
/Jacob Carlborg
On Monday, 10 November 2014 at 18:32:03 UTC, Robert burner
Schadek wrote:
On Monday, 10 November 2014 at 17:03:31 UTC, Dicebot wrote:
There are also some more @safe changes need, I hope to provide
another branch with those soon enough (~tomorrow)
thank you
This is a bit complicated. Originally intention was to deprecate
scope variables (scope var = new Class) completely and make
people switch to std.typecons.scoped - primarily because of how
fragile and inflexible its implementation was (can't have scope
fields in aggregates for example)
http://forum.dlang.org/post/jftnpqyahnwacgkms...@forum.dlang.org
c:\D\import\dfl\button.d(381): Error: function
dfl.button.Button.text cannot have
e an in contract when overriden function dfl.control.Control.text
does not have an in contract
This is the line 381:
override void text(Dstring
For the reference https://issues.dlang.org/show_bug.cgi?id=13714
I don't see the merit of this DIP and it clearly introduces whole
new meaning of @nogc attribute (which needs a really good
justification to pull it off)
On Monday, 10 November 2014 at 23:22:00 UTC, Sean Kelly wrote:
On Monday, 10 November 2014 at 23:08:55 UTC, Logan Capaldo
wrote:
So just to be clear, there are _some_ legitimate uses of
extern (C) in druntime, yes? rt_init/rt_term, rt_loadLibrary,
thread_init(? think this one can be
On 11/11/14 11:01 AM, Dicebot wrote:
On Monday, 10 November 2014 at 23:22:00 UTC, Sean Kelly wrote:
On Monday, 10 November 2014 at 23:08:55 UTC, Logan Capaldo wrote:
So just to be clear, there are _some_ legitimate uses of extern (C)
in druntime, yes? rt_init/rt_term, rt_loadLibrary,
On Tuesday, 11 November 2014 at 15:29:49 UTC, Dicebot wrote:
But this is very complicated topic and may take years to fly.
The ship will have sailed by the time it's ready to fly
(gloriously mixed metaphors), this would seem like such a
fundamental issue with a big knock-on effect on
On Tuesday, 11 November 2014 at 16:54:10 UTC, ixid wrote:
On Tuesday, 11 November 2014 at 15:29:49 UTC, Dicebot wrote:
But this is very complicated topic and may take years to fly.
The ship will have sailed by the time it's ready to fly
(gloriously mixed metaphors), this would seem like such
On 2014-11-11 15:05, Jacob Carlborg wrote:
The first step would be to implement native TLS, see this issue [1].
BTW, the reason to implement native TLS is because otherwise we need to
implement basically what the dynamic linker is already doing for TLS our
self. Since it would be nice to
On Tuesday, 11 November 2014 at 15:31:07 UTC, Kagamin wrote:
http://forum.dlang.org/post/jftnpqyahnwacgkms...@forum.dlang.org
c:\D\import\dfl\button.d(381): Error: function
dfl.button.Button.text cannot have
e an in contract when overriden function
dfl.control.Control.text
does not have an in
On Monday, 10 November 2014 at 12:59:14 UTC, Tomer Filiba wrote:
http://wiki.dlang.org/DIP68
To be honest, I don't think that this DIP adds significant value
to the language. Generally, you (as in a language/library
implementor) need to assume that *any* struct with a non-trivial
destructor
On Tuesday, 11 November 2014 at 17:53:43 UTC, David Nadlinger
wrote:
Let's focus work on finally fixing bug 2834 instead.
(https://issues.dlang.org/show_bug.cgi?id=2834 – Struct
Destructors are not called by the GC, but called on explicit
delete. To me, this seems to be the proper fix for
Dicebot:
ixid:
The ship will have sailed by the time it's ready to fly
(gloriously mixed metaphors), this would seem like such a
fundamental issue with a big knock-on effect on everything
else that it should surely be prioritized higher than that? I
am aware you're not the one setting
On Tuesday, 11 November 2014 at 17:56:50 UTC, David Nadlinger
wrote:
On Tuesday, 11 November 2014 at 17:53:43 UTC, David Nadlinger
wrote:
Let's focus work on finally fixing bug 2834 instead.
(https://issues.dlang.org/show_bug.cgi?id=2834 – Struct
Destructors are not called by the GC, but
Wake up dead topic! :)
On Tuesday, 25 September 2012 at 04:22:13 UTC, p.crimsonsphere
wrote:
Hi there.
So, anyway, have you found any live link to download Ctags 5.8
working for D programming language?
I found here
http://pastie.org/971968
and applied it to
http://dfrank.ru/ctags581
I
On Tuesday, 11 November 2014 at 00:59:59 UTC, Jonathan Marler
wrote:
I started having issues today connecting to forum.dlang.org from
the proxy server we use at work (I work at HP). I've never had
this problem before today. I can connect if I use a 3rd party
proxy server (such as
On Tuesday, 11 November 2014 at 18:44:23 UTC, ANtlord wrote:
Wake up dead topic! :)
On Tuesday, 25 September 2012 at 04:22:13 UTC, p.crimsonsphere
wrote:
Hi there.
So, anyway, have you found any live link to download Ctags 5.8
working for D programming language?
I found here
On 11.11.2014 14:46, FrankLike wrote:
I suspect you are compiling the druntime/phobos library with the
64-bit VC compiler. Make sure cl.exe is the compiler targeting 32-bit
when running make -fwin64.mak MODEL=m32mscoff.
I've done it as you said:compiling the druntime/phobos library with the
On 10.11.2014 15:19, Steven Schveighoffer wrote:
Now, imagine you wanted to put this on the GC heap, and the GC would
call struct dtors. And let's say the program is multi-threaded. First,
the memory referred to by t isn't guaranteed to be alive, it could have
already been finalized and
On 11.11.2014 08:36, Iain Buclaw wrote:
Hi,
I find myself wondering what do people use to inspect the GC on a
running process?
Last night, I had a look at a couple of vibe.d servers that had been
running for a little over 100 days. But the same code, but one used
less (or not at all).
On 11/11/14 2:46 PM, Rainer Schuetze wrote:
On 10.11.2014 15:19, Steven Schveighoffer wrote:
Now, imagine you wanted to put this on the GC heap, and the GC would
call struct dtors. And let's say the program is multi-threaded. First,
the memory referred to by t isn't guaranteed to be alive,
Now D provides very powerfull means to link C++ code with D.
However D doesn't allow to call C++ overloaded operators.
It's very annoying, because C++ code may don't provide
non-operator analogues.
What we know about C++ overloadable operators? Overloaded
operator in C++ is a trivial
You have to compile druntime and phobos with the x86 compiler
aswell. Otherwise the C files in the library are built for the
wrong architecture.
So you should be fine if you use x86 intead of amd64 in the
line above.
Sorry,get the same error.
Hi all,
I want to get back on the subject of ownership, lifetime and
propose some solution, but before, propose to state the problem
in a way that haven't seen before (even if I have no doubt some
have came to the same conclusion in the past).
The problem at hand is double: memory
On Tuesday, 11 November 2014 at 22:26:48 UTC, IgorStepanov wrote:
Now D provides very powerfull means to link C++ code with D.
However D doesn't allow to call C++ overloaded operators.
It's very annoying, because C++ code may don't provide
non-operator analogues.
What we know about C++
On Wednesday, 12 November 2014 at 02:34:55 UTC, deadalnix wrote:
Hi all,
I want to get back on the subject of ownership, lifetime and
propose some solution, but before, propose to state the problem
in a way that haven't seen before (even if I have no doubt some
have came to the same
On 12/11/2014 3:34 p.m., deadalnix wrote:
Hi all,
I want to get back on the subject of ownership, lifetime and propose
some solution, but before, propose to state the problem in a way that
haven't seen before (even if I have no doubt some have came to the same
conclusion in the past).
The
On 10/11/14 16:19, Steven Schveighoffer wrote:
Only classes call dtors from the GC. Structs do not. There are many
hairy issues with structs calling dtors from GC. Most struct dtors
expect to be called synchronously, and are not expecting to deal with
multithreading issues.
Note that structs
On 11/11/14 22:41, Steven Schveighoffer wrote:
At this point, I am not super-concerned about this. I cannot think of
any bullet-proof way to ensure that struct dtors for structs that were
meant only for stack variables can be called correctly from the GC.
Isn't structs meant only for stack
On Tuesday, 11 November 2014 at 15:06:49 UTC, Dicebot wrote:
https://github.com/Dicebot/phobos/tree/logger-safety
I think that should be it for now
I could have completely missed some details but I took sometime
to look at the code after reading that the logger was holding a
lock during the
On 11/11/2014 6:34 PM, deadalnix wrote:
[...]
Thanks for an excellent summary of the problem. I can't just read your solution
and know it works, it'll take some time.
On Wednesday, 12 November 2014 at 06:16:34 UTC, Walter Bright
wrote:
On 11/11/2014 6:34 PM, deadalnix wrote:
[...]
Thanks for an excellent summary of the problem. I can't just
read your solution and know it works, it'll take some time.
That is quite difficult to explain with drawing. Maybe
On Wednesday, 12 November 2014 at 03:13:20 UTC, Rikki Cattermole
wrote:
[...]
yes and no. The ideas is similar, but it is not doable at library
level if we want to get safety and the full benefit out of it, as
it would require for the compiler to introduce some call to the
runtime at
On Tuesday, 11 November 2014 at 18:50:15 UTC, Jonathan Marler
wrote:
I'm still having this issue, this is quite an annoyance.
I also have issues with with https://, but with http:// it works
fine.
Mike
On Tuesday, 11 November 2014 at 18:56:29 UTC, Sergei Nosov wrote:
On Tuesday, 11 November 2014 at 18:44:23 UTC, ANtlord wrote:
Wake up dead topic! :)
On Tuesday, 25 September 2012 at 04:22:13 UTC, p.crimsonsphere
wrote:
Hi there.
So, anyway, have you found any live link to download Ctags
On Monday, 10 November 2014 at 10:50:49 UTC, Chris wrote:
On Sunday, 9 November 2014 at 08:26:59 UTC, Suliman wrote:
I know that a lot of people are using for programming tools
like Sublime. I am one of them. But if for very simple code
it's ok, how to write hard code?
Do you often need
On Monday, 10 November 2014 at 19:18:21 UTC, Kirill wrote:
Dear D community (and specifically experts on cache
optimization),
I'm a C++ programmer and was waiting for a while to do a
project in D.
I'd like to build a cache-optimized decision tree forest
library, and I'm debating between D
IK For example, isRandomAccessRange[0] states the problem:
IK -
IK Although char[] and wchar[] (as well as their qualified
IK versions including string and wstring) are arrays,
IK isRandomAccessRange yields false for them because they use
IK variable-length encodings (UTF-8 and UTF-16
IK Why is char [] so special that it can't be sorted?
SS Because sort works on ranges, and std.range has the view that
SS char[] is a range of dchar without random access. Nevermind
SS what the compiler thinks :)
SS
SS I believe you can get what you want with
SS std.string.representation:
SS
SS
On Tue, 11 Nov 2014 11:50:16 +
Ivan Kazmenko via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Is there an official translation already? In TDPL, the (very
few) occurrences of range are translated as диапазон
methinks that последовательность[0] is better, albeit longer. but
On 11/11/14 6:07 AM, Ivan Kazmenko wrote:
IK Why is char [] so special that it can't be sorted?
SS Because sort works on ranges, and std.range has the view that
SS char[] is a range of dchar without random access. Nevermind
SS what the compiler thinks :)
SS
SS I believe you can get what you
I'm trying to do something simple like creating an array of
struct S from a float array via map:
---
void main()
{
float[] vals = [1.1, 2.1, 3.1, 4.1];
import std.algorithm: map;
auto arr = vals.map!`S(a)`.array;
writeln(arr);
}
struct S(T)
{
T t;
}
---
Lemonfiend:
If I instead do ie. map!`cast(int)a` it works fine.
What am I missing?
Generally don't use casts, unless you know what you are doing
(and often you don't).
The code you were trying to write:
struct Foo(T) {
T t;
}
void main() {
import std.stdio, std.algorithm,
Another synonym is list.
The code you were trying to write:
struct Foo(T) {
T t;
}
void main() {
import std.stdio, std.algorithm, std.array;
float[] vals = [1.1, 2.1, 3.1, 4.1];
auto arr = vals.map!(Foo!float).array;
arr.writeln;
}
Sorry, my example had an unneeded template. Simply this (and also
Oh, no it doesn't. My bad.
It was all about !(Foo) vs !(`Foo(a)`). Is there somewhere I can
read more about this?
On Tue, 11 Nov 2014 14:08:36 +
Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Another synonym is list.
hm... i afraid that it's not suitable. list has a well-defined meaning
in programming literature. ranges are definitely not lists (but list can
be a range).
ah!
OS WinXP
On Monday, 10 November 2014 at 10:27:19 UTC, bearophile wrote:
In practice I prefer to avoid using hacks like setting a
NDEBUG. It's better to have differently named operators if
their behavour is different. So it's better to keep the
assert() as it is commonly used (and I'd like it to refuse
I was thinking about list comprehension, which is what
programming on ranges is. Isn't it?
On Tue, 11 Nov 2014 14:52:55 +
Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I was thinking about list comprehension, which is what
programming on ranges is. Isn't it?
list is a good term, but it's already taken. so naming range as
list will create unnecessary
On Saturday, 8 November 2014 at 15:51:59 UTC, Gary Willoughby
wrote:
This is really cool, (and at the risk of sounding foolish) what
is the benefit of doing this?
It turns segfault into normal exception with a stack trace, so
you see where it failed right away.
netstat reports that the socket is in the TIME_WAIT or CLOSE_WAIT
state.
On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov 2014 14:52:55 +
Kagamin via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
I was thinking about list comprehension, which is what
programming on ranges is. Isn't it?
list is a
On 11/11/14 10:14 AM, Kagamin wrote:
On Friday, 7 November 2014 at 03:45:23 UTC, Steven Schveighoffer wrote:
In an environment that you don't control, the default behavior is
likely to print Segmentation Fault and exit. No core dump, no nothing.
If you let the exception propagate into OS, by
On Tuesday, 11 November 2014 at 14:09:43 UTC, Lemonfiend wrote:
Oh, no it doesn't. My bad.
It was all about !(Foo) vs !(`Foo(a)`). Is there somewhere I
can read more about this?
Don't know whether it's documented, but it's a consequence of
using string mixins.
unaryFun (which is used
On Tuesday, 11 November 2014 at 13:20:53 UTC, Steven
Schveighoffer wrote:
On 11/11/14 6:07 AM, Ivan Kazmenko wrote:
IK Why is char [] so special that it can't be sorted?
SS Because sort works on ranges, and std.range has the view
that
SS char[] is a range of dchar without random access.
On Tue, 11 Nov 2014 15:35:28 +
RuZzz via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
netstat reports that the socket is in the TIME_WAIT or CLOSE_WAIT
state.
i'm not an expert in winsock, but did you tried to set SO_LINGER to
off?
signature.asc
Description: PGP signature
I was thinking about list comprehension, which is what
programming on ranges is. Isn't it?
list is a good term, but it's already taken. so naming
range as
list will create unnecessary confusion. alas. yet набор is
short
and easy, and it's not widely used, as set is translated as
множество.
On Tue, 11 Nov 2014 15:38:26 +
Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
What does набор mean literally? What is it?
something like (unordered) set of something similar but not same,
which can (eventually) be counted and things can be extracted/added.
like this.
On Tue, 11 Nov 2014 15:38:26 +
Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov 2014 14:52:55 +
Kagamin via Digitalmars-d-learn
On Tuesday, 11 November 2014 at 16:10:33 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov 2014 15:38:26 +
Chris via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov
On Tuesday, 11 November 2014 at 14:52:56 UTC, Kagamin wrote:
I was thinking about list comprehension, which is what
programming on ranges is. Isn't it?
No, not really. It only applies to specific subset of ranges and
specific interpretation of list term. There is no
straightforward
On Tuesday, 11 November 2014 at 16:00:56 UTC, Ivan Kazmenko wrote:
The suggested translations диапазон (diapason), список
(list), последовательность (sequence), набор (collection)
all have something in common with the range concept, but all of
them seem to have a defined meaning in either
On Tuesday, 11 November 2014 at 16:09:06 UTC, ketmar via
Digitalmars-d-learn wrote:
набор ручек для писания, for example, as set of pens from
which one
pen can be taken and used (or another pen added to be used
later).
pretty similar to what range in D is, methinks.
Only if
On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote:
Does that entail the concept that ranges (in D) are homogeneous
(i.e. every member/item is of the same type)?
Yes (if you mean static type)
ElementType!Range is used extensively in Phobos
On Tue, 11 Nov 2014 16:10:12 +
Dicebot via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
последовательность is solid generic term if you are not afraid
of making mathematicians mad
and it is totally unusable in practice. it's just too long and hard to
pronounce to be used
On Tuesday, 11 November 2014 at 16:04:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov 2014 15:35:28 +
RuZzz via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
netstat reports that the socket is in the TIME_WAIT or
CLOSE_WAIT state.
i'm not an expert in winsock,
On Tue, Nov 11, 2014 at 04:14:12PM +, Dicebot via Digitalmars-d-learn wrote:
On Tuesday, 11 November 2014 at 16:09:06 UTC, ketmar via Digitalmars-d-learn
wrote:
набор ручек для писания, for example, as set of pens from which
one pen can be taken and used (or another pen added to be used
On Tuesday, 11 November 2014 at 16:15:36 UTC, Dicebot wrote:
On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote:
Does that entail the concept that ranges (in D) are
homogeneous (i.e. every member/item is of the same type)?
Yes (if you mean static type)
ElementType!Range is used
On Tue, 11 Nov 2014 16:50:23 +
Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Tuesday, 11 November 2014 at 16:15:36 UTC, Dicebot wrote:
On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote:
Does that entail the concept that ranges (in D) are
homogeneous
On 11/11/2014 08:10 AM, ketmar via Digitalmars-d-learn wrote:
What does набор mean literally? What is it?
ah, yes, collection is a good translation. yet the word коллекция
is used literally in some of the programming books.
The separate concepts collection and range better have separate
On Tuesday, 11 November 2014 at 18:39:09 UTC, Ali Çehreli wrote:
The separate concepts collection and range better have
separate words.
Ali
This is especially important because collection tends to have
certain connotation with container and confusion between ranges
and containers is a
* i apologize in advance, this is my first post -- the code
formatting probably wont turn out so great...
I have a bunch of duck typed interfaces for containers similar
to what you would find in std.range.
i.e.
template isContainer(C)
{
enum bool isContainer = is(typeof(
(inout int =
On Tuesday, 11 November 2014 at 15:53:37 UTC, Marc Schütz wrote:
Don't know whether it's documented, but it's a consequence of
using string mixins.
unaryFun (which is used internally by map) is implemented this
way:
auto unaryFun(ElementType)(auto ref ElementType __a)
{
D is fine with alias this overloaded function:
---
void foo(int t) {}
void foo(int t, int i) {}
alias bar = foo;
---
But isn't as happy aliasing these function templates:
---
void foo(T)(T t) {}
void foo(T)(T t, int i) {}
alias bar = foo!int;
---
Is there some way/other syntax to make an
I'm trying to write a struct template that uses `insertInPlace`.
However, it doesn't work with certain template type / compiler
combinations. Consider the following:
import std.range;
struct S { const int c; }
S[] a;
insertInPlace(a, 0, S());
With DMD64 D Compiler v2.066.1, I
I have a situation where I have a VM (virtual machine) object,
and several GCRoot (garbage collector root objects). The GCRoots
are structs and will register themselves into a linked list
belonging to the VM. I've made it so they unregister themselves
in their destructor. This works perfectly
On Tue, 11 Nov 2014 22:31:17 +
Maxime Chevalier-Boisvert via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
What I want to know is: what
guarantees can I expect from destructor behavior?
destructors *may* be called eventually. or not. in any order. but never
twice.
think
As for guarantees for class destructors - you have hard
guarantees that if memory is reclaimed, destructor was called
before. But no guarantees memory will actually be reclaimed.
There is an issue with structs that are directly allocated on
heap - destructors are never called for those. You will want to
change those into classes for GC to do at least something about
it.
See also this bug report :
https://issues.dlang.org/show_bug.cgi?id=2834
On Tuesday, 11 November 2014 at 20:53:51 UTC, John McFarlane
wrote:
I'm trying to write a struct template that uses
`insertInPlace`. However, it doesn't work with certain template
type / compiler combinations. Consider the following:
import std.range;
struct S { const int c; }
S[]
On Tuesday, 11 November 2014 at 19:23:39 UTC, Adam Taylor wrote:
* i apologize in advance, this is my first post -- the code
formatting probably wont turn out so great...
I have a bunch of duck typed interfaces for containers
similar to what you would find in std.range.
i.e.
template
Not entirly sure of what you asking for,but have you tried
inhertance?
interface Base(C){
/+...+/
}
interface Derived(C):Base!C{
/+...+/
}
No, i'm specifically looking for a solution that is NOT
inheritance based. I've been looking at solutions based on
opDispatch or
1 - 100 of 134 matches
Mail list logo