Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/core/hash_utils.h
- This file was moved from extern/draco/dracoenc/src/draco/core/hash_utils.h.
| Show All 10 Lines | |||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| // See the License for the specific language governing permissions and | // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | // limitations under the License. | ||||
| // | // | ||||
| #ifndef DRACO_CORE_HASH_UTILS_H_ | #ifndef DRACO_CORE_HASH_UTILS_H_ | ||||
| #define DRACO_CORE_HASH_UTILS_H_ | #define DRACO_CORE_HASH_UTILS_H_ | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include <functional> | |||||
| // TODO(fgalligan): Move this to core. | #include <cstddef> | ||||
| #include <functional> | |||||
| namespace draco { | namespace draco { | ||||
| template <typename T1, typename T2> | template <typename T1, typename T2> | ||||
| size_t HashCombine(T1 a, T2 b) { | size_t HashCombine(T1 a, T2 b) { | ||||
| const size_t hash1 = std::hash<T1>()(a); | const size_t hash1 = std::hash<T1>()(a); | ||||
| const size_t hash2 = std::hash<T2>()(b); | const size_t hash2 = std::hash<T2>()(b); | ||||
| return (hash1 << 2) ^ (hash2 << 1); | return (hash1 << 2) ^ (hash2 << 1); | ||||
| Show All 35 Lines | |||||