Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, I did number one but i need #2 and #3 -class name is Pairsummable -language :C++ Specializations 1) for K = std::string and V
Hi, I did number one but i need #2 and #3
-class name is Pairsummable
-language :C++
Specializations
1) for K = std::string and V = std::string, the initial value for summation should be set to empty string ("").
2) for K = std::string and V = int, the initial value for summation should be set to 0.
3) for K = std::string and V = std::string, the function sum() should concatenate the values stored using , as separator (use operator + to concatenate strings).
Answer for (1)
template
std::string PairSummable<:string std::string>::initial = std::string("");
I just need template specilization, i did number 1 and answered it (see below)
here is the sum function, i tried doing the apecialization, is it correct?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started