How should I modify my present function signature
template<class TypeData,typename TypeFunc1 = Identity,typename TypeFunc2>
bool isPrime(const TypeData& n,TypeFunc1 calcSqrt = {},TypeFunc2 isDivisible = [](const TypeData& a,const TypeData& b) {return a%b==0;},const bool debug = false)
in order to be called from
auto fSqrt = [](decltype(n) v) {return std::sqrt(static_cast<float>(v));};
std::cout<<(isPrime(n,fSqrt)?"Positive":"Negative")<<'\n';
Visual Studio 2019 gives
C2783 'bool isPrime(const TypeData &,TypeFunc1,TypeFunc2,const bool)': could not deduce template argument for 'TypeFunc2'
Everything fine without TypeFunc2 isDivisible = [](const TypeData& a,const TypeData& b) {return a%b==0;}
, though.
What is the correct syntax for passing default lambda?
Kindly help me, please.