Skip to content

Commit fee5ea4

Browse files
committed
Function object (Functors) in C++ STL
1 parent 505ed83 commit fee5ea4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Functors.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ using namespace std;
88
int main(){
99
int arrays[] = {70, 40, 90, 45, 23, 1, 2};
1010
int n = sizeof(arrays) / sizeof(arrays[0]);
11-
sort(arrays, arrays + 5); // assending order
12-
sort(arrays, arrays + 7, greater<int>()); // dessending order
11+
// sort(arrays, arrays + 5); // assending order
12+
// sort(arrays, arrays + 7, greater<int>()); // dessending order
1313
for (int i = 0; i < n; i++)
1414
{
1515
cout << "The array is: " << arrays[i] << endl;
@@ -18,5 +18,7 @@ int main(){
1818
return 0;
1919
}
2020

21+
// C++reference
22+
// algorithm stl
2123

2224
//? Function Object : Function wrapped in a class so that it available like an object

0 commit comments

Comments
 (0)