From 62394526fb28d472d9ebfa840da584e6dd7ad3e9 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 8 Apr 2018 22:21:37 +0200 Subject: [PATCH] Delete copy assignment operator when copy constructor is already deleted. --- examples/s4u/app-bittorrent/s4u-peer.hpp | 3 ++- examples/s4u/app-bittorrent/s4u-tracker.hpp | 5 +++-- examples/s4u/dht-chord/s4u-dht-chord.hpp | 3 ++- src/include/xbt/parmap.hpp | 3 ++- src/simdag/simdag_private.hpp | 3 ++- src/xbt/xbt_replay.cpp | 3 ++- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/s4u/app-bittorrent/s4u-peer.hpp b/examples/s4u/app-bittorrent/s4u-peer.hpp index 9d1e195b3a..1f4fe9ad77 100644 --- a/examples/s4u/app-bittorrent/s4u-peer.hpp +++ b/examples/s4u/app-bittorrent/s4u-peer.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017. The SimGrid Team. +/* Copyright (c) 2012-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -50,6 +50,7 @@ class Peer { public: explicit Peer(std::vector args); Peer(const Peer&) = delete; + Peer& operator=(const Peer&) = delete; ~Peer(); void operator()(); diff --git a/examples/s4u/app-bittorrent/s4u-tracker.hpp b/examples/s4u/app-bittorrent/s4u-tracker.hpp index d167dc0f0c..7c9810160f 100644 --- a/examples/s4u/app-bittorrent/s4u-tracker.hpp +++ b/examples/s4u/app-bittorrent/s4u-tracker.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2014, 2017. The SimGrid Team. +/* Copyright (c) 2012-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -26,7 +26,8 @@ class TrackerAnswer { std::set* peers; // the peer list the peer has asked for. public: explicit TrackerAnswer(int /*interval*/) /*: interval(interval)*/ { peers = new std::set; } - TrackerAnswer(const TrackerAnswer&) = delete; + TrackerAnswer(const TrackerAnswer&) = delete; + TrackerAnswer& operator=(const TrackerAnswer&) = delete; ~TrackerAnswer() { delete peers; }; void addPeer(int peer) { peers->insert(peer); } std::set* getPeers() { return peers; } diff --git a/examples/s4u/dht-chord/s4u-dht-chord.hpp b/examples/s4u/dht-chord/s4u-dht-chord.hpp index 016cba3fda..74ddd3a093 100644 --- a/examples/s4u/dht-chord/s4u-dht-chord.hpp +++ b/examples/s4u/dht-chord/s4u-dht-chord.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2016-2018. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -88,6 +88,7 @@ class Node { public: explicit Node(std::vector args); Node(const Node&) = delete; + Node& operator=(const Node&) = delete; ~Node(); void join(int known_id); void leave(); diff --git a/src/include/xbt/parmap.hpp b/src/include/xbt/parmap.hpp index 3eeb6a2080..3aeaf196df 100644 --- a/src/include/xbt/parmap.hpp +++ b/src/include/xbt/parmap.hpp @@ -1,6 +1,6 @@ /* A thread pool (C++ version). */ -/* Copyright (c) 2004-2017 The SimGrid Team. +/* Copyright (c) 2004-2018 The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ template class Parmap { public: Parmap(unsigned num_workers, e_xbt_parmap_mode_t mode); Parmap(const Parmap&) = delete; + Parmap& operator=(const Parmap&) = delete; ~Parmap(); void apply(void (*fun)(T), const std::vector& data); boost::optional next(); diff --git a/src/simdag/simdag_private.hpp b/src/simdag/simdag_private.hpp index 826b800114..b2d2bc516c 100644 --- a/src/simdag/simdag_private.hpp +++ b/src/simdag/simdag_private.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2017. The SimGrid Team. +/* Copyright (c) 2006-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ class Global { public: explicit Global(); Global(const Global&) = delete; + Global& operator=(const Global&) = delete; ~Global(); bool watch_point_reached; /* has a task just reached a watch point? */ std::set *initial_tasks; diff --git a/src/xbt/xbt_replay.cpp b/src/xbt/xbt_replay.cpp index a266f7ea02..e95ccb44c1 100644 --- a/src/xbt/xbt_replay.cpp +++ b/src/xbt/xbt_replay.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2012-2015, 2017. The SimGrid Team. +/* Copyright (c) 2010, 2012-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ public: xbt_assert(fs->is_open(), "Cannot read replay file '%s'", filename); } ReplayReader(const ReplayReader&) = delete; + ReplayReader& operator=(const ReplayReader&) = delete; ~ReplayReader() { delete fs; -- 2.20.1