@@ -177,7 +177,7 @@ struct await_worker_queue : coro::suspend_always
177
177
};
178
178
179
179
// Type-erased awaitable.
180
- class await_async : public coro ::suspend_always
180
+ class await_async
181
181
{
182
182
private:
183
183
struct Concept
@@ -216,7 +216,7 @@ class await_async : public coro::suspend_always
216
216
std::shared_ptr<T> _pimpl;
217
217
};
218
218
219
- const std::shared_ptr<Concept> _pimpl;
219
+ const std::shared_ptr<const Concept> _pimpl;
220
220
221
221
public:
222
222
// Type-erased explicit constructor for a custom awaitable.
@@ -227,36 +227,14 @@ class await_async : public coro::suspend_always
227
227
}
228
228
229
229
// Default to immediate synchronous execution.
230
- await_async ()
231
- : _pimpl { std::static_pointer_cast<Concept>(
232
- std::make_shared<Model<coro::suspend_never>>(std::make_shared<coro::suspend_never>())) }
233
- {
234
- }
230
+ GRAPHQLSERVICE_EXPORT await_async ();
235
231
236
232
// Implicitly convert a std::launch parameter used with std::async to an awaitable.
237
- await_async (std::launch launch)
238
- : _pimpl { ((launch & std::launch::async) == std::launch::async)
239
- ? std::static_pointer_cast<Concept>(std::make_shared<Model<await_worker_thread>>(
240
- std::make_shared<await_worker_thread>()))
241
- : std::static_pointer_cast<Concept>(std::make_shared<Model<coro::suspend_never>>(
242
- std::make_shared<coro::suspend_never>())) }
243
- {
244
- }
233
+ GRAPHQLSERVICE_EXPORT await_async (std::launch launch);
245
234
246
- bool await_ready () const
247
- {
248
- return _pimpl->await_ready ();
249
- }
250
-
251
- void await_suspend (coro::coroutine_handle<> h) const
252
- {
253
- _pimpl->await_suspend (std::move (h));
254
- }
255
-
256
- void await_resume () const
257
- {
258
- _pimpl->await_resume ();
259
- }
235
+ GRAPHQLSERVICE_EXPORT bool await_ready () const ;
236
+ GRAPHQLSERVICE_EXPORT void await_suspend (coro::coroutine_handle<> h) const ;
237
+ GRAPHQLSERVICE_EXPORT void await_resume () const ;
260
238
};
261
239
262
240
// Directive order matters, and some of them are repeatable. So rather than passing them in a
0 commit comments