From cce4fefa2a7c8209cd7c2a45bf3ae04ed4bb5e6d Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 12 Mar 2022 23:21:18 +0300 Subject: [PATCH] Delete mingw.invoke.h --- src/_mingw_threads/mingw.invoke.h | 109 ------------------------------ 1 file changed, 109 deletions(-) delete mode 100644 src/_mingw_threads/mingw.invoke.h diff --git a/src/_mingw_threads/mingw.invoke.h b/src/_mingw_threads/mingw.invoke.h deleted file mode 100644 index d5c9dd38..00000000 --- a/src/_mingw_threads/mingw.invoke.h +++ /dev/null @@ -1,109 +0,0 @@ -/// \file mingw.invoke.h -/// \brief Lightweight `invoke` implementation, for C++11 and C++14. -/// -/// (c) 2018-2019 by Nathaniel J. McClatchey, San Jose, CA, United States -/// \author Nathaniel J. McClatchey, PhD -/// -/// \copyright Simplified (2-clause) BSD License. -/// -/// \note This file may become part of the mingw-w64 runtime package. If/when -/// this happens, the appropriate license will be added, i.e. this code will -/// become dual-licensed, and the current BSD 2-clause license will stay. - -#ifndef MINGW_INVOKE_H_ -#define MINGW_INVOKE_H_ - -#include // For std::result_of, etc. -#include // For std::forward -#include // For std::reference_wrapper - -namespace mingw_stdthread -{ -namespace detail -{ -// For compatibility, implement std::invoke for C++11 and C++14 -#if __cplusplus < 201703L - template - struct Invoker - { - template - inline static typename std::result_of::type invoke (F&& f, Args&&... args) - { - return std::forward(f)(std::forward(args)...); - } - }; - template - struct InvokerHelper; - - template<> - struct InvokerHelper - { - template - inline static auto get (T1&& t1) -> decltype(*std::forward(t1)) - { - return *std::forward(t1); - } - - template - inline static auto get (const std::reference_wrapper& t1) -> decltype(t1.get()) - { - return t1.get(); - } - }; - - template<> - struct InvokerHelper - { - template - inline static auto get (T1&& t1) -> decltype(std::forward(t1)) - { - return std::forward(t1); - } - }; - - template<> - struct Invoker - { - template - inline static auto invoke (F T::* f, T1&& t1, Args&&... args) ->\ - decltype((InvokerHelper::type>::value>::get(std::forward(t1)).*f)(std::forward(args)...)) - { - return (InvokerHelper::type>::value>::get(std::forward(t1)).*f)(std::forward(args)...); - } - }; - - template<> - struct Invoker - { - template - inline static auto invoke (F T::* f, T1&& t1, Args&&... args) ->\ - decltype(InvokerHelper::type>::value>::get(t1).*f) - { - return InvokerHelper::type>::value>::get(t1).*f; - } - }; - - template - struct InvokeResult - { - typedef Invoker::type>::value, - std::is_member_object_pointer::type>::value && - (sizeof...(Args) == 1)> invoker; - inline static auto invoke (F&& f, Args&&... args) -> decltype(invoker::invoke(std::forward(f), std::forward(args)...)) - { - return invoker::invoke(std::forward(f), std::forward(args)...); - } - }; - - template - auto invoke (F&& f, Args&&... args) -> decltype(InvokeResult::invoke(std::forward(f), std::forward(args)...)) - { - return InvokeResult::invoke(std::forward(f), std::forward(args)...); - } -#else - using std::invoke; -#endif -} // Namespace "detail" -} // Namespace "mingw_stdthread" - -#endif