What does "(this This)" mean in member function templates?

Nathan S. no.public.email at example.com
Mon Feb 12 08:35:05 UTC 2018


For example in std.container.rbtree:

---
     auto equalRange(this This)(Elem e)
     {
         auto beg = _firstGreaterEqual(e);
         alias RangeType = RBRange!(typeof(beg));
         if (beg is _end || _less(e, beg.value))
             // no values are equal
             return RangeType(beg, beg);
         static if (allowDuplicates)
         {
             return RangeType(beg, _firstGreater(e));
         }
         else
         {
             // no sense in doing a full search, no duplicates are 
allowed,
             // so we just get the next node.
             return RangeType(beg, beg.next);
         }
     }
---


More information about the Digitalmars-d-learn mailing list