Skip to content

Commit

Permalink
[0.68] MustBeNoExceptVoidFunctor should depend on the template type p…
Browse files Browse the repository at this point in the history
…arameter to avoid being evaluated too early (#9609)

* MustBeNoExceptVoidFunctor should depend on the template type parameter to avoid being evaluated too early (#9562)

* MustBeNoExceptVoidFunctor should depend on the template type parameter to avoid being evaluated too early

* Change files

* Change files

Co-authored-by: Alexander Sklar <asklar@microsoft.com>
  • Loading branch information
JunielKatarn and asklar committed Feb 26, 2022
1 parent 52a2780 commit 8b72f04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "MustBeNoExceptVoidFunctor should depend on the template type parameter to avoid being evaluated too early (#9562)",
"packageName": "react-native-windows",
"email": "julio.rocha@microsoft.com",
"dependentChangeType": "patch"
}
7 changes: 6 additions & 1 deletion vnext/Mso/dispatchQueue/dispatchQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,14 @@ inline DispatchTaskImpl<TInvoke, TOnCancel>::~DispatchTaskImpl() noexcept {
}
}

namespace details {
template <typename>
constexpr bool always_false = false;
}

template <typename T>
inline void MustBeNoExceptVoidFunctor() {
static_assert(false, __FUNCTION__ ": not a noexcept callable functor returning void");
static_assert(details::always_false<T>, __FUNCTION__ ": not a noexcept callable functor returning void");
}

template <typename TInvoke, typename TOnCancel>
Expand Down

0 comments on commit 8b72f04

Please sign in to comment.