111
|
1 // Test that conversion to std::initializer_list takes priority over other
|
|
2 // user-defined conversions.
|
|
3
|
|
4 // { dg-do link { target c++11 } }
|
|
5
|
|
6 #include <initializer_list>
|
|
7
|
|
8 struct string
|
|
9 {
|
|
10 string (const char *) {}
|
|
11 template <class Iter> string (Iter, Iter);
|
|
12 };
|
|
13
|
|
14 template <class T, class U>
|
|
15 struct pair
|
|
16 {
|
|
17 pair (T t, U u) {}
|
|
18 };
|
|
19
|
|
20 template<class T, class U>
|
|
21 struct map
|
|
22 {
|
|
23 void insert (pair<T,U>);
|
|
24 void insert (std::initializer_list<pair<T,U> >) {}
|
|
25 };
|
|
26
|
|
27 int main()
|
|
28 {
|
|
29 map<string,string> m;
|
|
30 m.insert({ {"this","that"}, {"me","you"} });
|
|
31 }
|