Question
C++ Template Greater Element to the Right Goal of the code: Turn your solution for Greater Element to the Right into a template function. You
C++ Template Greater Element to the Right
Goal of the code: Turn your solution for "Greater Element to the Right" into a template function. You can assume all data types passed into your function will be comparable types. All tests will be unit tests. You will not know the data types until run time, so it is easier to only rely on unit testing where we will call you function and pass it a predetermined type. To test your function, you should try to pass a vector of floats, doubles, integers, and strings. Input: NO INPUT Output: NO OUTPUT
Complete (fill in the blanks) and follow the instructions shown below in order to do the code.
// Include the necessary header files
// Add appropriate syntax to create template function void greaterRightElement(std::vector*> & vec) { // Use your solution you made for integers. }
int main(){ // Nothing needs to be in main.
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started