Skip to content

Commit 6d2baef

Browse files
committed
Fixing build errors
1 parent 058a4ea commit 6d2baef

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

include/restc-cpp/boost_compatibility.h

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,25 +109,14 @@ namespace restc_cpp {
109109
* @param handler The handler to dispatch.
110110
*/
111111
template <typename IOService, typename Handler>
112-
void boost_dispatch(IOService& io_service, Handler&& handler) {
112+
void boost_dispatch(IOService *io_service, Handler&& handler) {
113113
#if BOOST_VERSION >= 106600
114-
if constexpr (std::is_pointer_v<IOService>) {
115-
io_service->get_executor().dispatch(
116-
std::forward<Handler>(handler),
117-
std::allocator<void>() // Default allocator
118-
);
119-
} else {
120-
io_service.get_executor().dispatch(
121-
std::forward<Handler>(handler),
122-
std::allocator<void>() // Default allocator
123-
);
124-
}
114+
io_service->get_executor().dispatch(
115+
std::forward<Handler>(handler),
116+
std::allocator<void>() // Default allocator
117+
);
125118
#else
126-
if constexpr (std::is_pointer_v<IOService>) {
127-
io_service->dispatch(std::forward<Handler>(handler));
128-
} else {
129-
io_service.dispatch(std::forward<Handler>(handler));
130-
}
119+
io_service->dispatch(std::forward<Handler>(handler));
131120
#endif
132121
}
133122

0 commit comments

Comments
 (0)