Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-15BLI: Add a reverse method to MutableSpanJohnny Matthews
Add a method that allows a MutableSpan to reverse itself. This reverses the data in the original span object. This is a first step in extracting some functionality from nodes and making it more general. Differential Revision: https://developer.blender.org/D12485
2021-08-27Cleanup: quiet maybe-used-uninitialized warningJacques Lucke
2021-03-17BLI: support equality operator on Span and VectorJacques Lucke
This is quite convenient sometimes and is available for `std::vector` as well.
2021-03-17BLI: improve implicit conversions of spansJacques Lucke
Some conversions that should work did not work before. For example, `MutableSpan<int *> -> MutableSpan<const int *>`.
2021-02-21BLI: cleanup StringRef and Span and improve parameter validationJacques Lucke
Previously, methods like `Span.drop_front` would crash when more elements would be dropped than are available. While this is most efficient, it is not very practical in some use cases. Also other languages silently clamp the index, so one can easily write wrong code accidentally. Now, `Span.drop_front` and similar methods will only crash when n is negative. Too large values will be clamped down to their maximum possible value. While this is slightly less efficient, I did not have a case where this actually mattered yet. If it does matter in the future, we can add a separate `*_unchecked` method. This should not change the behavior of existing code.
2020-12-16BLI: constexpr Span, IndexRange, StringRef(Null/Base)Ankit Meel
Motivated by `std::string_view` being usable in const (compile-time) context. One functional change was needed for StringRef: `std::char_traits<char>::length(str)` instead of `strlen`. Reviewed By: JacquesLucke, LazyDodo Differential Revision: https://developer.blender.org/D9788
2020-09-01Fix compilation error with -Werror=array-boundsJacques Lucke
This error happened only with O2 or O3 in my tests. Casting to uintptr_t and back seems to quiet the compiler.
2020-08-14BLI: add reverse iterators, iterator constructor and Vector.insert/prependJacques Lucke
The new reverse iterators behave as the reverse iterators for contains from the standard library. Have a look at the tests to see how to use them. Using them will hopefully become easier with ranges in C++20. A Vector can now be constructed from two iterators, which is very common in the standard library. New Vector.insert methods allow adding elements in the middle of a vector. These methods should not be used often in practice, because they has a linear running time. New Vector.prepend methods allow adding elements to the beginning of a vector. These methods are O(n) as well.
2020-08-07Cleanup: use C++ style casts in various placesJacques Lucke
2020-07-23BLI: Add MutableSpan.copy_from methodJacques Lucke
2020-07-23BLI: move some tests into blenlib/testsJacques Lucke
Reviewers: sybren Differential Revision: https://developer.blender.org/D8315