Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

type bug error with icc

rnickb
Beginner
354 Views

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
KitturGanesh
Employee
354 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

0 Kudos
KitturGanesh
Employee
354 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

0 Kudos
Reply