Skip to content

Commit

Permalink
use std::less<> comparator for set so string_view lookup is supported…
Browse files Browse the repository at this point in the history
… for strings
  • Loading branch information
dirkvdb committed May 2, 2024
1 parent 987095e commit 94da72a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/infra/algo.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ std::vector<TVal> container_as_vector(const TContainer& cont)
}

template <typename TContainer, typename TVal = typename TContainer::value_type>
std::set<TVal> container_as_set(const TContainer& cont)
std::set<TVal, std::less<>> container_as_set(const TContainer& cont)
{
return std::set<TVal>(cont.begin(), cont.end());
return std::set<TVal, std::less<>>(cont.begin(), cont.end());
}

template <typename TContainer, typename TVal = typename TContainer::value_type>
Expand Down

0 comments on commit 94da72a

Please sign in to comment.