summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2014-06-17 20:21:12 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2014-06-17 20:26:01 -0400
commit0e8286310e46aafd33f31c4dba18345b8cf194aa (patch)
treefa6a2078c938644f7d399075512754b9a4167d6a /src
parent44e3d0555a8038f510b4dccdb0ac746e927bf394 (diff)
Fix for pre-C++11 is_sorted().
Diffstat (limited to 'src')
-rw-r--r--src/theory/arith/normal_form.cpp4
-rw-r--r--src/theory/arith/normal_form.h8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/theory/arith/normal_form.cpp b/src/theory/arith/normal_form.cpp
index ce0bd9d30..5334abbbf 100644
--- a/src/theory/arith/normal_form.cpp
+++ b/src/theory/arith/normal_form.cpp
@@ -90,7 +90,11 @@ bool Variable::isDivMember(Node n){
bool VarList::isSorted(iterator start, iterator end) {
+#if IS_SORTED_IN_GNUCXX_NAMESPACE
+ return __gnu_cxx::is_sorted(start, end);
+#else /* IS_SORTED_IN_GNUCXX_NAMESPACE */
return std::is_sorted(start, end);
+#endif /* IS_SORTED_IN_GNUCXX_NAMESPACE */
}
bool VarList::isMember(Node n) {
diff --git a/src/theory/arith/normal_form.h b/src/theory/arith/normal_form.h
index 8d37bed23..1a3327e8f 100644
--- a/src/theory/arith/normal_form.h
+++ b/src/theory/arith/normal_form.h
@@ -29,6 +29,10 @@
#include <list>
#include <algorithm>
+#if IS_SORTED_IN_GNUCXX_NAMESPACE
+# include <ext/algorithm>
+#endif /* IS_SORTED_IN_GNUCXX_NAMESPACE */
+
namespace CVC4 {
namespace theory {
namespace arith {
@@ -731,7 +735,11 @@ public:
}
static bool isSorted(const std::vector<Monomial>& m) {
+#if IS_SORTED_IN_GNUCXX_NAMESPACE
+ return __gnu_cxx::is_sorted(m.begin(), m.end());
+#else /* IS_SORTED_IN_GNUCXX_NAMESPACE */
return std::is_sorted(m.begin(), m.end());
+#endif /* IS_SORTED_IN_GNUCXX_NAMESPACE */
}
static bool isStrictlySorted(const std::vector<Monomial>& m) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback