main.cpp: In function 'int main()':
main.cpp:58:3: error: static assertion failed
static_assert(sizeof(BfsVisitor<char>) <= 2*sizeof(char*));
^~~~~~~~~~~~~
In file included from main.cpp:55:0:
visitor.h: In instantiation of 'size_t BfsVisitor<Vertex>::DistanceTo(const Vertex&) const [with Vertex = int; size_t = long unsigned int]':
main.cpp:65:29: required from here
visitor.h:20:48: error: passing 'const std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >' as 'this' argument discards qualifiers [-fpermissive]
Vertex parent_of_target = parent_[current_target];
~~~~~~~^
In file included from /usr/include/c++/7/map:61:0,
from visitor.h:1,
from main.cpp:55:
/usr/include/c++/7/bits/stl_map.h:484:7: note: in call to 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]'
operator[](const key_type& __k)
^~~~~~~~
In file included from main.cpp:55:0:
visitor.h: In instantiation of 'Vertex BfsVisitor<Vertex>::Parent(const Vertex&) const [with Vertex = int]':
main.cpp:68:25: required from here
visitor.h:30:25: error: passing 'const std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >' as 'this' argument discards qualifiers [-fpermissive]
return parent_[vertex];
~~~~~~~^
In file included from /usr/include/c++/7/map:61:0,
from visitor.h:1,
from main.cpp:55:
/usr/include/c++/7/bits/stl_map.h:484:7: note: in call to 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]'
operator[](const key_type& __k)
^~~~~~~~
|