The reduced-arity-extension on tuple's implicit constructors breaks conforming code. eg
#include <tuple>
#include <string>
using namespace std;
int count(tuple<string, string>) { return 2; }
int count(tuple<string, string, string>) { return 3; }
int main() {
int c = count({"abc", "def"}); // expected-error {{call to 'count' is ambiguous}}
}To fix this the I removed the reduced-arity-extension only on the implicit constructors. This breaks the following code:
std::tuple<int, int, int> foo() { return {1, 2} }But it still allows for
using Tup = std::tuple<int, int, int>;
Tup foo() { return Tup{1, 2}; }@Marshall should we provide a way to turn this ctor back on in case in breaks a bunch of real-world code? Maybe deprecate it for a release?
See also: