Blender Git Commit Log

Git Commits -> Revision c521b69

Revision c521b69 by Jacques Lucke (master)
August 10, 2020, 16:17 (GMT)
BLI: improve StringRef for C++17

Since C++17 there is also std::string_view, which is similar to StringRef.
This commit does a couple of things:
* New implicit conversions between StringRef and std::string_view.
* Support std::string_view in blender::DefaultHash.
* Support most of the methods that std::string_view has.
* Add StringRef::not_found which can be used instead of -1 in some places.
* Improve/fix the description at the top of BLI_string_ref.hh.

Commit Details:

Full Hash: c521b69ffb68df17d6b8e1c71d23924a8b9b9cf3
Parent Commit: 53d203d
Lines Changed: +197, -12

4 Modified Paths:

/source/blender/blenlib/BLI_hash.hh (+7, -0) (Diff)
/source/blender/blenlib/BLI_string_ref.hh (+156, -12) (Diff)
/source/blender/blenlib/tests/BLI_set_test.cc (+10, -0) (Diff)
/source/blender/blenlib/tests/BLI_string_ref_test.cc (+24, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021