Remake socketcan only movable
authorRomain Forlot <romain.forlot@iot.bzh>
Wed, 31 May 2017 10:31:11 +0000 (12:31 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Thu, 1 Jun 2017 16:22:49 +0000 (18:22 +0200)
Change-Id: If81e2a18c0beec392a98f8b835c7a5d154360500
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
CAN-binder/low-can-binding/utils/socketcan.cpp
CAN-binder/low-can-binding/utils/socketcan.hpp

index ffd4615..1f7aaa6 100644 (file)
@@ -31,17 +31,10 @@ namespace utils
                : socket_{INVALID_SOCKET}
        {}
 
-       /// @brief Construct a socket by copying an existing one.
-       socketcan_t::socketcan_t(const socketcan_t& s)
-               : socket_{s.socket_}
-       {}
-
        /// @brief Construct a socket by moving an existing one.
        socketcan_t::socketcan_t(socketcan_t&& s)
                : socket_{s.socket_}
-       {
-               s.socket_ = INVALID_SOCKET;
-       }
+       {}
 
        socketcan_t& socketcan_t::operator=(const socketcan_t& s)
        {
index 1e7cd3c..8300e6b 100644 (file)
@@ -33,7 +33,7 @@ namespace utils
        {
        public:
                socketcan_t();
-               socketcan_t(const socketcan_t& s);
+               socketcan_t(const socketcan_t& s) = delete;
                socketcan_t(socketcan_t&&);
                socketcan_t& operator=(const socketcan_t& s);
                virtual ~socketcan_t();