Question: Can I get some advice about how should I solve this problem, I really have no idea what's been causing the issue from passing these
Can I get some advice about how should I solve this problem, I really have no idea what's been causing the issue from passing these tests.
So here's the test result message:
TestMap::testaccessstandardLeftRead
line: condition:s int
line: condition:mbstnumElements
line: condition:mbstrootpLeftpRight nullptr
TestMap::testaccessstandardLeftWrite
line: condition:mbstrootpLeftdata.second int
line: condition:mbstnumElements
line: condition:mbstrootpLeftpRight nullptr
TestMap::testaccessstandardRightRead
line: condition:s int
line: condition:mbstnumElements
line: condition:mbstrootpRightpRight nullptr
TestMap::testaccessstandardRightWrite
line: condition:mbstrootpRightdata.second int
line: condition:mbstnumElements
line: condition:mbstrootpRightpRight nullptr
TestMap::testaccessstandardRootRead
line: condition:s int
line: condition:mbstnumElements
line: condition:mbstrootpRightpLeft nullptr
TestMap::testaccessstandardRootWrite
line: condition:mbstrootdata.second int
line: condition:mbstnumElements
line: condition:mbstrootpRightpLeft nullptr
And here's the code I think that need to improve:
MAP :: ACCESS
template
const V& map::operatorconst K& k const
auto it bstfindPairsk V;
if it bstend
throw std::outofrangeinvalid map key";
return itsecond;
template
V& map::operatorconst K& k
auto result bstinsertPairsk V;
return constcastresultfirstsecond;
template
const V& map::atconst K& k const
auto it bstfindPairsk V;
if it bstend
throw std::outofrangeinvalid map key";
return itoperatorsecond;
template
V& map::atconst K& k
auto it bstfindPairsk V;
if it bstend
throw std::outofrangeinvalid map key";
return constcastitoperatorsecond;
template
typename map::iterator map::findconst K& k
return iteratorbstfindPairsk V;
MAP :: INSERT
template
custom::pair::iterator, bool map::insertconst Pairs& rhs
auto result bstinsertrhs;
return custom::pairiteratorresultfirst result.second;
template
custom::pair::iterator, bool map::insertPairs&& rhs
auto result bstinsertstd::moverhs;
return custom::pairiteratorresultfirst result.second;
template
template
void map::insertIterator first, Iterator last
for auto it first; it last; it
bstinsertit;
template
void map::insertconst std::initializerlist & il
insertilbegin ilend;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
