~> cat t.cc
#include <map>
struct s {
bool member = false;
};
std::map<int, s> my_map{
{ 1, { false } },
{ 2, { true } }
};
int main()
{
return 0;
}
~> g++ -std=c++11 t.cc
t.cc:10:1: error: no matching function for call to ‘std::map<int, s>::map(<brace-enclosed initializer list>)’
};
^
t.cc:10:1: note: candidates are:
In file included from /usr/include/c++/4.9.1/map:61:0,
from t.cc:1:
/usr/include/c++/4.9.1/bits/stl_map.h:270:9: note: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const _Compare&, const allocator_type&)
map(_InputIterator __first, _InputIterator __last,
^
/usr/include/c++/4.9.1/bits/stl_map.h:270:9: note: template argument deduction/substitution failed:
t.cc:10:1: note: candidate expects 4 arguments, 2 provided
};
^
In file included from /usr/include/c++/4.9.1/map:61:0,
from t.cc:1:
/usr/include/c++/4.9.1/bits/stl_map.h:253:9: note: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator)
map(_InputIterator __first, _InputIterator __last)
^
/usr/include/c++/4.9.1/bits/stl_map.h:253:9: note: template argument deduction/substitution failed:
t.cc:10:1: note: couldn't deduce template parameter ‘_InputIterator’
};
^
In file included from /usr/include/c++/4.9.1/map:61:0,
from t.cc:1:
/usr/include/c++/4.9.1/bits/stl_map.h:236:9: note: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const allocator_type&)
map(_InputIterator __first, _InputIterator __last,
^
/usr/include/c++/4.9.1/bits/stl_map.h:236:9: note: template argument deduction/substitution failed:
t.cc:10:1: note: candidate expects 3 arguments, 2 provided
};
^
In file included from /usr/include/c++/4.9.1/map:61:0,
from t.cc:1:
/usr/include/c++/4.9.1/bits/stl_map.h:230:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const allocator_type&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, s> >]
map(initializer_list<value_type> __l, const allocator_type& __a)
^
/usr/include/c++/4.9.1/bits/stl_map.h:230:7: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::initializer_list<std::pair<const int, s> >’
/usr/include/c++/4.9.1/bits/stl_map.h:224:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&, const allocator_type&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, s> >]
map(map&& __m, const allocator_type& __a)
^
/usr/include/c++/4.9.1/bits/stl_map.h:224:7: note: no known conversion for argument 2 from ‘<brace-enclosed initializer list>’ to ‘const allocator_type& {aka const std::allocator<std::pair<const int, s> >&}’
/usr/include/c++/4.9.1/bits/stl_map.h:220:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&, const allocator_type&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, s> >]
map(const map& __m, const allocator_type& __a)
^
/usr/include/c++/4.9.1/bits/stl_map.h:220:7: note: no known conversion for argument 2 from ‘<brace-enclosed initializer list>’ to ‘const allocator_type& {aka const std::allocator<std::pair<const int, s> >&}’
/usr/include/c++/4.9.1/bits/stl_map.h:216:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(const allocator_type&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, s> >]
map(const allocator_type& __a)
^
/usr/include/c++/4.9.1/bits/stl_map.h:216:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/4.9.1/bits/stl_map.h:208:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Compare&, const allocator_type&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, s> >]
map(initializer_list<value_type> __l,
^
/usr/include/c++/4.9.1/bits/stl_map.h:208:7: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::initializer_list<std::pair<const int, s> >’
/usr/include/c++/4.9.1/bits/stl_map.h:193:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >]
map(map&& __x)
^
/usr/include/c++/4.9.1/bits/stl_map.h:193:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/4.9.1/bits/stl_map.h:182:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >]
map(const map& __x)
^
/usr/include/c++/4.9.1/bits/stl_map.h:182:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/4.9.1/bits/stl_map.h:171:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map(const _Compare&, const allocator_type&) [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, s> >]
map(const _Compare& __comp,
^
/usr/include/c++/4.9.1/bits/stl_map.h:171:7: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::less<int>&’
/usr/include/c++/4.9.1/bits/stl_map.h:162:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::map() [with _Key = int; _Tp = s; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, s> >]
map()
^
/usr/include/c++/4.9.1/bits/stl_map.h:162:7: note: candidate expects 0 arguments, 2 provided
|