From 5cb5b09b198932a0d3bd985fd52fd9fbcb1c2af5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Jun 2015 11:55:27 +0200 Subject: Move some utilities from build2 to libbutl --- build/utility | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) (limited to 'build/utility') diff --git a/build/utility b/build/utility index 87a0e44..717a9ed 100644 --- a/build/utility +++ b/build/utility @@ -8,7 +8,6 @@ #include #include #include -#include // strcmp() #include #include @@ -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 - 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 - 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 - inline reverse_range - reverse_iterate (T& x) - { - return reverse_range (x); - } - - template - inline reverse_range - reverse_iterate (const T& x) - { - return reverse_range (x); - } - // Call a function if there is an exception. // -- cgit v1.1