Borderou de evaluare (job #797108)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Gadfadăr (clasa 6-7) | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 23 nov. 2024 15:21:36 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:37:23: error: 'make_tuple' was not declared in this scope
37 | persoane[i] = make_tuple(nume, id, nr_soldati);
| ^~~~~~~~~~
main.cpp:6:1: note: 'std::make_tuple' is defined in header '<tuple>'; did you forget to '#include <tuple>'?
5 | #include <cmath>
+++ |+#include <tuple>
6 |
main.cpp:42:29: error: no matching function for call to 'get<0>(__gnu_cxx::__alloc_traits<std::allocator<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >::value_type&)'
42 | string nume = get<0>(persoane[i]);
| ~~~~~~^~~~~~~~~~~~~
In file included from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:64,
from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/string:51,
from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/locale_classes.h:40,
from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/ios_base.h:41,
from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/ios:44,
from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/ostream:40,
from /usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/iostream:41,
from main.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1035:5: note: candidate: 'template<unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)'
1035 | get(pair<_Tp1, _Tp2>& __in) noexcept
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1035:5: note: template argument deduction/substitution failed:
main.cpp:42:29: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >::value_type' {aka 'std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int>'} is not derived from 'std::pair<_Tp1, _Tp2>'
42 | string nume = get<0>(persoane[i]);
| ~~~~~~^~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1040:5: note: candidate: 'template<unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(pair<_Tp1, _Tp2>&&)'
1040 | get(pair<_Tp1, _Tp2>&& __in) noexcept
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1040:5: note: template argument deduction/substitution failed:
main.cpp:42:29: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >::value_type' {aka 'std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int>'} is not derived from 'std::pair<_Tp1, _Tp2>'
42 | string nume = get<0>(persoane[i]);
| ~~~~~~^~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1045:5: note: candidate: 'template<unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const pair<_Tp1, _Tp2>&)'
1045 | get(const pair<_Tp1, _Tp2>& __in) noexcept
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
main.cpp:42:29: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >::value_type' {aka 'std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int>'} is not derived from 'const std::pair<_Tp1, _Tp2>'
42 | string nume = get<0>(persoane[i]);
| ~~~~~~^~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1050:5: note: candidate: 'template<unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const pair<_Tp1, _Tp2>&&)'
1050 | get(const pair<_Tp1, _Tp2>&& __in) noexcept
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1050:5: note: template argument deduction/substitution failed:
main.cpp:42:29: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int> >::value_type' {aka 'std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long long int, long long int>'} is not derived from 'const std::pair<_Tp1, _Tp2>'
42 | string nume = get<0>(persoane[i]);
| ~~~~~~^~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/13/include/g++-v13/bits/stl_pair.h:1059:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_T1, _T2>&)'
1059 | get(pair<_Tp, _Up>& __p) noexcept
| ^~~