want to use new with future and promise

Please note I have already gone through http://www.cplusplus.com/forum/general/234044/
but still did not solve the issue

typedef std::pair<std::string,std::promise<std::pair<bool,std::string>> * > myPair;
typedef std::promise<std::pair<bool ,std::string>> promiseObject;
typedef std::future<std::pair<bool ,std::string>> futureObject;

class myClass {

void func1();
void func2();
private:
futureObject* futureObjPtr

}

void myClass::func1() {

promiseObject* promisePtr = new promiseObject;
futureObjPtr = new futureObject ;

// please note promiseObject->set_value has been done in method of other class
futureObj = &(promiseObjectr->get_future()); ------------------- This is giving a complitaion error
myPair mPair ;
mPair.first = string("msg");
m.second = promisePtr ;
}

void myClass::func2() {
if (futureObjPtr )
}



I am getting compliation error in C++11

error: taking address of temporary [-fpermissive]

Can someone help me in solving this code
Last edited on
Topic archived. No new replies allowed.