github google/fruit v3.1.0
Fruit 3.1.0

latest releases: v3.7.1, v3.7.0, v3.6.0...
6 years ago

This is the first minor release in the 3.x branch.

New functionality

  • Visual Studio 2015 is now officially supported (in addition to Visual Studio 2017), thanks to a contribution by @MrElusive.
  • Fruit now reports a compile time error when a class must have a virtual destructor but doesn't have one, instead of resulting in undefined behavior at runtime when that class is destroyed during the injector destruction. Specifically, the following cases now result in a compile-time error:
    • registerProvider() called with a lambda that returns a pointer to an abstract class with no virtual destructor
    • registerMultibindingProvider() called with a lambda that returns a pointer to an abstract class with no virtual destructor
    • registerFactory() called with a lambda that returns a std::unique_ptr<T>, with T an abstract class with no virtual destructor
    • bind<I, C>() used to bind a std::function<std::unique_ptr<I>(Args...)> to a std::function<std::unique_ptr<C>(Args...)> and I doesn't have a virtual destructor

Bug fixes

  • Update the Fruit test suite to work with recent versions of Bazel (e.g. 0.7.0)
  • Fix a bug in Fruit that might have caused undefined behavior when using a STL implementation that doesn't implement std::allocator::deallocate using malloc(). This bug did not affect GCC's STL, nor Clang's libc++ nor MSVC's STL implementation, but it could have affected non-standard STL implementations.
  • No longer trigger compiler warnings with recent versions of Clang.

Installation

See the installation instructions here for how to compile from source and for links to pre-built binary packages for various Linux distributions.

Don't miss a new fruit release

NewReleases is sending notifications on new releases.