What are those extra and seemingly pointless return statements in the void functions ??? What does it do? does it make any difference and is there any case where such statements are needed?
{
// Preconditions: none
// Postconditions: strIn will be added to the messagePad
void messagePad::add(const std::string& strIn)
{
messVect.push_back(strIn);
return;
}
// Preconditions: indexIn must be a valid index of this object
// Postconditions: if indexIn is valid (< messagePad.count()),
// the message at indexIn will be removed.
// if indexIn is invalid, messagePad will assert.
void messagePad::remove(const size_t indexIn)
{
assert(indexIn < messVect.size());
messVect.erase(messVect.begin() + indexIn);
return;
}
// Preconditions: none
// Postconditions: all messages will be removed from the messagePad
void messagePad::clear()
{
messVect.clear();
return;
}
Thank you very much! it's not, by the way, my homework. I didn't do well in this class... so I am just going over the material again, trying to understand everything while I am on a break.