Can std::promise have multiple values?

May 1, 2018 at 2:26pm
Is the following code available? I.e. is that possible that I pass multiple values into the channel between std::promise and the associated std::future? If only one value is allowed, should I use struct?

 
  std::promise<int,int> myPromise;
May 1, 2018 at 2:33pm
It only takes one type, so you need to use a struct/class.
May 1, 2018 at 2:33pm
std::pair<int,int> will probably be enough
Topic archived. No new replies allowed.