@@ -2598,96 +2598,3 @@ ref V[K] insert(V, K, IndexIterator, Iterator, size_t N, SliceKind kind)(return
25982598 a.insert = s;
25992599 assert (a.series == series([1 , 2 , 3 , 4 ], [3.0 , 20 , 30 , 2 ]));
26002600}
2601-
2602-
2603- static if (__VERSION__ < 2078 )
2604- // ////////////////// OBJECT.d
2605- {
2606-
2607- private :
2608-
2609- extern (C )
2610- {
2611- // from druntime/src/rt/aaA.d
2612-
2613- // size_t _aaLen(in void* p) pure nothrow @nogc;
2614- private void * _aaGetY (void ** paa, const TypeInfo_AssociativeArray ti, in size_t valuesize, in void * pkey) pure nothrow ;
2615- // inout(void)* _aaGetRvalueX(inout void* p, in TypeInfo keyti, in size_t valuesize, in void* pkey);
2616- inout (void )[] _aaValues (inout void * p, in size_t keysize, in size_t valuesize, const TypeInfo tiValArray) pure nothrow ;
2617- inout (void )[] _aaKeys (inout void * p, in size_t keysize, const TypeInfo tiKeyArray) pure nothrow ;
2618- void * _aaRehash (void ** pp, in TypeInfo keyti) pure nothrow ;
2619- void _aaClear (void * p) pure nothrow ;
2620-
2621- // alias _dg_t = extern(D) int delegate(void*);
2622- // int _aaApply(void* aa, size_t keysize, _dg_t dg);
2623-
2624- // alias _dg2_t = extern(D) int delegate(void*, void*);
2625- // int _aaApply2(void* aa, size_t keysize, _dg2_t dg);
2626-
2627- // private struct AARange { void* impl; size_t idx; }
2628- alias AARange = ReturnType! (object._aaRange);
2629- AARange _aaRange (void * aa) pure nothrow @nogc @safe ;
2630- bool _aaRangeEmpty (AARange r) pure nothrow @nogc @safe ;
2631- void * _aaRangeFrontKey (AARange r) pure nothrow @nogc @safe ;
2632- void * _aaRangeFrontValue (AARange r) pure nothrow @nogc @safe ;
2633- void _aaRangePopFront (ref AARange r) pure nothrow @nogc @safe ;
2634-
2635- }
2636-
2637- auto byKeyValue (T : V[K], K, V)(T aa) pure nothrow @nogc @safe
2638- {
2639- import core.internal.traits : substInout;
2640-
2641- static struct Result
2642- {
2643- AARange r;
2644-
2645- pure nothrow @nogc :
2646- @property bool empty() @safe { return _aaRangeEmpty(r); }
2647- @property auto front()
2648- {
2649- static struct Pair
2650- {
2651- // We save the pointers here so that the Pair we return
2652- // won't mutate when Result.popFront is called afterwards.
2653- private void * keyp;
2654- private void * valp;
2655-
2656- @property ref key() inout
2657- {
2658- auto p = (() @trusted => cast (substInout! K* ) keyp) ();
2659- return * p;
2660- };
2661- @property ref value() inout
2662- {
2663- auto p = (() @trusted => cast (substInout! V* ) valp) ();
2664- return * p;
2665- };
2666- }
2667- return Pair (_aaRangeFrontKey(r),
2668- _aaRangeFrontValue(r));
2669- }
2670- void popFront () @safe { return _aaRangePopFront(r); }
2671- @property Result save() { return this ; }
2672- }
2673-
2674- return Result (_aaToRange(aa));
2675- }
2676-
2677- auto byKeyValue (T : V[K], K, V)(T* aa) pure nothrow @nogc
2678- {
2679- return (* aa).byKeyValue ();
2680- }
2681-
2682- // this should never be made public.
2683- private AARange _aaToRange (T: V[K], K, V)(ref T aa) pure nothrow @nogc @safe
2684- {
2685- // ensure we are dealing with a genuine AA.
2686- static if (is (const (V[K]) == const (T)))
2687- alias realAA = aa;
2688- else
2689- const (V[K]) realAA = aa;
2690- return _aaRange (() @trusted { return cast (void * )realAA; } ());
2691- }
2692-
2693- }
0 commit comments