[TYPE_SAFE_UNION] simplified some type traits and added for_each(). (#2475)
* [TYPE_SAFE_UNION] simplified some type traits and added for_each(). * added example serialization/deserialization using typeid().hash_code and different type_safe_union types * in_place_tag is an empty struct. so don't pass const references, you're unecessarily passing 8 bytes around for now reason * - added variant_size for type_safe_union - added variant_alternative for type_safe_union - removed for type_safe_union::for_each() and replaced with global function dlib::for_each_type() * - made visit() a global * use dlib::invoke explicitly * - for_each_type is implemented using fold expression (or whatever the right term is) instead of template recursion. This method, in theory, yields better compile times. And if you're familiar with parameter packs, then the implementation is easier to read. * - refactoring - reordered function parameters in for_each_type() - vtable implementation of apply_to_contents and visit() (sorry Davis for yet another change) * add option to not zero out gradients and method to do it (#2477) * Avoid different kinds of compiler warnings (#2481) * Avoid different kinds of compiler warnings that started to appear when upgrading my build environment * Avoid more compiler warnings * Revert the overly verbose static_cast changes * Make resize_bilinear and resize_bilinear_gradient take long long (previously just long) * Circumvent what appears to be a bug in Visual Studio 2019's optimizer (see: https://forum.juce.com/t/warning-in-the-lastest-vs2019/38267 ) * Fix MSVC pragma warnings with other compilers (#2483) * Fix warning about unused zero_gradients parameter (#2487) * Fix warning about unused zero_gradients parameter * match signature of other methods * cleanup Co-authored-by:pfeatherstone <peter@me> Co-authored-by:
Adrià Arrufat <1671644+arrufat@users.noreply.github.com> Co-authored-by:
Juha Reunanen <juha.reunanen@tomaattinen.com> Co-authored-by:
Davis King <davis@dlib.net>
Showing
This diff is collapsed.
Please register or sign in to comment