diff --git a/introspection.hpp b/introspection.hpp index b6f83ba7..4aeab3f6 100644 --- a/introspection.hpp +++ b/introspection.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -360,11 +361,11 @@ namespace util { template < typename K, - typename I = typename make_indices< + typename I = typename std::make_index_sequence< std::tuple_size< typename type::fields >::value - >::type + > > struct _type_tuple; template < @@ -372,7 +373,7 @@ namespace util { size_t ...I > struct _type_tuple < K, - indices + std::index_sequence > { typedef std::tuple< typename std::tuple_element< @@ -394,11 +395,11 @@ namespace util { namespace detail { template < typename K, - typename I = typename make_indices< + typename I = typename std::make_index_sequence< std::tuple_size< typename type::fields >::value - >::type + > > struct _as_tuple; @@ -408,7 +409,7 @@ namespace util { > struct _as_tuple < K, - indices + std::index_sequence > { static typename type_tuple::type diff --git a/tuple.hpp b/tuple.hpp index da62de13..60c98881 100644 --- a/tuple.hpp +++ b/tuple.hpp @@ -74,7 +74,7 @@ namespace util::tuple { size_t ...I > auto - call (const Func &func, std::tuple args, indices) + call (const Func &func, std::tuple args, std::index_sequence) { // quiet unused variable warning with zero args (void)args; @@ -91,7 +91,7 @@ namespace util::tuple { auto call (const Func &func, std::tuple args) { - return detail::call (func, args, typename make_indices::type {}); + return detail::call (func, args, std::make_index_sequence {}); } @@ -137,9 +137,9 @@ namespace util::tuple { template < typename > class F, - typename I = typename make_indices< + typename I = std::make_index_sequence< std::tuple_size::value - >::type + > > struct map; @@ -155,7 +155,7 @@ namespace util::tuple { struct map< T, F, - indices + std::index_sequence > { typedef std::tuple< typename F< diff --git a/variadic.hpp b/variadic.hpp index b4f8eb0c..288a44a2 100644 --- a/variadic.hpp +++ b/variadic.hpp @@ -11,29 +11,15 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2015 Danny Robson + * Copyright 2017 Danny Robson */ #ifndef __UTIL_VARIADIC_HPP #define __UTIL_VARIADIC_HPP -#include - -namespace util { - template - struct indices - { - typedef indices next; - }; +namespace util::variadic { - template - struct make_indices - { - typedef typename make_indices::type::next type; - }; } -#include "variadic.ipp" - #endif diff --git a/variadic.ipp b/variadic.ipp deleted file mode 100644 index 931c88a4..00000000 --- a/variadic.ipp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright 2015 Danny Robson - */ - -#ifdef __UTIL_VARIADIC_IPP -#error -#endif -#define __UTIL_VARIADIC_IPP - - -namespace util { - template<> - struct make_indices<0> - { - typedef indices<> type; - }; -}