|
Boost Users : |
Subject: [Boost-users] [thread] Ambiguity in variadic wait_for_all
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2017-02-03 01:38:41
A colleague recently ran into an interesting issue when upgrading some
working code from Boost 1.55 to 1.60/1.63 (and from C++03 to C++11).
The exact details are unimportant, but it was trying to get the address
of boost::wait_for_all(Iterator, Iterator), for use in a Boost.Bind call.
In 1.55, this worked fine, although of course it had to supply template
parameters that proved the parameters were not futures (thus causing
enable_if<is_future_type<F1>> to fail, disabling the two-future-args
overload of the function.
In 1.60/1.63, the variadic method is encountered instead, which lacks
any enable_if condition and thus the ambiguity between the two remains
and the compiler errors out. (When calling it directly, the variadic
one manages to get disabled as long as the iterator type lacks a wait()
method, but this doesn't apply when just getting the method address, as
it's not part of the signature.)
Should the variadic form also have enable_if? Or is this considered
user error for trying to use Bind in a variadic-compatible compiler
instead of using a lambda?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net