Q: What kind of iteration does forward_list provide in C++?
Solution: The forward_list uses singly linked list hence it is uni-directional. In the forward_list, the container provides insertion and removal at anywhere in the program.
Q: What does the size of the vector refers to in c++?
Solution: In vectors, by size we mean the number of elements in that vector array.
Q: Subsequent elements are moved in terms of _____ when an element in inserted in vector?
Solution: The vector maintains a certain order of its elements, so that when a new element is inserted at the beginning or in the middle of the vector, Subsequent elements are moved backwards in terms of their assignment operator or copy constructor.
Q: What is the use of adapter in STL in c++?
Solution: Adapters are data types from STL that adapt a container to provide specific interface.
Q: Which is used to iterate over container?
Solution: Associated iterator type is used to iterate over container.
Q: What does the function objects implement?
Solution: Function objects are objects specifically designed to be used with a syntax similar to that of functions.
Q: What are the two advantage of function objects than the function call?
Solution: A function object can contain state. The second is that a function object is a type and therefore can be used as a template parameter.
Q: Which header is need to be used with function objects?
Solution:header is need to be used with function objects.
Q: Which are instances of a class with member function operator() when it is defined?
Solution: Function objects are instances of a class with member function operator() defined. This member function allows the object to be used with the same syntax as a regular function call.
Q: How many parameters does a operator() in a function object shoud take?
Solution: In the case of binary function objects, this operator() member function will take two parameters.
You Have Score    | /10 |