Here's a simple solution. Just make Bar a pointer and free it
before it can be destructed!
import std.stdio;
struct Bar {
~this() {
writeln("~bar");
}
}
struct Foo {
Bar *bar;
this(int why_the_fuck_dont_structs_have_default_constructors)
{
bar = new Bar;
Here's a simple solution. Just make Bar a pointer and free it
before it can be destructed!
import std.stdio;
struct Bar {
~this() {
writeln("~bar");
}
}
struct Foo {
Bar *bar;
this(int why_the_fuck_dont_structs_have_default_constructors)
{
bar = new Bar;
On 9/27/2017 4:21 PM, Manu wrote:
D does not have ADL,
Thank gawd! :-)
which will almost certainly lead to _very_ nasty surprises in behaviour.
ADL was always a hack to get around the wretched overloading symbol lookup
behavior in C++. I see it has somehow morphed into a feature :-( but I
On Wednesday, 27 September 2017 at 20:38:51 UTC, Gheorghe Gabriel
wrote:
On Monday, 30 March 2015 at 01:11:55 UTC, bitwise wrote:
[...]
Hi, your link is not working any more and I really need your
implementation.
Gabriel
I took the code down because there were design flaws I had to
work
On Wednesday, 27 September 2017 at 21:18:54 UTC, Jean-Louis Leroy
wrote:
I am aware of these but TemplateArgsOf takes a template
*instantiation* and returns the arguments. I want to reflect
the *template*.
Yeah, I had kind of realized the point about instantiate mid-post.
On Wednesday, 27 September 2017 at 23:25:34 UTC, Manu wrote:
Again, sadly, D has no ADL, and this will be an unmitigated
disaster as a
result!
Instantiations of templates will use the default elementwise
operator
instead of the one you specified in your module, and nobody
will understand
On Wednesday, 27 September 2017 at 23:24:58 UTC, user1234 wrote:
On Wednesday, 27 September 2017 at 21:01:36 UTC, Jesse Phillips
wrote:
On Wednesday, 27 September 2017 at 16:35:54 UTC, DreadKyller
wrote:
My question is about overloading, several operators can be
overloaded in D, one of the
On 27 September 2017 at 17:41, Ilya Yaroshenko via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:
> On Wednesday, 27 September 2017 at 04:59:10 UTC, Manu wrote:
>
>> On 26 September 2017 at 21:41, Atila Neves via Digitalmars-d <
>> digitalmars-d@puremagic.com> wrote:
>>
>> On Friday, 22
On 27 September 2017 at 22:01, jmh530 via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:
> On Wednesday, 27 September 2017 at 07:41:23 UTC, Ilya Yaroshenko wrote:
>
>>
>> I would prefer outer operator overloading be added to D instead of type
>> wrappers. So a user can import a library for
On 09/26/2017 09:27 PM, Ali Çehreli wrote:
> As always, I will post the Google Meet link here.
The Google Meet link is (will be)
https://meet.google.com/zie-vuec-jao
but the meeting is in about 26 hours from this posting. You may want to
make sure Google Meet works with your browser; I had
On Wednesday, 27 September 2017 at 21:01:36 UTC, Jesse Phillips
wrote:
On Wednesday, 27 September 2017 at 16:35:54 UTC, DreadKyller
wrote:
My question is about overloading, several operators can be
overloaded in D, one of the ones that can't apparently is the
address of operator (). My
https://issues.dlang.org/show_bug.cgi?id=13568
--- Comment #11 from b2.t...@gmx.com ---
There's https://issues.dlang.org/show_bug.cgi?id=17381 that could be handled
the day std.format will be refact.
The strategy used to check statically the specifier (call format() and look if
there's been an
https://issues.dlang.org/show_bug.cgi?id=17381
b2.t...@gmx.com changed:
What|Removed |Added
CC||b2.t...@gmx.com
OS|Linux
On Wednesday, 27 September 2017 at 14:34:06 UTC, Eugene Wissner
wrote:
On Wednesday, 27 September 2017 at 14:23:01 UTC, Ky-Anh Huynh
wrote:
See also the following chapter in Ali's book:
http://ddili.org/ders/d.en/templates.html
This chapter is what hooked me with D. Naming that chapter as
https://issues.dlang.org/show_bug.cgi?id=17857
--- Comment #1 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/9e3fad9ea3e955b10ec80439247e50fc9417f77d
T.alignof: Respect explicit align(N) type alignment
It was
On Wednesday, 27 September 2017 at 20:03:27 UTC, Gheorghe Gabriel
wrote:
Hi,
I have a 3D scene editor.
I need my scripts to be dynamically loaded in the scene.
In c# or java I can use reflections to do that.
How can I do that with D?
I know that std.traits only works in compile time.
Please,
On Wednesday, 27 September 2017 at 17:58:27 UTC, Ali Çehreli
wrote:
On 09/27/2017 08:33 AM, Ky-Anh Huynh wrote:
> [...]
Wissner wrote:
> [...]
The fact that such an important operator is explained so late
in the book is due to the book's strong desire to have a linear
flow.
[...]
ustad,
On 09/27/2017 03:06 PM, Mengu wrote:
ustad, guess you can still write the new ed. :-)
Since you're still around, one of these days... :)
Ali
On Wednesday, 27 September 2017 at 21:18:50 UTC, nkm1 wrote:
On Wednesday, 27 September 2017 at 20:24:24 UTC, DreadKyller
wrote:
The attitude of "some people use this feature incorrectly, so
let's ban it's use entirely" is honestly ridiculous to me, but
oh well, that's apparently the modern
On Wednesday, 27 September 2017 at 21:44:48 UTC, Ali Çehreli
wrote:
On 09/27/2017 02:39 PM, timvol wrote:
[...]
void main() {
auto mem = new ubyte[1024+15];
auto ptr = cast(ubyte*)(cast(ulong)(mem.ptr + 15) &
~0x0FUL);
auto arr = ptr[0..1024];
}
Ali
Works perfect. Thank you!
On 09/27/2017 02:39 PM, timvol wrote:
Hi guys,
how can I allocate an (e.g. 16) byte aligned array?
In C I can do the following:
void *mem = malloc(1024+15);
void *ptr = ((uintptr_t)mem+15) & ~ (uintptr_t)0x0F;
memset_16aligned(ptr, 0, 1024);
free(mem);
I think in D it looks
Hi guys,
how can I allocate an (e.g. 16) byte aligned array?
In C I can do the following:
void *mem = malloc(1024+15);
void *ptr = ((uintptr_t)mem+15) & ~ (uintptr_t)0x0F;
memset_16aligned(ptr, 0, 1024);
free(mem);
I think in D it looks similar to this:
auto mem = new
On Wednesday, 27 September 2017 at 20:24:24 UTC, DreadKyller
wrote:
The attitude of "some people use this feature incorrectly, so
let's ban it's use entirely" is honestly ridiculous to me, but
oh well, that's apparently the modern philosophy.
Not even modern, see Java :) ("I left out operator
On Wednesday, 27 September 2017 at 20:04:42 UTC, jmh530 wrote:
On Wednesday, 27 September 2017 at 19:47:32 UTC, Jean-Louis
Leroy wrote:
I'd like to go further: find the template arguments and the
function arguments and return types. Looking at __traits and
std.traits, it doesn't seem
On Wednesday, 27 September 2017 at 21:01:36 UTC, Jesse Phillips
wrote:
For example, if you store your Matrix in a custom container it
could try to store pointer rather than the struct itself, if &
is overloaded the generic implementation would be broken
because it would no longer be a pointer
https://issues.dlang.org/show_bug.cgi?id=17085
b2.t...@gmx.com changed:
What|Removed |Added
Summary|[std.traits] Documentation |Documentation for all
On Wednesday, 27 September 2017 at 16:35:54 UTC, DreadKyller
wrote:
My question is about overloading, several operators can be
overloaded in D, one of the ones that can't apparently is the
address of operator (). My question is have I simply
missed it or does it actually not exist, and if it's
On Monday, 30 March 2015 at 01:11:55 UTC, bitwise wrote:
I came across this post a while back and decided to implement
it:
http://forum.dlang.org/thread/juf7sk$16rl$1...@digitalmars.com
My implementation:
https://github.com/bitwise-github/D-Reflection
The above conversation seemed to stop
On Wednesday, 27 September 2017 at 12:49:16 UTC, jamonahn wrote:
On Saturday, 16 September 2017 at 19:56:14 UTC, Anton Fediushin
wrote:
Hey-hey-hey, I am so excited to announce a brand-new program I
just wrote: goinsu!
Just built on my Raspberry Pi 3. Kudos - very fast, not even a
warning!
On Wednesday, 27 September 2017 at 19:55:07 UTC, nkm1 wrote:
On Wednesday, 27 September 2017 at 16:35:54 UTC, DreadKyller
wrote:
Been using D for a couple years now, however one problem I've
had, more so recently since I've been dealing a lot with
OpenGL is related to pointers.
I have a
On Wednesday, 27 September 2017 at 19:47:32 UTC, Jean-Louis Leroy
wrote:
I'd like to go further: find the template arguments and the
function arguments and return types. Looking at __traits and
std.traits, it doesn't seem feasible, but maybe I overlooked
something?
You can use
Hi,
I have a 3D scene editor.
I need my scripts to be dynamically loaded in the scene.
In c# or java I can use reflections to do that.
How can I do that with D?
I know that std.traits only works in compile time.
Please, help me
Gabriel
On Wednesday, 27 September 2017 at 19:47:32 UTC, Jean-Louis Leroy
wrote:
I'd like to go further: find the template arguments and the
function arguments and return types. Looking at __traits and
std.traits, it doesn't seem feasible, but maybe I overlooked
something?
You can use
On Wednesday, 27 September 2017 at 16:35:54 UTC, DreadKyller
wrote:
Been using D for a couple years now, however one problem I've
had, more so recently since I've been dealing a lot with OpenGL
is related to pointers.
I have a matrix object to aid with the matrix math required for
working
I can identify the templates in a module:
module modtemp;
import std.stdio;
import std.traits;
void foo(T)(T x) {}
void main()
{
foreach (m; __traits(allMembers, modtemp)) {
if (__traits(isTemplate, mixin(m))) {
mixin("alias F = " ~ m ~ ";");
writeln(m);
https://issues.dlang.org/show_bug.cgi?id=17860
greenify changed:
What|Removed |Added
CC||greeen...@gmail.com
---
At
https://github.com/nordlow/phobos-next/blob/03b4736fdd65ef84c6fc583eddee4196629cea81/src/variant_arrays.d
I've implemented a lightweight-polymorphic array container I call
`VariantArrays(Types...)` indexed by a corresponding polymorphic
index I call `VariantIndex(Types...)`.
It uses
On 09/27/2017 08:33 AM, Ky-Anh Huynh wrote:
> On Wednesday, 27 September 2017 at 14:34:06 UTC, Eugene Wissner wrote:
>>
>> See also the following chapter in Ali's book:
>> http://ddili.org/ders/d.en/templates.html
>
> Thanks a lot. I will keep reading :)
The fact that such an important operator
Been using D for a couple years now, however one problem I've
had, more so recently since I've been dealing a lot with OpenGL
is related to pointers.
I have a matrix object to aid with the matrix math required for
working with 3D transforms. However OpenGL (I'm using DerelictGL3
bindings)
On Wednesday, 27 September 2017 at 10:05:34 UTC, Nicholas Wilson
wrote:
I'd just use dirEntries with SpanMode.shallow in combination
with filter either in a loop or a recursive function like below.
void foo(string path = "path")
{
foreach(e;
On Wednesday, 27 September 2017 at 14:23:01 UTC, Ky-Anh Huynh
wrote:
Can you please explain and give any link where I can learn more
about these things?
Thanks a lot.
http://nomad.so/2013/07/templates-in-d-explained/
On Wednesday, 27 September 2017 at 14:34:06 UTC, Eugene Wissner
wrote:
See also the following chapter in Ali's book:
http://ddili.org/ders/d.en/templates.html
Thanks a lot. I will keep reading :)
On Wednesday, 27 September 2017 at 13:22:20 UTC, Vadim Lopatin
wrote:
On Tuesday, 26 September 2017 at 22:35:09 UTC, bitwise wrote:
On Tuesday, 26 September 2017 at 15:20:54 UTC, Vadim Lopatin
wrote:
New DlangIDE version is released.
I've only had time to take a quick look, but this IDE
On Wednesday, 27 September 2017 at 12:21:24 UTC, Ilya Yaroshenko
wrote:
Thanks! And looking forward to find you PR in Lubeck! --Ilya
It's what prompted eachLower/eachUpper. I was like, there's gotta
be a pretty way of doing this and got completely distracted from
cholesky!
On Wednesday, 27 September 2017 at 14:23:01 UTC, Ky-Anh Huynh
wrote:
Hi,
I am from Ruby world where I can have `!` (or `?`) in method
names: `!` indicates that a method would modify its object
(`foo.upcase!` means `foo = foo.upcase`). ( I don't know if
there is any official Ruby
There are two types of arguments in D. The runtime one (which you are
well aware of) and the compile time one. A compile time argument is a
constant passed in during construction of a symbol.
But here is the thing, it isn't just limited to functions, you can have
it on classes as well.
---
On 2017-09-26 18:08, Jean-Louis Leroy wrote:
Ah, I suspected that. I don't want to go down that path, what of
Windows? But thanks anyway...
It's possible to do the same on Windows (using LoadLibrary instead of
dlopen). You would need to have separate code for each binary format. On
Windows
Hi,
I am from Ruby world where I can have `!` (or `?`) in method
names: `!` indicates that a method would modify its object
(`foo.upcase!` means `foo = foo.upcase`). ( I don't know if there
is any official Ruby documentation on this convention though. )
In D I see `!` quite a lot. I have
On Wednesday, 27 September 2017 at 08:00:21 UTC, Traktor Toni
wrote:
Code completion isnt working for me on windows, no clue what's
missing.
Did you try Ctrl+Space?
On Tuesday, 26 September 2017 at 22:35:09 UTC, bitwise wrote:
On Tuesday, 26 September 2017 at 15:20:54 UTC, Vadim Lopatin
wrote:
New DlangIDE version is released.
I've only had time to take a quick look, but this IDE seems
pretty good. I was surprised at how fast it loaded up, and how
it
https://issues.dlang.org/show_bug.cgi?id=11188
Simen Kjaeraas changed:
What|Removed |Added
Status|NEW |RESOLVED
On Saturday, 16 September 2017 at 19:56:14 UTC, Anton Fediushin
wrote:
Hey-hey-hey, I am so excited to announce a brand-new program I
just wrote: goinsu!
Just built on my Raspberry Pi 3. Kudos - very fast, not even a
warning! Now to get some Docker images and go crazy.
BTW, I got a 14,116
On Wednesday, 27 September 2017 at 08:00:21 UTC, Traktor Toni
wrote:
The shortcuts should be identical to Visual Studio, anything
else is a waste of time to learn and configure.
Visual Studio? Why not Vim? Why not Xamarin Studio? Why not IDEA?
Why not Sublime or tons of other popular
On Wednesday, 27 September 2017 at 11:52:32 UTC, jmh530 wrote:
On Wednesday, 27 September 2017 at 05:24:50 UTC, Ilya
Yaroshenko wrote:
private Cholesky decomposition, which has not unittests yet.
PRs are welcome.
My fork of lubeck has a branch where I was doing some work on
adding
On Wednesday, 27 September 2017 at 07:41:23 UTC, Ilya Yaroshenko
wrote:
I would prefer outer operator overloading be added to D instead
of type wrappers. So a user can import a library for
operations, rather then library of wrappers. --Ilya
This might be a step in the right direction. It
GCC supports a `__attribute((section("...")))` for variables to
put them in specific sections in the final assembly. Is there any
way this can be achieved in D? Does GDC support this?
On Wednesday, 27 September 2017 at 05:24:50 UTC, Ilya Yaroshenko
wrote:
private Cholesky decomposition, which has not unittests yet.
PRs are welcome.
My fork of lubeck has a branch where I was doing some work on
adding cholesky that has some unittests if you want to borrow
them (probably
On Wednesday, 27 September 2017 at 04:59:10 UTC, Manu wrote:
An alternative solution might be to introduce a wrapper of
ndslice called 'matrix' that supports matrix mul...?
That's exactly how Numpy works with array and matrix types. It's
confusing. That being said, mir has
On Friday, 22 September 2017 at 17:11:56 UTC, Ilya Yaroshenko
wrote:
Should we add `a * b` to ndslice for 1d vectors?
Discussion at https://github.com/libmir/mir-algorithm/issues/91
Unless it's always just simple element-wise, make it a different
type. N-dimensional rectangular data
On Wednesday, 27 September 2017 at 09:00:55 UTC, Ky-Anh Huynh
wrote:
Hi,
Can I have a `break` option when using `dirEntries()` (similar
to `break` in a loop)? I want to study sub-directories but if
any sub-directory matches my criteria I don't to look further
into their subdirectories
```
On Friday, 22 September 2017 at 17:11:56 UTC, Ilya Yaroshenko
wrote:
Should we add `a * b` to ndslice for 1d vectors?
Discussion at https://github.com/libmir/mir-algorithm/issues/91
If it is for element-wise product, then possibly yes.
If it is for dot product (as suggested by the github
Hi,
Can I have a `break` option when using `dirEntries()` (similar
to `break` in a loop)? I want to study sub-directories but if any
sub-directory matches my criteria I don't to look further into
their subdirectories
```
A/ -> matches criteria, stop here, go to next directory (B)
On Wednesday, 27 September 2017 at 07:23:30 UTC, Vadim Lopatin
wrote:
1. Ctrl+F5 does. You can change shortcuts in
~/.dlangide/shortcuts.json (on Windows - in
currentUser/AppData/.dlangide/shortcuts.json
2. Why should IDE include compiler. It's easy to download it
from official site.
3. Is
On Wednesday, 27 September 2017 at 04:59:10 UTC, Manu wrote:
On 26 September 2017 at 21:41, Atila Neves via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:
On Friday, 22 September 2017 at 17:11:56 UTC, Ilya Yaroshenko
wrote:
Should we add `a * b` to ndslice for 1d vectors?
Discussion
On Wednesday, 27 September 2017 at 02:37:41 UTC, Traktor Toni
wrote:
On Tuesday, 26 September 2017 at 15:20:54 UTC, Vadim Lopatin
wrote:
New DlangIDE version is released.
Now I'm considering DlangIDE as mostly usable.
well don't. I just tested the windows build.
1. F5 doesnt build+run the
On Wednesday, 27 September 2017 at 04:40:59 UTC, Psychological
Cleanup wrote:
It usually breaks at the calling site. The error message gives
the correct module and line number but this is not the line
number show in visual studio. The function does not show up in
the call stack either making
https://issues.dlang.org/show_bug.cgi?id=17862
Issue ID: 17862
Summary: std.random.XorshiftEngine.min is wrong when bits == 32
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
67 matches
Mail list logo