Exemplo n.º 1
0
        /// <summary>
        ///     Finds a key-value mapping associated with the least key strictly greater than the given key.
        ///     Outputs the valuePair if found and returns true.  Otherwise, returns false.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="valuePair"></param>
        /// <returns></returns>
        public bool TryGreaterThan(
            TK1 key,
            out KeyValuePair <TK1, TV1> valuePair)
        {
            if (_subDictionaryOrdered.TryGreaterThan(KeyIn(key), out var kvp))
            {
                valuePair = new KeyValuePair <TK1, TV1>(KeyOut(kvp.Key), ValueOut(kvp.Value));
                return(true);
            }

            valuePair = default;
            return(false);
        }