Technical Interview Questions and Answers :: C++
A predicate is a function object (or a function) that returns a bool.
An object of a class with an application operator is called a function. Like object, a function or simply functions object. Consequently, function objects often execute faster than do ordinary function.
An object that acts like a function is often called function like object (or) simply function. Such function objects are important because they allow us to write code that takes operations as parameters.
When dealing with numeric classes, it sometimes useful to have the arithmetic function available as function objects. Consequently the standard library provides arithmetic operations.
minus binary arg1 - arg2
multiplies binary arg1 * arg2
divides binary arg1 / arg2
modules binary arg1 % arg2
negate Unary -arg1
These algorithms are provided to do the most common forms of updates. Some update a sequence while others produce a new sequence based on information found during a traversal.
Std. algorithm work on data structures thru Iterators. This implies that inserting a new element into a container (or) deleting one is not easy.
A binder allows a two-argument function object to be used as a single-argument function by binding one argument is a value.
A member function adapter allows a member function to be used as an argument to algorithms.
A pointer to function adapter allows a pointer to function to be used as an argument to the algorithm.
Classes such as vector, list, date and complex are concrete in the sense that each is the representation of a relatively simple concept with all the operations essential for the support of that concept.
Each has a one to one correspondence between its interface and an implementation and none are intended as a base for derivation.
The aims of concrete type classes are:
i. To be a close match to a particular concept and implementation strategy.
ii. To provide run-time and space efficiency comparable to handcrafted code through the use of in-lining and of operations taking full advantage of the properties of the concept and its implementation.
iii. To have only minimal dependency on other classes; and
iv. To be comprehensible and usable in isolation.
v. Providing a clear and efficient representation of a single concept.
i. Concrete types are fitted into a hierarchy of related classes.
ii. Each concrete type can be understood in isolation with minimal reference to other classes.
iii. If a concrete type is implemented well, programs using it are comparable in size and speed to programs a user would write using a hand-crafted and specialized version of the concept.
iv. If the implementation changes significantly the interface is usually modified to reflect the change.
v. Concrete type resembles in the built in type.
i. An individual concrete classes are easier to understand and use then is a more general class.
ii. Concrete type is often used for classes that represent well-known data types such as arrays and list.
You can check latest and updated Wipro C++ Interview Questions and Answers on this page. You can filter the question set by the company's name. Looking for the right answer? Don't worry! You can click on view answer section and check the answer with the explanation. You can discuss the answer in the forum with other users easily. Login with Facebook and save the answer To Reading List right now!
Our site contains top IT companies placement paper and mock test to help the freshers and experienced candidate to get hands on experience on the pattern and type of questions. We have curated all the C++ technical interview questions and answers from previous candidates.