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 */
@@ -178,39 +173,6 @@ class NonCopyable {
178173 */
179174 ~NonCopyable () = default ;
180175
181- #if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0))
182- /* *
183- * NonCopyable copy constructor.
184- *
185- * A compile time warning is issued when this function is used, and a runtime
186- * warning is printed when the copy construction of the noncopyable happens.
187- *
188- * If you see this warning, your code is probably doing something unspecified.
189- * Copying of noncopyable resources can lead to resource leak and random error.
190- */
191- MBED_DEPRECATED (" Invalid copy construction of a NonCopyable resource." )
192- NonCopyable(const NonCopyable &)
193- {
194- debug (" Invalid copy construction of a NonCopyable resource: %s\r\n " , MBED_PRETTY_FUNCTION);
195- }
196-
197- /* *
198- * NonCopyable copy assignment operator.
199- *
200- * A compile time warning is issued when this function is used, and a runtime
201- * warning is printed when the copy construction of the noncopyable happens.
202- *
203- * If you see this warning, your code is probably doing something unspecified.
204- * Copying of noncopyable resources can lead to resource leak and random error.
205- */
206- MBED_DEPRECATED (" Invalid copy assignment of a NonCopyable resource." )
207- NonCopyable &operator=(const NonCopyable &)
208- {
209- debug (" Invalid copy assignment of a NonCopyable resource: %s\r\n " , MBED_PRETTY_FUNCTION);
210- return *this ;
211- }
212-
213- #else
214176private:
215177 /* *
216178 * Declare copy constructor as private. Any attempt to copy construct
@@ -224,7 +186,6 @@ class NonCopyable {
224186 */
225187 NonCopyable &operator =(const NonCopyable &);
226188#endif
227- #endif
228189};
229190
230191/* *@}*/
0 commit comments