Suppose you have a generic algorithm that requires forward iterators. Can I use it with a vector or a list even though these iterators are random access and bidirectional iterators respectively? Explain.
What will be an ideal response?
Yes. Iterators are an inclusive hierarchy. Random access iterators are bidirectional, and bidirectional iterators are forward iterators. So any iterators will work where a weaker iterator is specified.
Computer Science & Information Technology
You might also like to view...
You can create ________ headers and footers to provide useful information about your
worksheet. Fill in the blank(s) with correct word
Computer Science & Information Technology
The file extensions .wav, .mp3, and .ogg are used for:
a. audio files b. video files c. Flash media files d. none of the above
Computer Science & Information Technology