Anonymous user
Averages/Mode: Difference between revisions
→{{header|C++}}
No edit summary |
|||
Line 270:
=={{header|C++}}==
{{works with|g++|4.3.2}}
<lang cpp>#include <iterator>
#include <utility>
#include <algorithm>
Line 282 ⟶ 281:
referring(T const& t): value(t) {}
template<typename Iter>
bool operator()(std::pair<Iter, int> const& p) const
{
return *p.first == value;
Line 337 ⟶ 336:
std::ostream_iterator<int>(std::cout, " "));
std::cout << std::endl;
return 0;
}</lang>
Output:
2 3
=={{header|C sharp|C#}}==
<lang csharp>
|