[libcxx-commits] [libcxx] [libc++] P2165R4: Update deduction guides for map containers and container adaptors (PR #136011)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 29 20:23:46 PDT 2025
================
@@ -101,6 +103,18 @@ int main(int, char**) {
std::map m(PC{1, 1L});
// expected-error-re at -1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}map'}}
}
-
+ {
+ // cannot deduce from tuple-like objects without proper iterator
+ std::tuple<int, double> t{1, 2.0};
+ std::map m(t);
+ // expected-error-re at -1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}map'}}
+ }
+ {
+ // cannot deduce from array-like objects without proper iterator
+ std::array<int, 2> arr{1, 2};
+ std::map m(arr);
+ // expected-error-re at -1{{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}map'}}
+ }
+
----------------
frederick-vs-ja wrote:
LGTM with format issue resolved.
```suggestion
```
https://github.com/llvm/llvm-project/pull/136011
More information about the libcxx-commits
mailing list