Coder Social home page Coder Social logo

Comments (7)

timoalho avatar timoalho commented on September 18, 2024

I have to agree with this, the fact that the type of the caller appears in the type of the delegate seems to defeat the whole purpose of the delegate...

If I say, for example

void set_delegate(delegate<void (*) (int, int)>) {
//...store the delegate somewhere
}

then

set_delegate(make_delegate(&MyClass::foo, myClassInstance));

does not compile.

from delegates.

jcelerier avatar jcelerier commented on September 18, 2024

+1, bitten with this.
You should at least change the examples on the front page because they give hope that the delegate is able to do this.

from delegates.

jcelerier avatar jcelerier commented on September 18, 2024

@marcmo Wouldn't C++17's template argument deduction help overcome this ?

from delegates.

marcmo avatar marcmo commented on September 18, 2024

you are of course right guys...I overlooked this in my enthusiasm to get rid of some template syntax by using macros...
will probably switch back to using the more verbose but working syntax. @jcelerier C++17 might help but then again this library was meant to be used in scenarios where you cannot expect more then C++98 => highly portable but still really good performance.

from delegates.

koemeet avatar koemeet commented on September 18, 2024

just noticed this as well, any plans on maybe providing a working branch or tag a certain commit in which it was working as described in this issue?

from delegates.

marcmo avatar marcmo commented on September 18, 2024

Hi @koemeet, I will provide an updated version soon. totally forgot about it.

from delegates.

hparracho avatar hparracho commented on September 18, 2024

Hi @marcmo! Was this issue dropped or do you still have plans to update the class?

from delegates.

Related Issues (6)

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.