CPP/Boost/BGL/GridGraphVertexIterator
From ProgrammingExamples
GridGraphVertexIterator.cpp
#include <iostream> #include <boost/array.hpp> #include <boost/graph/grid_graph.hpp> int main(int argc, char* argv[]) { typedef boost::grid_graph<2> Graph; boost::array<std::size_t, 2> lengths = { { 5,5 } }; Graph graph(lengths); boost::graph_traits<Graph>::vertex_iterator iterator = vertices(graph); // Compiler error - can't convert iterator to this iterator type }
CMakeLists.txt
cmake_minimum_required(VERSION 2.6) Project(GridGraphVertexIterator) set(Boost_USE_MULTITHREADED ON) FIND_PACKAGE(Boost 1.38 COMPONENTS) INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${Boost_INCLUDE_DIRS}) LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS}) ADD_EXECUTABLE(GridGraphVertexIterator GridGraphVertexIterator.cpp)