Opened 7 years ago
Closed 7 years ago
#833 closed defect (duplicate)
get functions doesn't allow implicit conversion
Reported by: | Peter | Owned by: | Peter |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | utility | Version: | trunk |
Keywords: | Cc: |
Description
The function 'get
' doesn't allow implicit conversion of second argument
template <typename Key, typename Tp, typename Compare, typename Alloc> const Tp& get(const std::map<Key, Tp, Compare, Alloc>& m, const Key& key)
For instance, I have a map<string, size_t> m
and I try to call get
with
get(m, "foo");
which doesn't work because the "foo" is a char[4] and not an std::string
no matching function for call to ‘get(std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int> > >&, const char [4])’
Change History (3)
comment:1 Changed 7 years ago by
Milestone: | yat 0.x+ → yat 0.14 |
---|
comment:2 Changed 7 years ago by
Status: | new → assigned |
---|
comment:3 Changed 7 years ago by
Milestone: | yat 0.14 |
---|---|
Resolution: | → duplicate |
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
duplicate of #799