namespace simgrid {
namespace xbt {
-/** @brief Comparator class for using with std::priority_queue or boost::heap.
- *
- * Compare two std::pair by their first element (of type double), and return true when the first is greater than the
- * second. Useful to have priority queues with the smallest element on top.
- */
-template <class Pair> class HeapComparator {
-public:
- bool operator()(const Pair& a, const Pair& b) const { return a.first > b.first; }
-};
-
/** @brief Sorts the elements of the sequence [first, last) according to their color assuming elements can have only
* three colors. Since there are only three colors, it is linear and much faster than a classical sort. See for
* example http://en.wikipedia.org/wiki/Dutch_national_flag_problem
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#ifndef XBT_UTILITY_HPP
+#define XBT_UTILITY_HPP
+
#include <tuple>
namespace simgrid {
namespace xbt {
+/** @brief Comparator class for using with std::priority_queue or boost::heap.
+ *
+ * Compare two std::pair by their first element (of type double), and return true when the first is greater than the
+ * second. Useful to have priority queues with the smallest element on top.
+ */
+template <class Pair> class HeapComparator {
+public:
+ bool operator()(const Pair& a, const Pair& b) const { return a.first > b.first; }
+};
+
// integer_sequence and friends from C++14
// We need them to implement `apply` from C++17.
}
}
+#endif
#include <xbt/algorithm.hpp>
#include <xbt/functional.hpp>
+#include <xbt/utility.hpp>
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
#ifndef SURF_MODEL_H_
#define SURF_MODEL_H_
-#include "xbt/algorithm.hpp"
#include "xbt/signal.hpp"
+#include "xbt/utility.hpp"
#include "src/surf/surf_private.hpp"
#include "surf/surf.hpp"