1 // The Art of C++ / Sequences 2 // Copyright (c) 2015 Daniel Frey 3 4 #ifndef TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP 5 #define TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP 6 7 #include <type_traits> 8 9 #include "integer_sequence.hpp" 10 11 namespace tao 12 { 13 namespace seq 14 { 15 template< typename, typename > 16 struct concatenate; 17 18 template< typename TA, TA... As, typename TB, TB... Bs > 19 struct concatenate< integer_sequence< TA, As... >, integer_sequence< TB, Bs... > > 20 { 21 using type = integer_sequence< typename std::common_type< TA, TB >::type, As..., Bs... >; 22 }; 23 24 template< typename A, typename B > 25 using concatenate_t = typename concatenate< A, B >::type; 26 } 27 } 28 29 #endif // TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP 30