-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ShaderTools: port away from std::pair.
Here the benefit is especially clear -- as Containers::Pair is trivially copyable with trivial types, all growable arrays can make use of std::realloc() while with the STL variant a silly constructor, copy constructor, destructor had to be used. Additionally, we no longer need to take explicit care of libc++ and MSVC STL where returning a std::pair<bool, Containers::String> as return {{}, Containers::String{..., <deleter>}}; would caused an unnecessary copy instead of a move, losing the custom deleter in the process. Yay! There's a <Corrade/Containers/PairStl.h> include for backwards compatibility purposes, but obviously it would only work for the return type of validate*() and cases where an initializer list was passed to a list-of-pairs-taking functions, and not a concretely typed ArrayView. Those functions were though mostly the linker API which isn't implemented by any plugin yet, so it shouldn't be *that* breaking to users. Neverteless, I'm trying to do this breaking change rather sooner than later to prevent pain further down the road when the Vulkan APIs and SPIR-V pipeline gets widely used.
- Loading branch information
Showing
8 changed files
with
226 additions
and
229 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.