I was reading on template deduction then tried to create one. as follows:-
#include <iostream>
#include <array>
using namespace std;
template<int i,typename A,typename... B> struct deducted{
};
//Deduction guide
template<typename A,typename... B> deducted(A a,B... b)->deducted<0,A,B...>;
//
int main(){
deducted a={"","",""};
deducted b={0,0,0};
array c={0,0,0};
}
what supprises me is the test fails with error: too many initializers for 'deducted<0, const char*, const char*, const char*>'
but the std::array
version works fine. What could i be possibly missing, and can anyone rewrite much better?