The files for this lab are in ~cs253/pub/Labs/ContainerLab. Copy them to your directory.
In this lab, we will examine a template class called
fix
that implements
a fixed-size array (as opposed to the standard container vector,
which implements a variable-size array).
-std=c++11
) and execute
main1.cc.
Why is the fourth value so strange?
f[14]
doesn’t exist, no error message is given.
Change the operator[]
method in fix.h
to detect this error,
show a message, and exit.
iterator
sub-class
of fix
, and the changes to begin()
and end()
? The last
increment of the iterator is invalid. However, this error is not
detected. Change fix2.h so that this
error is detected, the same as in the previous step.
Modified: 2014-04-24T19:27 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |