-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(strutil.h): ensure proper constexpr of string hashing (#3901)
The underlying farmhash algorithm (which is the basis for Strutil::strhash, and thus ustring's hash representation) turned out to not be properly constexpr under certain circumstances and needed to be expressed a different way to be fully constexpr on all platforms and for all strings. New implementation suggested by Alex Wells. Also, make sure string_view ctr from char* can be constexpr, even for C++14. This is related for the sake of the strhash calls that, when taking string literals, actually choose the variety that accepts a string_view. Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
3 changed files
with
83 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters