Problem

Define equality and inequality operators for your StrBlob (§ 12.1.1, p. 456), StrBlobPtr (...

Define equality and inequality operators for your StrBlob (§ 12.1.1, p. 456), StrBlobPtr (§ 12.1.6, p. 474), StrVec (§ 13.5, p. 526), and String (§ 13.5, p. 531) classes.

§ 12.1.1 (p. 456)

Exercise 12.1

How many elements do b1 and b2 have at the end of this code?

StrBlob b1;{    StrBlob b2 = {"a", "an", "the"};    b1 = b2;    b2.push_back("about");}

Exercise 12.2

Write your own version of the StrBlob class including the const versions of front and back.

§ 12.1.6 (p. 474)

Exercise 12.19

Define your own version of StrBlobPtr and update your StrBlob class with the appropriate friend declaration and begin and end members.

Exercise 12.20

Write a program that reads an input file a line at a time into a StrBlob and uses a StrBlobPtr to print each element in that StrBlob.

§ 13.5 (p. 526)

Exercise 13.39

Write your own version of StrVec, including versions of reserve, capacity (§ 9.4, p. 356), and resize (§ 9.3.5, p. 352).

§ 9.4 (p. 356)

Exercise 9.31

The program on page 354 to remove even-valued elements and duplicate odd ones will not work on a list or forward_list. Why? Revise the program so that it works on these types as well.

Exercise 9.32

In the program onpage 354 would it be legal to write the call to insert as follows? If not, why not?

iter = vi.insert(iter, *iter++);

Exercise 9.40

Add a constructor that takes an initializer_list to your StrVec class.

§ 13.5, p. 531

Exercise 13.39

Write your own version of StrVec, including versions of reserve, capacity (§ 9.4, p. 356), and resize (§ 9.3.5, p. 352).

§ 9.4 (p. 356)

Exercise 9.31

The program on page 354 to remove even-valued elements and duplicate odd ones will not work on a list or forward_list. Why? Revise the program so that it works on these types as well.

Exercise 9.32

In the program onpage 354 would it be legal to write the call to insert as follows? If not, why not?

iter = vi.insert(iter, *iter++);

Exercise 13.40

Add a constructor that takes an initializer_list to your StrVec class.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT