Re: C header file: tagged enumerations

2016-04-28 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 28 April 2016 at 17:40:23 UTC, Jesse Phillips wrote: enum tagINSTALLMESSAGE { // 12 others ... INSTALLMESSAGE_INITIALIZE , INSTALLMESSAGE_TERMINATE , INSTALLMESSAGE_SHOWDIALOG , [greaterThan(500)] INSTALLMESSAGE_PERFORMANCE,

Re: C header file: tagged enumerations

2016-04-28 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 28 April 2016 at 08:54:45 UTC, Kagamin wrote: enum { // 12 others ... INSTALLMESSAGE_INITIALIZE , INSTALLMESSAGE_TERMINATE , INSTALLMESSAGE_SHOWDIALOG } static if(_WIN32_MSI >= 500) enum INSTALLMESSAGE_PERFORMANCE=15; static if(_WIN32_MSI >= 400)

Re: Constructing an enum using the members of an AliasSeq as enumerator names

2016-04-28 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 27 April 2016 at 15:30:55 UTC, ag0aep6g wrote: That takes longer to compile, though. Probably needs more memory as well. Thanks! Added here https://github.com/nordlow/phobos-next/blob/master/src/typecons_ex.d#L425

Re: C header file: tagged enumerations

2016-04-28 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 27 April 2016 at 16:04:13 UTC, Steven Schveighoffer wrote: BTW, this enumeration looks terrible. I would flag this as blocking if it were a code review, even in C++. -Steve Yeah, I didn't even consider that different versions have different enum values; that is going to be a

Re: relative benefit of .reserve and .length

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/28/16 9:09 AM, Basile B. wrote: Out of an appender I believe .reserve can be used to force page creation if you know that several pages will be allocated. For example for an ubyte[] when .length goes from 16 to 17 the memory block *really* allocated by realloc goes from 16 to 4096. Hm...

Re: relative benefit of .reserve and .length

2016-04-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/28/16 8:56 AM, Jay Norwood wrote: I timed some code recently and found that .reserve made almost no improvement when appending. It appears that the actual change to the length by the append had a very high overhead of something over 200 instructions executed, regardless if the .reserve was

Re: relative benefit of .reserve and .length

2016-04-28 Thread Basile B. via Digitalmars-d-learn
On Thursday, 28 April 2016 at 12:56:24 UTC, Jay Norwood wrote: I timed some code recently and found that .reserve made almost no improvement when appending. It appears that the actual change to the length by the append had a very high overhead of something over 200 instructions executed,

relative benefit of .reserve and .length

2016-04-28 Thread Jay Norwood via Digitalmars-d-learn
I timed some code recently and found that .reserve made almost no improvement when appending. It appears that the actual change to the length by the append had a very high overhead of something over 200 instructions executed, regardless if the .reserve was done. This was a simple append to

Re: C header file: tagged enumerations

2016-04-28 Thread Kagamin via Digitalmars-d-learn
enum { // 12 others ... INSTALLMESSAGE_INITIALIZE , INSTALLMESSAGE_TERMINATE , INSTALLMESSAGE_SHOWDIALOG } static if(_WIN32_MSI >= 500) enum INSTALLMESSAGE_PERFORMANCE=15; static if(_WIN32_MSI >= 400) enum INSTALLMESSAGE_RMFILESINUSE=16; static if(_WIN32_MSI >=

Re: vibe.d is blocking threads

2016-04-28 Thread Marc Schütz via Digitalmars-d-learn
On Wednesday, 27 April 2016 at 23:30:10 UTC, Nicholas Wilson wrote: On Wednesday, 27 April 2016 at 13:00:29 UTC, RuZzz wrote: Code: import std.concurrency; import core.thread; //import vibe.http.client; // If uncommented this line, the thread "worker" does not start void