concatenate.hpp 734 Bytes
Newer Older
Kitware Robot's avatar
Kitware Robot committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
// The Art of C++ / Sequences
// Copyright (c) 2015 Daniel Frey

#ifndef TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP
#define TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP

#include <type_traits>

#include "integer_sequence.hpp"

namespace tao
{
  namespace seq
  {
    template< typename, typename >
    struct concatenate;

    template< typename TA, TA... As, typename TB, TB... Bs >
    struct concatenate< integer_sequence< TA, As... >, integer_sequence< TB, Bs... > >
    {
      using type = integer_sequence< typename std::common_type< TA, TB >::type, As..., Bs... >;
    };

    template< typename A, typename B >
    using concatenate_t = typename concatenate< A, B >::type;
  }
}

#endif // TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP