From fe0d2faafda2e8af120a203e26b756975da59aff Mon Sep 17 00:00:00 2001 From: dmatetelki Date: Tue, 8 Sep 2015 13:30:01 +0200 Subject: [PATCH] removing unnecessary ctors and assigmnment operators, which were the same as the default --- lib/graph/graph.hpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/graph/graph.hpp b/lib/graph/graph.hpp index d42193a..68be930 100644 --- a/lib/graph/graph.hpp +++ b/lib/graph/graph.hpp @@ -61,14 +61,7 @@ private: public: struct Edge { - Edge() noexcept(std::is_default_constructible::value) : source(), destination() {} Edge(const_reference s, const_reference d) : source(s), destination(d) {} - Edge(const Edge& o) : source(o.source), destination(o.destination) {} - Edge(Edge&& o) noexcept(std::is_nothrow_copy_constructible::value) - : source(std::move(o.source)), destination(std::move(o.destination)) {} - Edge& operator=(Edge o) { swap(o); return *this; } - void swap(Edge& o) noexcept(is_nothrow_swappable_all::value) - { std::swap(source, o.source); std::swap(destination, o.destination); } bool operator==(const Edge& o) const { return source == o.source && destination == o.destination; } value_type source; @@ -76,17 +69,11 @@ public: }; Graph() : m_vertices() {} - Graph(const Graph& o) : m_vertices(o.m_vertices) {} - Graph(Graph&& o) : m_vertices(std::move(o.m_vertices)) {} // unordered_map move ctor is noexcept indifferent Graph(std::initializer_list vertex_list); Graph(const std::vector& vertex_list); Graph(std::initializer_list edge_list); Graph(const std::vector& edge_list); - Graph& operator=(Graph o) { swap(o); return *this; } - void swap(Graph& o) noexcept(is_nothrow_swappable_all::value) - { std::swap(m_vertices, o.m_vertices); } - void addVertex(const_reference data); void removeVertex(const_reference data); void modifyVertex(const_reference old_data, const_reference new_data); @@ -114,12 +101,6 @@ public: typedef vertex_iterator& reference_self_type; typedef const vertex_iterator& const_reference_self_type; - vertex_iterator() : m_it() {} - ~vertex_iterator() {} - vertex_iterator(const_reference_self_type o) : m_it(o.m_it) {} - reference_self_type operator=(self_type o) { swap(o); return *this; } - void swap(reference_self_type o) { std::swap(m_it, o.m_it); } - const_reference operator*() { return m_it->first; } const_pointer operator->() { return &m_it->first; } self_type &operator++() { ++m_it; return *this; }