Author
anonymous
about 7 years ago
Language
C++
Compiler
gcc HEAD 9.0.0 20180915 (experimental)
Options
Warnings
Boost 1.67.0
C++17
no pedantic
Author
anonymous
about 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.67.0/gcc-head/include -std=c++17
prog.cc: In instantiation of 'main()::<lambda(const auto:16&, const auto:17&)> [with auto:16 = int; auto:17 = int]':
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2334:26: required by substitution of 'template<class _Fn, class ... _Args> static std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)), std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn = main()::<lambda(const auto:16&, const auto:17&)>; _Args = {const int&, const int&}]'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2345:55: required from 'struct std::__result_of_impl<false, false, main()::<lambda(const auto:16&, const auto:17&)>, const int&, const int&>'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2750:12: recursively required by substitution of 'template<class _Result, class _Ret> struct std::__is_invocable_impl<_Result, _Ret, std::__void_t<typename _Result::type> > [with _Result = std::__invoke_result<main()::<lambda(const auto:16&, const auto:17&)>, const int&, const int&>; _Ret = void]'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2750:12: required from 'struct std::is_invocable<main()::<lambda(const auto:16&, const auto:17&)>, const int&, const int&>'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2787:27: required from 'constexpr const bool std::is_invocable_v<main()::<lambda(const auto:16&, const auto:17&)>, const int&, const int&>'
prog.cc:312:78: required from 'auto graph::make_dijkstra_searcher(TCostCalculator, TNodeCompare) [with TVertexType = int; TCostCalculator = main()::<lambda(const auto:16&, const auto:17&)>; TNodeCompare = std::less<void>]'
prog.cc:552:136: required from here
prog.cc:552:97: warning: unused parameter '_from' [-Wunused-parameter]
552 | search_path_and_print(1, 6, neighbourFinder, graph::make_dijkstra_searcher<int>([](const auto& _from, const auto& _to) { return _to; }));
| ~~~~~~~~~~~~^~~~~
prog.cc: In instantiation of 'main()::<lambda(const auto:18&, const auto:19&)> [with auto:18 = int; auto:19 = int]':
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2334:26: required by substitution of 'template<class _Fn, class ... _Args> static std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)), std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn = main()::<lambda(const auto:18&, const auto:19&)>; _Args = {const int&, const int&}]'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2345:55: required from 'struct std::__result_of_impl<false, false, main()::<lambda(const auto:18&, const auto:19&)>, const int&, const int&>'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2750:12: recursively required by substitution of 'template<class _Result, class _Ret> struct std::__is_invocable_impl<_Result, _Ret, std::__void_t<typename _Result::type> > [with _Result = std::__invoke_result<main()::<lambda(const auto:18&, const auto:19&)>, const int&, const int&>; _Ret = void]'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2750:12: required from 'struct std::is_invocable<main()::<lambda(const auto:18&, const auto:19&)>, const int&, const int&>'
/opt/wandbox/gcc-head/include/c++/9.0.0/type_traits:2787:27: required from 'constexpr const bool std::is_invocable_v<main()::<lambda(const auto:18&, const auto:19&)>, const int&, const int&>'
prog.cc:319:18: required from 'auto graph::make_astar_searcher(TCostCalculator, THeuristicCalculator, TNodeCompare) [with TVertexType = int; TCostCalculator = main()::<lambda(const auto:18&, const auto:19&)>; THeuristicCalculator = main()::<lambda(const auto:18&, const auto:19&)>; TNodeCompare = std::less<void>]'
prog.cc:555:105: required from here
prog.cc:553:37: warning: unused parameter '_from' [-Wunused-parameter]
553 | auto constantCost = [](const auto& _from, const auto& _to) { return 1; };
| ~~~~~~~~~~~~^~~~~
prog.cc:553:56: warning: unused parameter '_to' [-Wunused-parameter]
553 | auto constantCost = [](const auto& _from, const auto& _to) { return 1; };
| ~~~~~~~~~~~~^~~
prog.cc: In lambda function:
prog.cc:558:57: warning: unused parameter '_from' [-Wunused-parameter]
558 | auto manhattanCalculator = [&destination](const Point& _from, const Point& _to)
| ~~~~~~~~~~~~~^~~~~
prog.cc: In lambda function:
prog.cc:568:57: warning: unused parameter '_from' [-Wunused-parameter]
568 | auto costMapCostCalculator = [&costMap2d](const Point& _from, const Point& _to)
| ~~~~~~~~~~~~~^~~~~
prog.cc: In instantiation of 'constexpr T graph::detail::ConstantCost<T>::operator()(const TVertexType&, const TVertexType&) const [with TVertexType = int; T = int]':
prog.cc:198:19: required from 'TNodeData graph::detail::GenericNodeCreator<TCostCalculator, THeuristicCalculator>::_create_child(const graph::Node<TVertexType, TNodeData>&, const TVertexType&) [with TVertexType = int; TNodeData = graph::BaseNodeData<int, int>; TCostCalculator = graph::detail::ConstantCost<int>; THeuristicCalculator = graph::detail::ConstantCost<int>]'
prog.cc:178:50: required from 'auto graph::detail::GenericNodeCreator<TCostCalculator, THeuristicCalculator>::operator()(const graph::Node<TVertexType, graph::BaseNodeData<TVertexType, typename std::invoke_result<TCostCalculator, const TVertexType&, const TVertexType&>::type> >&, const TVertexType&) [with TVertexType = int; TCostCalculator = graph::detail::ConstantCost<int>; THeuristicCalculator = graph::detail::ConstantCost<int>; typename std::invoke_result<TCostCalculator, const TVertexType&, const TVertexType&>::type = int]'
prog.cc:133:45: required from 'graph::detail::GenericSearcher<TVertexType, TNodeData, TNodeCreator, TNodeCompare>::operator()(TNeighbourSearcher&, TOpenList&, TClosedList&) [with TNeighbourSearcher = main()::<lambda(const auto:9&, auto:10&&)>; TOpenList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TClosedList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TVertexType = int; TNodeData = graph::BaseNodeData<int, int>; TNodeCreator = graph::detail::GenericNodeCreator<graph::detail::ConstantCost<int>, graph::detail::ConstantCost<int> >; TNodeCompare = std::less<void>]::<lambda(const auto:1&)> [with auto:1 = int]'
prog.cc:496:13: required from 'main()::<lambda(const auto:9&, auto:10&&)> [with auto:9 = graph::Node<int, graph::BaseNodeData<int, int> >; auto:10 = graph::detail::GenericSearcher<TVertexType, TNodeData, TNodeCreator, TNodeCompare>::operator()(TNeighbourSearcher&, TOpenList&, TClosedList&) [with TNeighbourSearcher = main()::<lambda(const auto:9&, auto:10&&)>; TOpenList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TClosedList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TVertexType = int; TNodeData = graph::BaseNodeData<int, int>; TNodeCreator = graph::detail::GenericNodeCreator<graph::detail::ConstantCost<int>, graph::detail::ConstantCost<int> >; TNodeCompare = std::less<void>]::<lambda(const auto:1&)>]'
prog.cc:127:22: required from 'std::optional<graph::Node<TVertexType, TNodeData> > graph::detail::GenericSearcher<TVertexType, TNodeData, TNodeCreator, TNodeCompare>::operator()(TNeighbourSearcher&, TOpenList&, TClosedList&) [with TNeighbourSearcher = main()::<lambda(const auto:9&, auto:10&&)>; TOpenList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TClosedList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TVertexType = int; TNodeData = graph::BaseNodeData<int, int>; TNodeCreator = graph::detail::GenericNodeCreator<graph::detail::ConstantCost<int>, graph::detail::ConstantCost<int> >; TNodeCompare = std::less<void>]'
prog.cc:83:36: required from 'std::optional<_Tp> graph::detail::_conditional_visit(const TVertexType&, UnaryFunction&&, TNeighbourSearcher&, TPathFinder&, TOpenList&, TClosedList&) [with TVertexType = int; UnaryFunction = graph::visit(const TVertexType&, UnaryFunction&&, TNeighbourSearcher&&, TPathFinder&&, TOpenList, TClosedList) [with TVertexType = int; UnaryFunction = main()::<lambda(const auto:15&)>&; TNeighbourSearcher = main()::<lambda(const auto:9&, auto:10&&)>&; TPathFinder = graph::detail::StaticCostSearcher<int, int, std::less<void> >; TOpenList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TClosedList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >]::<lambda(const auto:4&)>&; TNeighbourSearcher = main()::<lambda(const auto:9&, auto:10&&)>; TPathFinder = graph::detail::StaticCostSearcher<int, int, std::less<void> >; TOpenList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TClosedList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >]'
prog.cc:331:29: required from 'void graph::visit(const TVertexType&, UnaryFunction&&, TNeighbourSearcher&&, TPathFinder&&, TOpenList, TClosedList) [with TVertexType = int; UnaryFunction = main()::<lambda(const auto:15&)>&; TNeighbourSearcher = main()::<lambda(const auto:9&, auto:10&&)>&; TPathFinder = graph::detail::StaticCostSearcher<int, int, std::less<void> >; TOpenList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >; TClosedList = graph::NodeMap<std::unordered_map<int, graph::BaseNodeData<int, int>, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, graph::BaseNodeData<int, int> > > > >]'
prog.cc:548:87: required from here
prog.cc:156:46: warning: unused parameter '_from' [-Wunused-parameter]
156 | constexpr T operator ()(const TVertexType& _from, const TVertexType& _to) const noexcept
| ~~~~~~~~~~~~~~~~~~~^~~~~
prog.cc:156:72: warning: unused parameter '_to' [-Wunused-parameter]
156 | constexpr T operator ()(const TVertexType& _from, const TVertexType& _to) const noexcept
| ~~~~~~~~~~~~~~~~~~~^~~
Breadth first visit:
vertex: 2 parent_vertex: -1 cost: 0
vertex: 4 parent_vertex: 2 cost: 1
vertex: 1 parent_vertex: 2 cost: 1
vertex: 3 parent_vertex: 2 cost: 1
vertex: 6 parent_vertex: 3 cost: 2
vertex: 7 parent_vertex: 1 cost: 2
vertex: 5 parent_vertex: 4 cost: 2
Depth first visit:
vertex: 2 parent_vertex: -1 cost: 0
vertex: 4 parent_vertex: 2 cost: 1
vertex: 5 parent_vertex: 4 cost: 2
vertex: 1 parent_vertex: 2 cost: 1
vertex: 7 parent_vertex: 1 cost: 2
vertex: 6 parent_vertex: 7 cost: 3
vertex: 3 parent_vertex: 6 cost: 4
Dijkstra search:
1
2
3
6
A* search:
1
7
6
A* 2d search:
x: 0 y: 0
x: 1 y: 0
x: 2 y: 0
x: 3 y: 0
x: 4 y: 0
x: 5 y: 0
x: 5 y: 1
x: 5 y: 2
x: 4 y: 2
x: 3 y: 2
x: 2 y: 2
x: 1 y: 2
x: 0 y: 2
x: 0 y: 3
x: 0 y: 4
x: 0 y: 5
x: 1 y: 5
x: 2 y: 5
x: 2 y: 6
x: 2 y: 7
x: 2 y: 8
x: 3 y: 8
x: 4 y: 8
x: 5 y: 8
x: 6 y: 8
x: 7 y: 8
x: 8 y: 8
x: 9 y: 8
x: 9 y: 9
Exit Code:
0