Skip to content

Commit

Permalink
add feature test for __cpp_lib_move_only_function (#1790)
Browse files Browse the repository at this point in the history
  • Loading branch information
salvoilmiosi authored Oct 8, 2024
1 parent 6351807 commit 600e7fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/MoveOnlyFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ SOFTWARE.
#define _ANY_INVOKABLE_H_

#include <functional>

#if !defined(__cpp_lib_move_only_function) || __cpp_lib_move_only_function < 202110L

#include <memory>
#include <type_traits>

Expand Down Expand Up @@ -374,4 +377,13 @@ namespace uWS {
using MoveOnlyFunction = ofats::any_invocable<T>;
}

#else // !defined(__cpp_lib_move_only_function) || __cpp_lib_move_only_function < 202110L

namespace uWS {
template <class T>
using MoveOnlyFunction = std::move_only_function<T>;
}

#endif

#endif // _ANY_INVOKABLE_H_

0 comments on commit 600e7fe

Please sign in to comment.