#ifndef REST_RPC_CPLUSPLUS_14_H_ #define REST_RPC_CPLUSPLUS_14_H_ #include #include #include #if __cplusplus == 201103L namespace std { template struct unique_if { typedef unique_ptr single_object; }; template struct unique_if { typedef unique_ptr unknown_bound; }; template struct unique_if { typedef void known_bound; }; template typename unique_if::single_object make_unique(Args&&... args) { return unique_ptr(new T(forward(args)...)); } template typename unique_if::unknown_bound make_unique(size_t n) { typedef typename remove_extent::type U; return unique_ptr(new U[n]()); } template typename unique_if::known_bound make_unique(Args&&...) = delete; template struct index_sequence { using type = index_sequence; using value_type = size_t; static constexpr std::size_t size() noexcept { return sizeof...(Ints); } }; // -------------------------------------------------------------- template struct _merge_and_renumber; template struct _merge_and_renumber, index_sequence> : index_sequence {}; // -------------------------------------------------------------- template struct make_index_sequence : _merge_and_renumber::type, typename make_index_sequence::type> {}; template<> struct make_index_sequence<0> : index_sequence<> {}; template<> struct make_index_sequence<1> : index_sequence<0> {}; template using index_sequence_for = make_index_sequence; template using enable_if_t = typename enable_if::type; template using remove_const_t = typename remove_const::type; template using remove_reference_t = typename remove_reference::type; template using tuple_element_t = typename tuple_element::type; template using decay_t = typename decay::type; template auto apply_helper(F&& f, Tuple&& tp, std::index_sequence) -> decltype(std::forward(f)(std::get(std::forward(tp))...)) { return std::forward(f)(std::get(std::forward(tp))...); } template auto apply(F&& f, Tuple&& tp) -> decltype(apply_helper(std::forward(f), std::forward(tp), std::make_index_sequence>::value>{})) { return apply_helper(std::forward(f), std::forward(tp), std::make_index_sequence>::value>{}); } template auto invoke(F&& f, Args&&... args) -> decltype(std::forward(f)(std::forward(args)...)) { return std::forward(f)(std::forward(args)...); } } // namespace std #endif #endif // REST_RPC_CPLUSPLUS_14_H_