Re: Call different member functions on object sequence with a generic handler function?

2018-06-30 Thread Basile B. via Digitalmars-d-learn
On Saturday, 30 June 2018 at 00:16:49 UTC, Basile B. wrote: On Friday, 29 June 2018 at 16:44:36 UTC, Robert M. Münch wrote: I hope this is understandable... I have: class C { void A(); void B(); void C(); } I'm iterating over a set of objects of class C like: foreach(o

Re: High memory usage in vibe.d application

2018-06-30 Thread Anton Fediushin via Digitalmars-d-learn
On Saturday, 30 June 2018 at 05:00:35 UTC, rikki cattermole wrote: On 30/06/2018 4:49 AM, Bauss wrote: I wouldn't really blame the GC. There is a higher chance you're just not using it how it's meant to be, especially since it looks like you're mixing manual memory management with GC memory.

Recursive Algebraic

2018-06-30 Thread Mr.Bingo via Digitalmars-d-learn
I'm trying to create a vector of vectors(more general than vectors or matrices). The idea is that a Vector can contain another Vector or another type. Vector can be specified to be fixed in length or dynamic for efficiency. Vector!(T, N) creates a vector of leaf type T and length N. If N = si

How to use LLD linker?

2018-06-30 Thread Suliman via Digitalmars-d-learn
Correct me if I am wrong, but I have read news that dmd now can be used without C++ Build Tools. I trying to build simple project. And getting Error: Warning: no Visual C++ installation detected OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. ht

Re: Recursive Algebraic

2018-06-30 Thread Mr.Bingo via Digitalmars-d-learn
The problem is that it seems that when one has a parameterized type, you must completely specify the parameters when using Algebraic, Algebraic!(T, Vector!int, Vector!(double, 3), Vector!(double, 3), ...)[] data; to be able to encapsulate an Algebraic on Vector(as a collection of all fixed

Re: High memory usage in vibe.d application

2018-06-30 Thread rikki cattermole via Digitalmars-d-learn
On 30/06/2018 7:42 PM, Anton Fediushin wrote: On Saturday, 30 June 2018 at 05:00:35 UTC, rikki cattermole wrote: On 30/06/2018 4:49 AM, Bauss wrote: I wouldn't really blame the GC. There is a higher chance you're just not using it how it's meant to be, especially since it looks like you're mix

Re: Why tuples are not ranges?

2018-06-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/29/18 1:35 PM, Ali Çehreli wrote: On 06/28/2018 11:10 PM, Jonathan M Davis wrote: > On Friday, June 29, 2018 05:52:03 Alex via Digitalmars-d-learn wrote: >> Wouldn't this be weird from the semantic view? I agree with all your concerns. The fact that Meta decided to make the element type

Re: Why tuples are not ranges?

2018-06-30 Thread Ali Çehreli via Digitalmars-d-learn
On 06/30/2018 05:17 AM, Steven Schveighoffer wrote: Isn't this what only does? https://dlang.org/phobos/std_range.html#only Cool. :) import std.range : only; auto t = tuple(5, 3.5, false); auto r = only(t.expand); Ali

Re: Convert path to file system path on windows

2018-06-30 Thread Dr.No via Digitalmars-d-learn
Thank you very much u all guys.

Can't build app. VS Build Tools is installed

2018-06-30 Thread Suliman via Digitalmars-d-learn
I am trying to build simple app. And getting next error: OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html .dub\build\application-debug-windows-x86-dmd_2081-AC4AEBC828F1A14C3806E4E63B3CEEF3\app.obj(app) E

template alias that includes a parameter

2018-06-30 Thread Anonymouse via Digitalmars-d-learn
I have a template that I want to provide easy aliases for, where the aliases includes (partially applies?) a template parameter. void fooImpl(char token, T)(const T line) { // ... } alias quoteFoo(T) = fooImpl!('"', T); alias singlequoteFoo(T) = fooImpl!('\'', T); void main() { quoteF

Re: template alias that includes a parameter

2018-06-30 Thread Timoses via Digitalmars-d-learn
On Saturday, 30 June 2018 at 21:11:54 UTC, Anonymouse wrote: I have a template that I want to provide easy aliases for, where the aliases includes (partially applies?) a template parameter. void fooImpl(char token, T)(const T line) { // ... } alias quoteFoo(T) = fooImpl!('"', T); would

Re: High memory usage in vibe.d application

2018-06-30 Thread Jacob Shtokolov via Digitalmars-d-learn
On Friday, 29 June 2018 at 17:40:07 UTC, Anton Fediushin wrote: So, long story short: - Usage of Mallocator instead of theAllocator made it a little bit better - VibeManualMemoryManagement had no (or little) effect - Manually calling GC.collect had no (or little) effect You could try to call

Re: Call different member functions on object sequence with a generic handler function?

2018-06-30 Thread Jerry via Digitalmars-d-learn
On Friday, 29 June 2018 at 20:23:47 UTC, Timoses wrote: void handler(alias func, T)(T[] ts) { } Btw this is pretty much std.algorithm.each import std.algorithm; void main() { auto cs = [ new C(), new C() ]; cs.each!(o => o.A()); } https://dlang.org/phobos/std_algorithm_iteration

Linker error for core.sys.windows.winuser imports when compiling as 64 bit.

2018-06-30 Thread spikespaz via Digitalmars-d-learn
Hey guys, I'm getting a linker error when compiling with DMD `-m63` that I don't get as 23 bit. I'm importing `ShowWindow` from `core.sys.windows.winuser`, and I get the following: C:\D\dmd2\windows\bin\lld-link.exe: warning: main.obj: undefined symbol: ShowWindow error: link failed Error:

Re: Linker error for core.sys.windows.winuser imports when compiling as 64 bit.

2018-06-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, July 01, 2018 00:42:30 spikespaz via Digitalmars-d-learn wrote: > Hey guys, I'm getting a linker error when compiling with DMD > `-m63` that I don't get as 23 bit. > > I'm importing `ShowWindow` from `core.sys.windows.winuser`, and I > get the following: > > C:\D\dmd2\windows\bin\lld-lin

Re: template alias that includes a parameter

2018-06-30 Thread Simen Kjærås via Digitalmars-d-learn
On Saturday, 30 June 2018 at 21:11:54 UTC, Anonymouse wrote: I have a template that I want to provide easy aliases for, where the aliases includes (partially applies?) a template parameter. void fooImpl(char token, T)(const T line) { // ... } alias quoteFoo(T) = fooImpl!('"', T); alias s

Re: High memory usage in vibe.d application

2018-06-30 Thread Anton Fediushin via Digitalmars-d-learn
On Saturday, 30 June 2018 at 22:06:50 UTC, Jacob Shtokolov wrote: On Friday, 29 June 2018 at 17:40:07 UTC, Anton Fediushin wrote: So, long story short: - Usage of Mallocator instead of theAllocator made it a little bit better - VibeManualMemoryManagement had no (or little) effect - Manually ca