KASKADE 7 development version
firstless.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2002-2014 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13#ifndef FIRSTLESS_HH
14#define FIRSTLESS_HH
15
16namespace Kaskade
17{
21 struct FirstLess
22 {
23 template <class Pair>
24 bool operator()(Pair const& p1, Pair const& p2) const
25 {
26 return p1.first < p2.first;
27 }
28 };
29
34 {
35 template <class Pair>
36 bool operator()(Pair const& p1, Pair const& p2) const
37 {
38 return p1.first > p2.first;
39 }
40 };
41} /* end of namespace Kaskade */
42
43#endif
44
A comparator functor that supports sorting std::pair by their first component.
Definition: firstless.hh:34
bool operator()(Pair const &p1, Pair const &p2) const
Definition: firstless.hh:36
A comparator functor that supports sorting std::pair by their first component.
Definition: firstless.hh:22
bool operator()(Pair const &p1, Pair const &p2) const
Definition: firstless.hh:24