Use memcmp() from namespace std

Don't rely on clients using

    #include <string.h>

before including cmp.hpp .
This commit is contained in:
Bård Skaflestad
2016-03-07 12:53:59 +01:00
parent b38cedf113
commit b17d618c7b

View File

@@ -21,6 +21,7 @@
#define COMMON_UTIL_NUMERIC_CMP
#include <cstddef>
#include <cstring>
#include <vector>
#include <type_traits>
#include <cmath>
@@ -109,7 +110,7 @@ namespace Opm {
template<typename T>
bool array_equal(const T* p1, const T* p2, size_t num_elements, T abs_eps, T rel_eps) {
if (memcmp(p1 , p2 , num_elements * sizeof * p1) == 0)
if (std::memcmp(p1 , p2 , num_elements * sizeof * p1) == 0)
return true;
else {
size_t index;