Skip to content

Commit 600e7fe

Browse files
authored
add feature test for __cpp_lib_move_only_function (#1790)
1 parent 6351807 commit 600e7fe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/MoveOnlyFunction.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ SOFTWARE.
2828
#define _ANY_INVOKABLE_H_
2929

3030
#include <functional>
31+
32+
#if !defined(__cpp_lib_move_only_function) || __cpp_lib_move_only_function < 202110L
33+
3134
#include <memory>
3235
#include <type_traits>
3336

@@ -374,4 +377,13 @@ namespace uWS {
374377
using MoveOnlyFunction = ofats::any_invocable<T>;
375378
}
376379

380+
#else // !defined(__cpp_lib_move_only_function) || __cpp_lib_move_only_function < 202110L
381+
382+
namespace uWS {
383+
template <class T>
384+
using MoveOnlyFunction = std::move_only_function<T>;
385+
}
386+
387+
#endif
388+
377389
#endif // _ANY_INVOKABLE_H_

0 commit comments

Comments
 (0)