From 7c890f19c6f05beadcb253c239282e8ca39d6151 Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Tue, 12 Mar 2013 21:56:47 +0100 Subject: [PATCH] what is goind on here? storing pointers of variables on the stack? --- main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.cpp b/main.cpp index 7be70a7..fef0823 100644 --- a/main.cpp +++ b/main.cpp @@ -71,6 +71,19 @@ int main() assert(g.neighboursOf(5).size() == 0); + Graph g2; + g.addVertex(1); + g.addVertex(2); + g.addVertex(3); + g.addVertex(4); + + int vertices_array2[] = {1, 2, 3, 4}; + std::vector v2(vertices_array2, vertices_array2 + sizeof(vertices_array2) / sizeof(int) ); + for (g_it = g2.begin(), v_it = v2.begin(); + g_it != g2.end(); + g_it++, v_it++) + assert(*g_it == *v_it); + return 0; }