pnoltes commented on a change in pull request #370:
URL: https://github.com/apache/celix/pull/370#discussion_r723005705
##########
File path: libs/promises/api/celix/Deferred.h
##########
@@ -215,22 +304,42 @@ inline
celix::Deferred<void>::Deferred(std::shared_ptr<celix::impl::SharedPromis
template<typename T>
void celix::Deferred<T>::fail(std::exception_ptr failure) {
- state->fail(std::move(failure));
+ state->tryFail(std::move(failure));
+}
+
+template<typename T>
+bool celix::Deferred<T>::tryFail(std::exception_ptr failure) {
+ return state->tryFail(std::move(failure));
}
inline void celix::Deferred<void>::fail(std::exception_ptr failure) {
- state->fail(std::move(failure));
+ state->tryFail(std::move(failure));
+}
+
+inline bool celix::Deferred<void>::tryFail(std::exception_ptr failure) {
+ return state->tryFail(std::move(failure));
}
template<typename T>
-template<typename E, typename std::enable_if_t<
std::is_base_of<std::exception, E>::value, bool>>
+template<typename E, typename std::enable_if_t<
std::is_base_of_v<std::exception, E>, bool>>
Review comment:
if a function is a template function, it is already inline. So only the
function with a template arg ('normal' functions or template specialized
functIon) need a inline
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]