core::array search functions can now work with other template types.
Previously search functions only worked when called with the same type as the array elements had. Which forced users sometimes to create dummy objects to be able to search for elements by another type. linear_search and linear_reverse_search now work with any type for which <T>::operator== is implemented. Similar binary_search now works when <T>::operator< is implemented in both directions (T < E and E < T). Note: It might be possible to further improve binary_search so only one operator< is needed (I think STL managed that somehow). So if someone likes a challenge - have a go at it! :-) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6398 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
--------------------------
|
||||
Changes in 1.9 (not yet released)
|
||||
|
||||
- core::array search functions can now work with any types as long as corresponding operator= (linear_search) or operator< (binary_search) are implemented.
|
||||
- Add checks for sane image sizes in some image loaders (so far: bmp, jpg, tga, png).
|
||||
Thanks @sfan5 for the original patch (got modified a bit): https://github.com/minetest/irrlicht/commit/dbd39120e7ed8c0c97e48e2df62347627f3c1d42
|
||||
- Add IImage::checkDataSizeLimit and make IImage getDataSizeFromFormat return size_t so image loaders can check if sizes are sane.
|
||||
|
Reference in New Issue
Block a user