Giter Club home page Giter Club logo

Comments (2)

poletti-marco avatar poletti-marco commented on June 20, 2024

TL;DR: use bindInstance(*engine) and it compiles.

You're calling bindInstance(engine) but engine is an Engine* and bindInstance() takes a reference. Fruit should really give you a better error message in this case though, it was very unclear from the message. I've now submitted a fix (that will be in the next Fruit release) to report the following error instead:

test_saturn.cpp: In function ‘fruit::Component<Car> getTestCarComponent(Engine*)’:
test_saturn.cpp:15:29: error: use of deleted function ‘void fruit::PartialComponent<Bindings>::bindInstance(C*) [with C = Engine; Bindings = {fruit::impl::InstallComponent<fruit::Component<fruit::Required<Engine>, Car> >}]’
         .bindInstance(engine);
                             ^
In file included from /home/marco/projects/fruit/include/fruit/fruit.h:28:0,
                 from test_saturn.cpp:2:
/home/marco/projects/fruit/include/fruit/component.h:216:8: note: declared here
   void bindInstance(C* p) = delete;
        ^

So, obligatory:

Any pointers here?

Yes, one too many in fact :-)

from fruit.

durandj avatar durandj commented on June 20, 2024

Well that was a silly mistake I created for myself. Thanks for the
"pointer" ;)

On Aug 28, 2016 09:40, "poletti-marco" [email protected] wrote:

TL;DR: use bindInstance(*engine) and it compiles.

You're calling bindInstance(engine) but engine is an Engine* and
bindInstance() takes a reference. Fruit should really give you a better
error message in this case though, it was very unclear from the message.
I've now submitted a fix (that will be in the next Fruit release) to report
the following error instead:

test_saturn.cpp: In function ‘fruit::Component getTestCarComponent(Engine_)’:
test_saturn.cpp:15:29: error: use of deleted function ‘void fruit::PartialComponent::bindInstance(C_) [with C = Engine; Bindings = {fruit::impl::InstallComponentfruit::Component<fruit::Required<Engine, Car> >}]’
.bindInstance(engine);
^
In file included from /home/marco/projects/fruit/include/fruit/fruit.h:28:0,
from test_saturn.cpp:2:
/home/marco/projects/fruit/include/fruit/component.h:216:8: note: declared here
void bindInstance(C* p) = delete;
^

So, obligatory:

Any pointers here?

Yes, one too many in fact :-)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#25 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGpPjkwQqiN3bl349K_lDC3Dn-h5Z5b5ks5qkZ3ugaJpZM4JuQn_
.

from fruit.

Related Issues (20)

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.