1717#ifndef MBED_NONCOPYABLE_H_
1818#define MBED_NONCOPYABLE_H_
1919
20- #if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0))
21- #include " platform/mbed_toolchain.h"
22- #include " platform/mbed_debug.h"
23- #endif
24-
2520namespace mbed {
2621
2722/* * \addtogroup platform-public-api */
@@ -176,39 +171,6 @@ class NonCopyable {
176171 */
177172 ~NonCopyable () = default ;
178173
179- #if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0))
180- /* *
181- * NonCopyable copy constructor.
182- *
183- * A compile time warning is issued when this function is used, and a runtime
184- * warning is printed when the copy construction of the noncopyable happens.
185- *
186- * If you see this warning, your code is probably doing something unspecified.
187- * Copying of noncopyable resources can lead to resource leak and random error.
188- */
189- MBED_DEPRECATED (" Invalid copy construction of a NonCopyable resource." )
190- NonCopyable(const NonCopyable &)
191- {
192- debug (" Invalid copy construction of a NonCopyable resource: %s\r\n " , MBED_PRETTY_FUNCTION);
193- }
194-
195- /* *
196- * NonCopyable copy assignment operator.
197- *
198- * A compile time warning is issued when this function is used, and a runtime
199- * warning is printed when the copy construction of the noncopyable happens.
200- *
201- * If you see this warning, your code is probably doing something unspecified.
202- * Copying of noncopyable resources can lead to resource leak and random error.
203- */
204- MBED_DEPRECATED (" Invalid copy assignment of a NonCopyable resource." )
205- NonCopyable &operator=(const NonCopyable &)
206- {
207- debug (" Invalid copy assignment of a NonCopyable resource: %s\r\n " , MBED_PRETTY_FUNCTION);
208- return *this ;
209- }
210-
211- #else
212174public:
213175 /* *
214176 * Define copy constructor as deleted. Any attempt to copy construct
@@ -222,7 +184,6 @@ class NonCopyable {
222184 */
223185 NonCopyable &operator =(const NonCopyable &) = delete ;
224186#endif
225- #endif
226187};
227188
228189/* *@}*/
0 commit comments