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
8namespace cyclus {
9
10/// @brief a less-than comparison for pairs
11template <class T> struct SecondLT {
12 bool operator()(const T& x, const T& y) const { return x.second < y.second; }
13};
14
15// taken from
16// http://stackoverflow.com/questions/8473009/how-to-efficiently-compare-two-maps-of-strings-in-c
17template <typename Map> bool map_compare(Map const& lhs, Map const& rhs) {
18 return lhs.size() == rhs.size() &&
19 std::equal(lhs.begin(), lhs.end(), rhs.begin());
20}
21
22} // namespace cyclus
23
24#endif // CYCLUS_SRC_CYC_STD_H_
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
Definition agent.cc:14
bool map_compare(Map const &lhs, Map const &rhs)
Definition cyc_std.h:17
a less-than comparison for pairs
Definition cyc_std.h:11
bool operator()(const T &x, const T &y) const
Definition cyc_std.h:12