cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Can std::promise have multiple values?
Can std::promise have multiple values?
May 1, 2018 at 2:26pm UTC
waschbaer
(22)
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 UTC
tpb
(1495)
It only takes one type, so you need to use a struct/class.
May 1, 2018 at 2:33pm UTC
icy1
(596)
std::pair<int,int> will probably be enough
Topic archived. No new replies allowed.