get vtable size

2017-05-06 Thread Mike B Johnson via Digitalmars-d-learn
how many elements(virtual functions) are in the __vptr?

Re: How to declare "abstract" delegates list?

2017-05-06 Thread RedCAT via Digitalmars-d-learn
On Saturday, 6 May 2017 at 06:07:01 UTC, bauss wrote: By theory that should work. It's untested, so you might need a few tweaks here and there. Thanks!

Re: How to get field default value at CT

2017-05-06 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 6 May 2017 at 21:40:24 UTC, Mike B Johnson wrote: I'd like to get the value assign to a field at CT. struct { int x = 3434; } I'd like to get the assigned "value" 3434 for x at CT. Use the .init property: struct S { int x = 3434; } unittest { static

How to get field default value at CT

2017-05-06 Thread Mike B Johnson via Digitalmars-d-learn
I'd like to get the value assign to a field at CT. struct { int x = 3434; } I'd like to get the assigned "value" 3434 for x at CT.

Re: alias can't find symbol or can't use symbol

2017-05-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 6, 2017 1:49:34 PM CEST Carl Sturtivant via Digitalmars-d- learn wrote: > On Wednesday, 3 May 2017 at 09:04:07 UTC, Jonathan M Davis wrote: > > I believe that the core problem is that an alias declaration > > just aliases a symbol - i.e. it just creates a new name for the > >

Re: std.algorithm can not be used inside pure functions?

2017-05-06 Thread Szabo Bogdan via Digitalmars-d-learn
On Saturday, 6 May 2017 at 15:01:16 UTC, Adam D. Ruppe wrote: On Saturday, 6 May 2017 at 14:14:41 UTC, Szabo Bogdan wrote: oh yes, I get it... begin and end are `SysTime`.. there is any workaround for this? Don't use pure? I don't think any of the SysTime conversion methods are pure since

Re: std.algorithm can not be used inside pure functions?

2017-05-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 6, 2017 2:14:41 PM CEST Szabo Bogdan via Digitalmars-d- learn wrote: > On Saturday, 6 May 2017 at 13:21:10 UTC, Adam D. Ruppe wrote: > > On Saturday, 6 May 2017 at 13:19:17 UTC, Szabo Bogdan wrote: > >> a.begin.toISOExtString, > > > > I believe that function is not marked pure if

Re: std.algorithm can not be used inside pure functions?

2017-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 6 May 2017 at 14:14:41 UTC, Szabo Bogdan wrote: oh yes, I get it... begin and end are `SysTime`.. there is any workaround for this? Don't use pure? I don't think any of the SysTime conversion methods are pure since all of them call C functions which pull from the time zone...

Re: std.algorithm can not be used inside pure functions?

2017-05-06 Thread Szabo Bogdan via Digitalmars-d-learn
On Saturday, 6 May 2017 at 13:21:10 UTC, Adam D. Ruppe wrote: On Saturday, 6 May 2017 at 13:19:17 UTC, Szabo Bogdan wrote: a.begin.toISOExtString, I believe that function is not marked pure if it is a SysTime because it needs to pull global timezone info. What is the type of a.begin? oh

Re: alias can't find symbol or can't use symbol

2017-05-06 Thread Carl Sturtivant via Digitalmars-d-learn
On Wednesday, 3 May 2017 at 09:04:07 UTC, Jonathan M Davis wrote: I believe that the core problem is that an alias declaration just aliases a symbol - i.e. it just creates a new name for the symbol. And as far as I can tell, alias n2 = x2.n; is actually equivalent to alias n2 = member.n;

std.algorithm can not be used inside pure functions?

2017-05-06 Thread Szabo Bogdan via Digitalmars-d-learn
Hi, I'm trying to write a function that saves some structs as csv file: ``` string toCsv(const(StatStorage) storage) { return storage.values .map!(a => [ a.name, a.begin.toISOExtString, a.end.toISOExtString, a.status.to!string ]) .map!(a => a.join(',')) .join('\n'); } ``` I

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread k-five via Digitalmars-d-learn
On Saturday, 6 May 2017 at 10:35:05 UTC, Stanislav Blinov wrote: On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: On Saturday, 6 May 2017 at 08:53:12 UTC, Jonathan M Davis wrote: On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: On Friday, 5 May 2017 at

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 6 May 2017 at 10:15:03 UTC, k-five wrote: On Saturday, 6 May 2017 at 08:53:12 UTC, Jonathan M Davis wrote: On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: > On Friday, 5 May 2017 at

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread k-five via Digitalmars-d-learn
On Saturday, 6 May 2017 at 08:53:12 UTC, Jonathan M Davis wrote: On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: > On Friday, 5 May 2017 at 09:54:03 UTC, k-five wrote:

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 6 May 2017 at 08:34:11 UTC, k-five wrote: Also what is the parameter "a.empty" for template filter Jonathan covered the type part. As for that last bit, the filter template takes a predicate as parameter. This predicate is called for each input element, and if returns false,

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 6, 2017 8:34:11 AM CEST k-five via Digitalmars-d-learn wrote: > On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: > > On Friday, 5 May 2017 at 09:54:03 UTC, k-five wrote: > == > > Thanks. > I only needed this part

Re: Looking for an equivalent to C++ std::getline in D

2017-05-06 Thread k-five via Digitalmars-d-learn
On Friday, 5 May 2017 at 17:07:25 UTC, Stanislav Blinov wrote: On Friday, 5 May 2017 at 09:54:03 UTC, k-five wrote: == Thanks. I only needed this part since it filters the empty elements and this is enough for me: auto input =

Re: "Rolling Hash computation" or "Content Defined Chunking"

2017-05-06 Thread Johannes Pfau via Digitalmars-d-learn
Am Mon, 01 May 2017 21:01:43 + schrieb notna : > Hi Dlander's. > > Found some interesting reads ([1] [2] [3]) about the $SUBJECT and > wonder if there is anything available in the Dland?! > > If yes, pls. share. > If not, how could it be done (D'ish) > >

Re: How to declare "abstract" delegates list?

2017-05-06 Thread bauss via Digitalmars-d-learn
On Saturday, 6 May 2017 at 06:07:01 UTC, bauss wrote: On Friday, 5 May 2017 at 14:20:43 UTC, RedCAT wrote: [...] I would do something like this: [...] You could also do use alias this to use the delegate instead of the class encapsulating the delegate.

Re: How to declare "abstract" delegates list?

2017-05-06 Thread bauss via Digitalmars-d-learn
On Friday, 5 May 2017 at 14:20:43 UTC, RedCAT wrote: Hello! Is it possible to create a list of slightly different delegates? For example, there is a class hierarchy: class Base; class DerivedOne : Base; class DerivedTwo : Base; And there are several delegates: void delegate(int, Base); void