Develop a template function that takes in a vector and a target value, then returns a std::pair object that: • The pair object's first value should be a vector containing all elements from input vector that are smaller than target. The pair object's second value should be a vector containing all elements from input vector that are equal or greater than target. Test your function in main() with two different types, such as int and string.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
Develop a template function that takes in a vector<T> and a target value, then returns a
std::pair object that:
• The pair object's first value should be a vector containing all elements from input vector
that are smaller than target.
The pair object's second value should be a vector containing all elements from input
vector that are equal or greater than target.
Test your function in main() with two different types, such as int and string.
Transcribed Image Text:Develop a template function that takes in a vector<T> and a target value, then returns a std::pair object that: • The pair object's first value should be a vector containing all elements from input vector that are smaller than target. The pair object's second value should be a vector containing all elements from input vector that are equal or greater than target. Test your function in main() with two different types, such as int and string.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning