Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weejobs: Fix location of WEEJOBS_NO_DISCARD for gcc #2539

Merged
merged 1 commit into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/osgEarth/weejobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,15 @@ namespace WEEJOBS_NAMESPACE
//! value to the continuation function. The continuation function in turn must
//! return a value (cannot be void).
template<typename F, typename R = typename detail::result_of_t<F(const T&, cancelable&)>>
inline WEEJOBS_NO_DISCARD future<R> then_dispatch(F func, const context& con = {});
WEEJOBS_NO_DISCARD inline future<R> then_dispatch(F func, const context& con = {});

//! Add a continuation to this future. Instead of the functor returning a value,
//! it will instead have the option of resolving the incoming future/promise object.
//! This is useful for operations that have their own way of running asynchronous code.
//! Note: for some reason when you use this variant you must specific the template
//! argument, e.g. result.then<int>(auto i, promise<int> p)
template<typename R>
inline WEEJOBS_NO_DISCARD future<R> then_dispatch(std::function<void(const T&, future<R>&)> func, const context& con = {});
WEEJOBS_NO_DISCARD inline future<R> then_dispatch(std::function<void(const T&, future<R>&)> func, const context& con = {});

//! Add a continuation to this future. The functor only takes an input value and has no
//! return value (fire and forget).
Expand Down Expand Up @@ -777,7 +777,7 @@ namespace WEEJOBS_NAMESPACE
//! @param context Optional configuration for the asynchronous function call
//! @return Future result of the async function call
template<typename F, typename T = typename detail::result_of_t<F(cancelable&)>>
inline WEEJOBS_NO_DISCARD future<T> dispatch(F task, const context& context = {})
WEEJOBS_NO_DISCARD inline future<T> dispatch(F task, const context& context = {})
{
future<T> promise;
bool can_cancel = context.can_cancel;
Expand Down Expand Up @@ -810,7 +810,7 @@ namespace WEEJOBS_NAMESPACE
//! @param context Optional configuration for the asynchronous function call
//! @return Future result of the async function call
template<typename F, typename T = typename detail::result_of_t<F(cancelable&)>>
inline WEEJOBS_NO_DISCARD future<T> dispatch(F task, future<T> promise, const context& context = {})
WEEJOBS_NO_DISCARD inline future<T> dispatch(F task, future<T> promise, const context& context = {})
{
bool can_cancel = context.can_cancel;

Expand Down
Loading