17
17
#ifndef MBED_NONCOPYABLE_H_
18
18
#define MBED_NONCOPYABLE_H_
19
19
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
-
25
20
namespace mbed {
26
21
27
22
/* * \addtogroup platform-public-api */
@@ -176,39 +171,6 @@ class NonCopyable {
176
171
*/
177
172
~NonCopyable () = default ;
178
173
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
212
174
public:
213
175
/* *
214
176
* Define copy constructor as deleted. Any attempt to copy construct
@@ -222,7 +184,6 @@ class NonCopyable {
222
184
*/
223
185
NonCopyable &operator =(const NonCopyable &) = delete ;
224
186
#endif
225
- #endif
226
187
};
227
188
228
189
/* *@}*/
0 commit comments