Skip to content

Commit 51cd3cb

Browse files
authored
Merge pull request #2191 from geky/callback-fp-deprecate
[api] Mark FunctionPointer and friends as deprecated
2 parents 239f31b + ad07ab8 commit 51cd3cb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hal/api/FunctionPointer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define MBED_FUNCTIONPOINTER_H
1818

1919
#include "Callback.h"
20+
#include "toolchain.h"
2021
#include <string.h>
2122
#include <stdint.h>
2223

@@ -28,10 +29,12 @@ namespace mbed {
2829
template <typename R, typename A1>
2930
class FunctionPointerArg1 : public Callback<R(A1)> {
3031
public:
32+
MBED_DEPRECATED("FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
3133
FunctionPointerArg1(R (*function)(A1) = 0)
3234
: Callback<R(A1)>(function) {}
3335

3436
template<typename T>
37+
MBED_DEPRECATED("FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
3538
FunctionPointerArg1(T *object, R (T::*member)(A1))
3639
: Callback<R(A1)>(object, member) {}
3740

@@ -43,10 +46,12 @@ class FunctionPointerArg1 : public Callback<R(A1)> {
4346
template <typename R>
4447
class FunctionPointerArg1<R, void> : public Callback<R()> {
4548
public:
49+
MBED_DEPRECATED("FunctionPointer has been replaced by Callback<void()>")
4650
FunctionPointerArg1(R (*function)() = 0)
4751
: Callback<R()>(function) {}
4852

4953
template<typename T>
54+
MBED_DEPRECATED("FunctionPointer has been replaced by Callback<void()>")
5055
FunctionPointerArg1(T *object, R (T::*member)())
5156
: Callback<R()>(object, member) {}
5257

0 commit comments

Comments
 (0)