Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

g++ partial specialization ambiguous

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.32 sec, absolute service time: 0,43 sec 
edit mode |  history
Error(s):
source_file.cpp: In instantiation of ‘struct split<0ul, x<0>, x<1> >’:
source_file.cpp:31:21:   required from here
source_file.cpp:27:8: error: ambiguous template instantiation for ‘struct split_impl<0ul, std::tuple<>, x<0>, x<1> >’
 struct split : split_impl<I, std::tuple<>, Ts...> {};
        ^
source_file.cpp:15:8: note: candidates are: template<class ... Ts, class ... Us> struct split_impl<0ul, std::tuple<Ts ...>, Us ...> [with Ts = {}; Us = {x<0>, x<1>}]
 struct split_impl<0, std::tuple<Ts...>, Us...>
        ^
source_file.cpp:22:8: note:                 template<long unsigned int I, class ... Ts, class T, class ... Us> struct split_impl<I, std::tuple<Us ...>, T, Us ...> [with long unsigned int I = 0ul; Ts = {}; T = x<0>; Us = {x<1>}]
 struct split_impl<I, std::tuple<Ts...>, T, Us...>
        ^
source_file.cpp:27:8: error: invalid use of incomplete type ‘struct split_impl<0ul, std::tuple<>, x<0>, x<1> >’
 struct split : split_impl<I, std::tuple<>, Ts...> {};
        ^
source_file.cpp:9:8: note: declaration of ‘struct split_impl<0ul, std::tuple<>, x<0>, x<1> >’
 struct split_impl
        ^
source_file.cpp:31:23: error: ‘rest’ in ‘struct split<0ul, x<0>, x<1> >’ does not name a type
 split<0, x<0>, x<1>>::rest z = nullptr;
                       ^

        

    
                
λ
.NET NoSQL database for rapid development