CYCLUS
Loading...
Searching...
No Matches
cyc_std.h
Go to the documentation of this file.
1
#ifndef CYCLUS_SRC_CYC_STD_H_
2
#define CYCLUS_SRC_CYC_STD_H_
3
4
#include <functional>
5
#include <utility>
6
7
/// @brief a collection of tools that are standard-library like
8
namespace
cyclus
{
9
10
/// @brief a less-than comparison for pairs
11
template
<
class
T>
12
struct
SecondLT
{
13
bool
operator()
(
const
T& x,
const
T& y)
const
{
14
return
x.second < y.second;
15
}
16
};
17
18
// taken from
19
// http://stackoverflow.com/questions/8473009/how-to-efficiently-compare-two-maps-of-strings-in-c
20
template
<
typename
Map>
21
bool
map_compare
(Map
const
& lhs, Map
const
& rhs) {
22
return
lhs.size() == rhs.size()
23
&& std::equal(lhs.begin(), lhs.end(), rhs.begin());
24
}
25
26
}
// namespace cyclus
27
28
#endif
// CYCLUS_SRC_CYC_STD_H_
cyclus
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition
agent.cc:14
cyclus::map_compare
bool map_compare(Map const &lhs, Map const &rhs)
Definition
cyc_std.h:21
cyclus::SecondLT
a less-than comparison for pairs
Definition
cyc_std.h:12
cyclus::SecondLT::operator()
bool operator()(const T &x, const T &y) const
Definition
cyc_std.h:13
src
cyc_std.h
Generated by
1.11.0