Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

BTreeG: consider using a generic type for the key #62

@RaduBerinde

Description

@RaduBerinde

In many cases the T type used with BTreeG contains the key and other fields (in some cases, many other fields). It is awkward to create a "full" T object with only the key initialized just to pass to Get() or Delete() or AscendRange().

My proposal is to define K as the key type and create the btree using a LessFunc<K> as well as a func (t T) K which returns the key from a T object. Methods like Get(), Delete(), or AscendRange() would only take a K. The current BTreeG can be reimplemented in terms of this tree, with K = T.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions