Giter VIP home page Giter VIP logo

Comments (6)

qhq16 avatar qhq16 commented on June 14, 2024 1

用bind绑定类成员函数就可以使用commit了

from threadpool.

qhq16 avatar qhq16 commented on June 14, 2024

参数带在bind里啊,为什么不能带参数

from threadpool.

windflowerly avatar windflowerly commented on June 14, 2024

晓得了。参数类型问题。

from threadpool.

ZhuZouRong avatar ZhuZouRong commented on June 14, 2024

这个是只能调用threadpool自己的成员函数吗

from threadpool.

ZhuZouRong avatar ZhuZouRong commented on June 14, 2024

namespace dao
{
class Impl : public IStore
{
public:
virtual int del(const std::string& strId);
};

std::threadpool executor;
std::future test = executor.commit(std::bind(&dao::Impl::del, "id"));

是这样调用吗
编译报错 required from here
/usr/include/c++/5/functional:1426:7: error: static assertion failed: Wrong number of arguments for pointer-to-member
static_assert(_Varargs::value

from threadpool.

qhq16 avatar qhq16 commented on June 14, 2024

bind绑定非静态成员函数需要类对象指针,而且你绑定的是虚函数,你可以看看bind的用法

from threadpool.

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.