diff --git a/src/uvw/loop.cpp b/src/uvw/loop.cpp index ff5f526a..84f4355e 100644 --- a/src/uvw/loop.cpp +++ b/src/uvw/loop.cpp @@ -65,6 +65,14 @@ UVW_INLINE void Loop::close() { } +template +bool Loop::run() noexcept { + auto utm = static_cast>(mode); + auto uvrm = static_cast(utm); + return (uv_run(loop.get(), uvrm) == 0); +} + + UVW_INLINE bool Loop::alive() const noexcept { return !(uv_loop_alive(loop.get()) == 0); } @@ -130,4 +138,11 @@ UVW_INLINE uv_loop_t *Loop::raw() noexcept { } +// explicit instantiation definitions + +template bool Loop::run() noexcept; +template bool Loop::run() noexcept; +template bool Loop::run() noexcept; + + } diff --git a/src/uvw/loop.h b/src/uvw/loop.h index 29712d12..835bcc76 100644 --- a/src/uvw/loop.h +++ b/src/uvw/loop.h @@ -264,11 +264,7 @@ public: * @return True when done, false in all other cases. */ template - bool run() noexcept { - auto utm = static_cast>(mode); - auto uvrm = static_cast(utm); - return (uv_run(loop.get(), uvrm) == 0); - } + bool run() noexcept; /** * @brief Checks if there are active resources.