Re: Template to retrieve compile-time enum member from run-time enum member?

2018-04-28 Thread Timoses via Digitalmars-d-learn
On Friday, 27 April 2018 at 14:33:36 UTC, Alex wrote: On Friday, 27 April 2018 at 13:43:47 UTC, Timoses wrote: `instantiateWith` gets called in three variations (menum.A, menum.B and menum.C). This causes instantiateWith to return TempStruct for each case of Temp... However, I was under

Re: Create variable for RedBlackTree range

2018-04-28 Thread Gerald via Digitalmars-d-learn
On Saturday, 28 April 2018 at 17:20:46 UTC, Jonathan M Davis wrote: On Saturday, April 28, 2018 16:36:41 Gerald via Digitalmars-d-learn wrote: [...] In general, you just use auto, but that's not going to work if you can't directly initialize the variable. In that case, the solution is

Re: Create variable for RedBlackTree range

2018-04-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, April 28, 2018 16:36:41 Gerald via Digitalmars-d-learn wrote: > What is the appropriate way to create a variable for the range > returned by RedBlackTree lowerBound and upperBound. For example, > given this code: > > ``` > RedBlackTree!long promptPosition = redBlackTree!long(); > >

Create variable for RedBlackTree range

2018-04-28 Thread Gerald via Digitalmars-d-learn
What is the appropriate way to create a variable for the range returned by RedBlackTree lowerBound and upperBound. For example, given this code: ``` RedBlackTree!long promptPosition = redBlackTree!long(); long row = to!long(vte.getVadjustment().getValue()); RBRange!(RBNode!long*) range; if

Re: E-mail attachment with unwanted characters

2018-04-28 Thread Vino.B via Digitalmars-d-learn
On Friday, 27 April 2018 at 18:20:46 UTC, Adam D. Ruppe wrote: On Friday, 27 April 2018 at 17:57:26 UTC, Vino.B wrote: headers.insert(to!string(Base64.encode(Content)) ~ ".\r\n"); headers.insert("--" ~ boundary ~ "."); what are those random dots for? Hi Adam, Thank you very much,

Re: Idiomatic way to add examples to dub package

2018-04-28 Thread bauss via Digitalmars-d-learn
On Saturday, 28 April 2018 at 15:11:31 UTC, FreeSlave wrote: On Friday, 27 April 2018 at 12:37:04 UTC, Basile B. wrote: On Thursday, 26 April 2018 at 18:16:01 UTC, FreeSlave wrote: Most dub packages are libraries and should provide runnable examples. What's the current idiomatic way to add

Re: Idiomatic way to add examples to dub package

2018-04-28 Thread FreeSlave via Digitalmars-d-learn
On Friday, 27 April 2018 at 12:37:04 UTC, Basile B. wrote: On Thursday, 26 April 2018 at 18:16:01 UTC, FreeSlave wrote: Most dub packages are libraries and should provide runnable examples. What's the current idiomatic way to add examples? IMO the most simple way (and the best too) is to put

Re: Virtual table in class without overloading

2018-04-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 28 April 2018 at 11:52:50 UTC, Jonathan M Davis wrote: unless you're declaring the type as a class purely so that it's forced to be a reference type. You can do a struct as a reference type too - just make it a pimpl handle.

Re: Virtual table in class without overloading

2018-04-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, April 28, 2018 11:04:56 Andrey via Digitalmars-d-learn wrote: > Hello, > I have some questions about virtual table in classes. > Example 1: > > class Test > { > void someMethod() { ... } > int anotherMethod { ... } > } > > Will this class have a vtable? > > Example 2: >

Virtual table in class without overloading

2018-04-28 Thread Andrey via Digitalmars-d-learn
Hello, I have some questions about virtual table in classes. Example 1: class Test { void someMethod() { ... } int anotherMethod { ... } } Will this class have a vtable? Example 2: class Test2 : Test { void thirdMethod() { ... } } Will this class have a vtable? In C++ these