Giter Club home page Giter Club logo

sauce's People

Contributors

b4hand avatar jstasiak avatar phs avatar smithgeek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sauce's Issues

Add a pkg-config file

See this and this for details.

Future history will be more convenient if this exists before potential package maintainers ever add the library to a repo.

Great work

Hi phs, first of all I would like to mention that this is great work. Basing your work and providing signature compatibility with guice is a smart choice.

I am having the same issue as #5 (already posted here). The code is failing when it is trying to create implicit provider binding during compile time.

Issue compiling with VS2012

I have issues compiling test code. Got this "helpful" error message (in ansi_compilation_test.cc, line: binder.bind().named().toProvider<CowProvider()>();)

1>c:\dev\git\sauce\sauce\internal\implicit_bindings.h(107): error C2259: 'sauce::internal::ImplicitProviderBinding<ProvidedDependency,Name>' : cannot instantiate abstract class
1> with
1> [
1> ProvidedDependency=Animal
1> , Name=Meatloaf
1> ]
1> due to following members:
1> 'void sauce::internal::Binding<Dependency,Scope>::inject(std::shared_ptrsauce::Provider &,std::shared_ptrsauce::internal::ResolvedBinding,sauce::internal::InjectorPtr) const' : is abstract
1> with
1> [
1> Dependency=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> , Scope=sauce::NoScope
1> ]
1> c:\dev\git\sauce\sauce\internal\binding.h(45) : see declaration of 'sauce::internal::Binding<Dependency,Scope>::inject'
1> with
1> [
1> Dependency=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> , Scope=sauce::NoScope
1> ]
1> c:\dev\git\sauce\sauce\internal\implicit_bindings.h(102) : while compiling class template member function 'std::shared_ptrsauce::internal::ResolvedBinding<Dependency_> sauce::internal::ImplicitBinding::get(const sauce::internal::Concrete &,const std::string)'
1> with
1> [
1> Dependency_=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> , Dependency=Normalized
1> ]
1> c:\dev\git\sauce\sauce\internal\implicit_bindings.h(62) : see reference to function template instantiation 'std::shared_ptrsauce::internal::ResolvedBinding<Dependency_> sauce::internal::ImplicitBinding::get(const sauce::internal::Concrete &,const std::string)' being compiled
1> with
1> [
1> Dependency_=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> , Dependency=Normalized
1> ]
1> c:\dev\git\sauce\sauce\internal\implicit_bindings.h(62) : see reference to class template instantiation 'sauce::internal::ImplicitBinding' being compiled
1> with
1> [
1> Dependency=Normalized
1> ]
1> c:\dev\git\sauce\sauce\internal\bindings.h(87) : see reference to function template instantiation 'std::shared_ptrsauce::internal::ResolvedBinding<Dependency_> sauce::internal::ImplicitBindings::getProviding(const sauce::internal::Concrete &,const std::string) const' being compiled
1> with
1> [
1> Dependency_=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> , Dependency=Normalized
1> ]
1> c:\dev\git\sauce\sauce\internal\bindings.h(119) : see reference to function template instantiation 'std::shared_ptrsauce::internal::ResolvedBinding<Dependency_> sauce::internal::Bindings::getProvidingBinding(const std::string) const' being compiled
1> with
1> [
1> Dependency_=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> , ImplicitBindings=sauce::internal::ImplicitBindings
1> , Dependency=Normalized
1> ]
1> c:\dev\git\sauce\sauce\internal\bindings.h(119) : see reference to function template instantiation 'std::shared_ptrsauce::internal::ResolvedBinding<Dependency_> sauce::internal::Bindings::getProvidingBinding(const std::string) const' being compiled
1> with
1> [
1> Dependency_=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> , ImplicitBindings=sauce::internal::ImplicitBindings
1> , Dependency=Normalized
1> ]
1> c:\dev\git\sauce\sauce\internal\base_injector.h(70) : see reference to function template instantiation 'void sauce::internal::Bindings::validateAcyclic(bool,sauce::internal::Bindings::InjectorPtr,sauce::internal::TypeIds &,const std::string) const' being compiled
1> with
1> [
1> ImplicitBindings=sauce::internal::ImplicitBindings
1> ]
1> c:\dev\git\sauce\sauce\internal\base_injector.h(70) : see reference to function template instantiation 'void sauce::internal::Bindings::validateAcyclic(bool,sauce::internal::Bindings::InjectorPtr,sauce::internal::TypeIds &,const std::string) const' being compiled
1> with
1> [
1> ImplicitBindings=sauce::internal::ImplicitBindings
1> ]
1> c:\dev\git\sauce\sauce\injector.h(67) : see reference to function template instantiation 'void sauce::internal::BaseInjectorsauce::internal::ImplicitBindings::validateAcyclic(bool,sauce::internal::BaseInjectorsauce::internal::ImplicitBindings::InjectorPtr,sauce::internal::TypeIds &,const std::string) const' being compiled
1> with
1> [
1> Dependency=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> ]
1> c:\dev\git\sauce\sauce\injector.h(67) : see reference to function template instantiation 'void sauce::internal::BaseInjectorsauce::internal::ImplicitBindings::validateAcyclic(bool,sauce::internal::BaseInjectorsauce::internal::ImplicitBindings::InjectorPtr,sauce::internal::TypeIds &,const std::string) const' being compiled
1> with
1> [
1> Dependency=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> ]
1> c:\dev\git\sauce\sauce\injector.h(201) : see reference to function template instantiation 'void sauce::Injector::validateAcyclic(bool,sauce::internal::InjectorPtr,sauce::internal::TypeIds &,const std::string)' being compiled
1> with
1> [
1> Dependency=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> ]
1> c:\dev\git\sauce\sauce\internal\provider_binding.h(23) : see reference to function template instantiation 'void sauce::internal::InjectorFriend::validateAcyclicHelper(sauce::internal::InjectorPtr,sauce::internal::TypeIds &,const std::string) const' being compiled
1> with
1> [
1> Provider=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> ]
1> c:\dev\git\sauce\sauce\internal\provider_binding.h(22) : while compiling class template member function 'void sauce::internal::ProviderBinding<ProvidedDependency,Scope,ProviderDependency>::validateAcyclic(sauce::internal::InjectorPtr,sauce::internal::TypeIds &) const'
1> with
1> [
1> Scope=sauce::NoScope
1> , ProviderDependency=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> ]
1> c:\dev\git\sauce\sauce\binder.h(68) : see reference to class template instantiation 'sauce::internal::ProviderBinding<ProvidedDependency,Scope,ProviderDependency>' being compiled
1> with
1> [
1> Scope=sauce::NoScope
1> , ProviderDependency=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> ]
1> c:\dev\git\sauce\sauce\binder.h(59) : while compiling class template member function 'void sauce::ToProviderClausesauce::Named<sauce::Provider<Dependency,Meatloaf>,sauce::NoScope,CowProvider (void)>::onComplete(void)'
1> with
1> [
1> Dependency=Animal
1> ]
1> c:\dev\git\sauce\sauce\testansi.cpp(63) : see reference to class template instantiation 'sauce::ToProviderClausesauce::Named<sauce::Provider<Dependency,Meatloaf>,sauce::NoScope,CowProvider (void)>' being compiled
1> with
1> [
1> Dependency=Animal
1> ]
1>c:\dev\git\sauce\sauce\internal\implicit_bindings.h(107): error C2664: 'sauce::internal::ImplicitProviderBinding<ProvidedDependency,Name>::ImplicitProviderBinding(const sauce::internal::ImplicitProviderBinding<ProvidedDependency,Name> &)' : cannot convert parameter 2 from 'ProvidedBindingPtr' to 'std::shared_ptrsauce::internal::ResolvedBinding<Dependency_>'
1> with
1> [
1> ProvidedDependency=Animal
1> , Name=Meatloaf
1> ]
1> and
1> [
1> Dependency_=sauce::Namedsauce::Provider<Animal,Meatloaf>
1> ]
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>
1>Build FAILED.

How to `get` an instance from injector, with non-default ctor?

Hello,

I've defined a binding, like this one: bind<Smth>().to<BestSmth(int,int)>().
Now, I've created a Modules and an Injector, and I want to create an instance of Smth according to the binding above, how could I do this?
Because:

shared_ptr<Smth> s = an_injector->get<BestSmth>(42, 42);

is an error, get does not takes args for BestSmth ctor.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.