Closed Tessil closed 6 years ago
Add a longest_prefix method to find the key in the trie which is the longest prefix of a given value (#13).
longest_prefix
tsl::htrie_set<char> map = {"/foo", "/foo/bar"}; map.longest_prefix("/foo"); // returns "/foo" map.longest_prefix("/foo/baz"); // returns "/foo" map.longest_prefix("/foo/bar/baz"); // returns "/foo/bar" map.longest_prefix("/foo/bar/"); // returns "/foo/bar" map.longest_prefix("/bar"); // returns end() map.longest_prefix(""); // returns end()
Add a
longest_prefix
method to find the key in the trie which is the longest prefix of a given value (#13).