MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / compare

Method compare

include/cpp/marshal/View.hpp:102–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101template<class T>
102inline int cpp::marshal::View<T>::compare(const View<T>& inRHS) const
103{
104 auto common = length < inRHS.length ? length : inRHS.length;
105 auto result = std::memcmp(ptr.ptr, inRHS.ptr.ptr, sizeof(T) * common);
106
107 if (result)
108 {
109 return result;
110 }
111
112 return length - inRHS.length;
113}
114
115template<class T>
116inline bool cpp::marshal::View<T>::operator==(const View<T>& inRHS) const

Calls 1

memcmpFunction · 0.50

Tested by

no test coverage detected