CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <iterator>
using namespace std;
template<typename T>bool pallindrome(std::vector<T>&A);
int main(){
std::vector<int>C{1,2,3,2,1};
for (auto &it:C )
cout << "Values of vector A" << it;
bool result = pallindrome(C);// error of no matching function call why?
cout << result << endl;
}
template<typename T>bool pallindrome( std::vector<T>&A){
std::vector<int>B;
std::reverse(A.begin(), A.end());
copy(A.begin(), A.end(), back_inserter(B));
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run