Record Detail

Compile Error

In file included from /in/driver/main.cpp:1:0:
/in/shortestP2P.hpp: In member function 'void ShortestP2P::readGraph()':
/in/shortestP2P.hpp:77:31: error: no match for 'operator=' (operand types are 'std::vector<std::pair<int, int> >' and 'bool')
                       valid = false;
                               ^~~~~
In file included from /usr/include/c++/7/vector:69:0,
                 from /in/shortestP2P.hpp:3,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/vector.tcc:179:5: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]
     vector<_Tp, _Alloc>::
     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/vector.tcc:179:5: note:   no known conversion for argument 1 from 'bool' to 'const std::vector<std::pair<int, int> >&'
In file included from /usr/include/c++/7/vector:64:0,
                 from /in/shortestP2P.hpp:3,
                 from /in/driver/main.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:461:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]
       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:461:7: note:   no known conversion for argument 1 from 'bool' to 'std::vector<std::pair<int, int> >&&'
/usr/include/c++/7/bits/stl_vector.h:482:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]
       operator=(initializer_list<value_type> __l)
       ^~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:482:7: note:   no known conversion for argument 1 from 'bool' to 'std::initializer_list<std::pair<int, int> >'
In file included from /in/driver/main.cpp:1:0:
/in/shortestP2P.hpp: In member function 'void ShortestP2P::distance(unsigned int, unsigned int)':
/in/shortestP2P.hpp:108:18: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
         if(valid = false)
            ~~~~~~^~~~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 4
Language
C++
Submit At
2024-08-03 13:04:46
Judged At
2024-08-03 13:04:46
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes