aboutsummaryrefslogtreecommitdiff
path: root/build/utility
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-06-18 11:55:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-06-18 11:55:27 +0200
commit5cb5b09b198932a0d3bd985fd52fd9fbcb1c2af5 (patch)
treecd4a22d2edba93c0afc01b638ab092ad4596e100 /build/utility
parent6434d616da5d75577d142e20e0f9fa430bd625df (diff)
Move some utilities from build2 to libbutl
Diffstat (limited to 'build/utility')
-rw-r--r--build/utility54
1 files changed, 0 insertions, 54 deletions
diff --git a/build/utility b/build/utility
index 87a0e44..717a9ed 100644
--- a/build/utility
+++ b/build/utility
@@ -8,7 +8,6 @@
#include <tuple>
#include <string>
#include <utility>
-#include <cstring> // strcmp()
#include <exception>
#include <unordered_set>
@@ -22,59 +21,6 @@ namespace build
extern const path empty_path;
extern const dir_path empty_dir_path;
- // Comparators.
- //
- struct compare_c_string
- {
- bool operator() (const char* x, const char* y) const
- {
- return std::strcmp (x, y) < 0;
- }
- };
-
- struct compare_pointer_target
- {
- template <typename P>
- bool operator() (const P& x, const P& y) const {return *x < *y;}
- };
-
- // Support for reverse iteration using range-based for-loop:
- //
- // for (... : reverse_iterate (x)) ...
- //
- template <typename T>
- class reverse_range
- {
- T& x_;
-
- public:
- reverse_range (T& x): x_ (x) {}
-
- auto begin () -> decltype (this->x_.rbegin ())
- {
- return x_.rbegin ();
- }
-
- auto end () -> decltype (this->x_.rend ())
- {
- return x_.rend ();
- }
- };
-
- template <typename T>
- inline reverse_range<T>
- reverse_iterate (T& x)
- {
- return reverse_range<T> (x);
- }
-
- template <typename T>
- inline reverse_range<const T>
- reverse_iterate (const T& x)
- {
- return reverse_range<const T> (x);
- }
-
// Call a function if there is an exception.
//