Re: Create variable for RedBlackTree range

2018-05-02 Thread Meta via Digitalmars-d-learn
On Wednesday, 2 May 2018 at 10:39:29 UTC, ag0aep6g wrote: On 04/28/2018 06:36 PM, Gerald 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 =

Re: Create variable for RedBlackTree range

2018-05-02 Thread ag0aep6g via Digitalmars-d-learn
On 04/28/2018 06:36 PM, Gerald 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(); long row =

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