swap.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
swap.cpp:41:43: error: no matching function for call to 'std::vector<std::tuple<int, int, int> >::push_back(<brace-enclosed initializer list>)'
41 | S.push_back({W[i],U[i],V[i]});
| ^
In file included from /usr/include/c++/10/vector:67,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<int, int, int>]'
1187 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::tuple<int, int, int>&'}
1187 | push_back(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<int, int, int>]'
1203 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::tuple<int, int, int> >::value_type&&' {aka 'std::tuple<int, int, int>&&'}
1203 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~
swap.cpp:43:13: error: 'sort' was not declared in this scope; did you mean 'qsort'?
43 | sort(S.begin(),S.end());
| ^~~~
| qsort
swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:53:5: error: 'tie' was not declared in this scope
53 | tie(w,u,v) = S[i];
| ^~~
swap.cpp:5:1: note: 'std::tie' is defined in header '<tuple>'; did you forget to '#include <tuple>'?
4 | #include <queue>
+++ |+#include <tuple>
5 | using namespace std;
In file included from /usr/include/c++/10/vector:67,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >]':
/usr/include/c++/10/bits/stl_vector.h:487:7: required from here
/usr/include/c++/10/bits/stl_vector.h:336:35: error: invalid use of incomplete type 'class std::tuple<int, int, int>'
336 | _M_impl._M_end_of_storage - _M_impl._M_start);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/vector:60,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/type_traits:2631:11: note: declaration of 'class std::tuple<int, int, int>'
2631 | class tuple;
| ^~~~~
In file included from /usr/include/c++/10/vector:67,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; std::vector<_Tp, _Alloc>::reference = std::tuple<int, int, int>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]':
swap.cpp:53:21: required from here
/usr/include/c++/10/bits/stl_vector.h:1046:34: error: invalid use of incomplete type 'class std::tuple<int, int, int>'
1046 | return *(this->_M_impl._M_start + __n);
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/vector:60,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/type_traits:2631:11: note: declaration of 'class std::tuple<int, int, int>'
2631 | class tuple;
| ^~~~~
/usr/include/c++/10/type_traits: In instantiation of 'struct std::is_destructible<std::tuple<int, int, int> >':
/usr/include/c++/10/bits/stl_construct.h:177:51: required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = std::tuple<int, int, int>*]'
/usr/include/c++/10/bits/alloc_traits.h:738:15: required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = std::tuple<int, int, int>*; _Tp = std::tuple<int, int, int>]'
/usr/include/c++/10/bits/stl_vector.h:680:15: required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >]'
swap.cpp:8:33: required from here
/usr/include/c++/10/type_traits:844:52: error: static assertion failed: template argument must be a complete class or an unbounded array
844 | static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/vector:65,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/bits/stl_construct.h: In instantiation of 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = std::tuple<int, int, int>*]':
/usr/include/c++/10/bits/alloc_traits.h:738:15: required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = std::tuple<int, int, int>*; _Tp = std::tuple<int, int, int>]'
/usr/include/c++/10/bits/stl_vector.h:680:15: required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >]'
swap.cpp:8:33: required from here
/usr/include/c++/10/bits/stl_construct.h:177:51: error: static assertion failed: value type is destructible
177 | static_assert(is_destructible<_Value_type>::value,
| ^~~~~
/usr/include/c++/10/bits/stl_construct.h:184:25: error: invalid use of incomplete type 'std::iterator_traits<std::tuple<int, int, int>*>::value_type' {aka 'class std::tuple<int, int, int>'}
184 | std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/vector:60,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/type_traits:2631:11: note: declaration of 'std::iterator_traits<std::tuple<int, int, int>*>::value_type' {aka 'class std::tuple<int, int, int>'}
2631 | class tuple;
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/c++allocator.h:33,
from /usr/include/c++/10/bits/allocator.h:46,
from /usr/include/c++/10/vector:64,
from swap.h:1,
from swap.cpp:1:
/usr/include/c++/10/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::deallocate(_Tp*, __gnu_cxx::new_allocator<_Tp>::size_type) [with _Tp = std::tuple<int, int, int>; __gnu_cxx::new_allocator<_Tp>::size_type = long unsigned int]':
/usr/include/c++/10/bits/alloc_traits.h:492:23: required from 'static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, std::allocator_traits<std::allocator<_Tp1> >::pointer, std::allocator_traits<std::allocator<_Tp1> >::size_type) [with _Tp = std::tuple<int, int, int>; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<std::tuple<int, int, int> >; std::allocator_traits<std::allocator<_Tp1> >::pointer = std::tuple<int, int, int>*; std::allocator_traits<std::allocator<_Tp1> >::size_type = long unsigned int]'
/usr/include/c++/10/bits/stl_vector.h:354:19: required from 'void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(std::_Vector_base<_Tp, _Alloc>::pointer, std::size_t) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; std::_Vector_base<_Tp, _Alloc>::pointer = std::tuple<int, int, int>*; std::size_t = long unsigned int]'
/usr/include/c++/10/bits/stl_vector.h:335:2: required from 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >]'
/usr/include/c++/10/bits/stl_vector.h:487:7: required from here
/usr/include/c++/10/ext/new_allocator.h:135:14: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int, int>'
135 | , __t * sizeof(_Tp)
| ^~~~~~~~~~~
swap.cpp:47:20: warning: control reaches end of non-void function [-Wreturn-type]
47 | vector<int> E = {};
| ^