/** * * package.h * An Tao * * Copyright 2018, An Tao. All rights reserved. * https://github.com/an-tao/drogon * Use of this source code is governed by a MIT license * that can be found in the License file. * * Drogon * */ #pragma once #if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) #include #else #include namespace { template constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence) { return static_cast(f)(std::get(static_cast(t))...); } } // anonymous namespace #endif namespace drogon { #if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900) using std::apply; #else template constexpr decltype(auto) apply(F &&f, Tuple &&t) { return apply_impl( std::forward(f), std::forward(t), std::make_index_sequence< std::tuple_size >::value>{}); } #endif } // namespace drogon