summaryrefslogtreecommitdiff
path: root/utils/value_array.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-27 19:26:31 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-27 19:26:31 +0000
commit1eab70e16f0e0d5531f3babfea2062c82f6362e1 (patch)
treea1ea1930e585b9356c6e089465baa969bb6919bb /utils/value_array.h
parent6ddaff1341e565dd91dca7ea763d0ea4d897f4c7 (diff)
compiles
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@626 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/value_array.h')
-rwxr-xr-xutils/value_array.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/value_array.h b/utils/value_array.h
index a10f754f..f1cc2a84 100755
--- a/utils/value_array.h
+++ b/utils/value_array.h
@@ -305,6 +305,21 @@ bool operator==(ValueArray<T,A> const& v1, ValueArray<T,A> const& v2)
std::equal(v1.begin(),v1.end(),v2.begin());
}
+template <class A>
+bool operator==(ValueArray<char,A> const& v1, ValueArray<char,A> const& v2)
+{
+ typename ValueArray<char,A>::size_type sz=v1.size();
+ return sz == v2.size() &&
+ 0==std::memcmp(v1.begin(),v2.begin(),sizeof(char)*sz);
+}
+
+template <class A>
+bool operator==(ValueArray<unsigned char,A> const& v1, ValueArray<unsigned char,A> const& v2)
+{
+ typename ValueArray<char,A>::size_type sz=v1.size();
+ return sz == v2.size() &&
+ 0==std::memcmp(v1.begin(),v2.begin(),sizeof(char)*sz);
+}
template <class T,class A>
bool operator< (ValueArray<T,A> const& v1, ValueArray<T,A> const& v2)
@@ -315,6 +330,15 @@ bool operator< (ValueArray<T,A> const& v1, ValueArray<T,A> const& v2)
, v2.end() );
}
+template <class A>
+bool operator<(ValueArray<unsigned char,A> const& v1, ValueArray<unsigned char,A> const& v2)
+{
+ typename ValueArray<char,A>::size_type sz=v1.size();
+ return sz == v2.size() &&
+ std::memcmp(v1.begin(),v2.begin(),sizeof(char)*sz)<0;
+}
+
+
template <class T,class A>
void memcpy(void *out,ValueArray<T,A> const& v) {
std::memcpy(out,v.begin(),v.size()*sizeof(T));