Author
anonymous
over 7 years ago
Language
Compiler
Options
Author
anonymous
over 7 years ago
$
In file included from /opt/wandbox/gcc-7.2.0/include/c++/7.2.0/algorithm:62:0,
from prog.cc:1:
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = std::_Rb_tree_iterator<std::pair<const int, double> >; _Funct = main()::<lambda(std::pair<int, double>&)>]':
prog.cc:8:96: required from here
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_algo.h:3884:5: error: no match for call to '(main()::<lambda(std::pair<int, double>&)>) (std::pair<const int, double>&)'
__f(*__first);
~~~^~~~~~~~~~
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_algo.h:3884:5: note: candidate: void (*)(std::pair<int, double>&) <conversion>
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_algo.h:3884:5: note: conversion of argument 2 would be ill-formed:
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_algo.h:3884:5: error: cannot bind non-const lvalue reference of type 'std::pair<int, double>&' to an rvalue of type 'std::pair<int, double>'
In file included from /opt/wandbox/gcc-7.2.0/include/c++/7.2.0/utility:70:0,
from /opt/wandbox/gcc-7.2.0/include/c++/7.2.0/algorithm:60,
from prog.cc:1:
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_pair.h:280:19: note: after user-defined conversion: constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = const int; _U2 = double; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = 1; _T1 = int; _T2 = double]
constexpr pair(const pair<_U1, _U2>& __p)
^~~~
prog.cc:8:75: note: candidate: main()::<lambda(std::pair<int, double>&)> <near match>
std::for_each(std::begin(m), std::end(m), [](std::pair<int, double>& e){ e.second += 1.0; });
^
prog.cc:8:75: note: conversion of argument 1 would be ill-formed:
In file included from /opt/wandbox/gcc-7.2.0/include/c++/7.2.0/algorithm:62:0,
from prog.cc:1:
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_algo.h:3884:5: error: cannot bind non-const lvalue reference of type 'std::pair<int, double>&' to an rvalue of type 'std::pair<int, double>'
__f(*__first);
~~~^~~~~~~~~~
In file included from /opt/wandbox/gcc-7.2.0/include/c++/7.2.0/utility:70:0,
from /opt/wandbox/gcc-7.2.0/include/c++/7.2.0/algorithm:60,
from prog.cc:1:
/opt/wandbox/gcc-7.2.0/include/c++/7.2.0/bits/stl_pair.h:280:19: note: after user-defined conversion: constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = const int; _U2 = double; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = 1; _T1 = int; _T2 = double]
constexpr pair(const pair<_U1, _U2>& __p)
^~~~
Exit Code:
1