Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rnickb
Beginner
69 Views

type bug error with icc

The following code compiles with gcc and clang but fails with icc.

#include <tuple>                                                                   
#include <utility>                                                                 
                                                                                   
template<class, class>                                                             
struct right_impl {};                                                              
                                                                                   
template <std::size_t... Indexes, class... Values>                                 
struct right_impl<std::index_sequence<Indexes...>,                                 
  std::tuple<Values...>>                                                           
{                                                                                  
  using type = std::tuple<                                                         
      std::tuple_element_t<sizeof...(Values) - sizeof...(Indexes) + Indexes,       
                           std::tuple<Values...>>...>;                             
};                                                                                 
                                                                                   
template<int N, class Tuple>                                                       
using right_t = typename right_impl<std::make_index_sequence<N>, Tuple>::type;     
                                                                                   
int main() {                                                                       
  using T1 = std::tuple<int, float, char>;                                         
  using T2 = right_t<2, T1>;                                                       
  static_assert(                                                                   
    std::is_same<T2, std::tuple<float, char>>::value,                              
    "type is incorrect");                                                          
  return 0;                                                                        
}     

 

0 Kudos
2 Replies
Kittur_G_Intel
Employee
69 Views

Hi,
I've filed this issue with the developers and will update you as soon as the release with the fix is out, appreciate much.
_Kittur

Kittur_G_Intel
Employee
69 Views

Hi,
Just letting you know that the 16.0 Update 1 version of the product released contains the fix for this issue which you can download and test it out, thanks.
_Kittur

Reply