mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-18 10:06:54 +01:00
688cd5ed42
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@350 f6dd340e-d3f9-0310-b409-bdd246841980
21 lines
536 B
C++
21 lines
536 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include <functional>
|
|
using namespace std;
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
plus<size_t> uAdd; // function object to add size_ts
|
|
|
|
cout << "3 + 5 = " << uAdd(3, 5) << '\n';
|
|
|
|
plus<string> sAdd; // function object to add strings
|
|
|
|
cout << "argv[0] + argv[1] = " << sAdd(argv[0], argv[1]) << '\n';
|
|
}
|
|
/*
|
|
Output when called as: a.out going
|
|
|
|
3 + 5 = 8
|
|
argv[0] + argv[1] = a.outgoing
|
|
*/
|