Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <iterator>
- #include <map>
- #include <string>
- #include <vector>
- std::vector<int> GetValuesAt(
- const std::multimap<std::string, std::string>& in,
- const std::string& key) {
- std::vector<int> out;
- std::transform(
- in.lower_bound(key),
- in.upper_bound(key),
- std::back_inserter(out),
- [](const std::string& value) {
- return std::stoi(value);
- });
- return out;
- }
- In file included from <source>:1:
- /opt/compiler-explorer/clang-trunk-20200401/bin/../include/c++/v1/algorithm:1948:21: error: no matching function for call to object of type '(lambda at <source>:15:9)'
- *__result = __op(*__first);
- ^~~~
- <source>:11:10: note: in instantiation of function template specialization 'std::__1::transform<std::__1::__map_const_iterator<std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void *> *, long>>, std::__1::back_insert_iterator<std::__1::vector<int, std::__1::allocator<int>>>, (lambda at <source>:15:9)>' requested here
- std::transform(
- ^
- <source>:15:9: note: candidate function not viable: no known conversion from 'const std::__1::__map_const_iterator<std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void *> *, long>>::value_type' (aka 'const pair<const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>') to 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char>>') for 1st argument
- [](const std::string& value) {
- ^
- <source>:15:9: note: conversion candidate of type 'int (*)(const std::string &)' (aka 'int (*)(const basic_string<char, char_traits<char>, allocator<char>> &)')
- 1 error generated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement