the function is a std::function<void(string a) write;
ok.... it's void.... but why the error about it???
what means these error?

Recommended Answers

All 4 Replies

Should be something like the following:

int foo(double a) {

    return a;

std::function<void(double)> call_foo = &foo;

i'm confuse the 'void' isn't the return type?

see these exemple:

#include <iostream>
#include <functional>

using namespace std;

class test
    function<void(void)> Message;

class a: public test

void a::Message=[]()
    cout << "hello world";

int main()
    return 0;

error: "variable or field 'Message' declared void"
why these error?

int main(){

std::fuction<void(const &a,void)>pp =&a::message();
return 0;

you need to write your class well. look into it more cpp0x help on fuctional.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.