mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 05:10:32 +01:00
Implement day 03 part 1.
This commit is contained in:
16
2019/src/utils.hpp
Normal file
16
2019/src/utils.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
|
||||
namespace aoc2019 {
|
||||
|
||||
template<typename T>
|
||||
void combine_hash(std::size_t& seed, const T& o) {
|
||||
// Algorithm taken from boost::combine_hash.
|
||||
std::hash<T> hash{};
|
||||
seed ^= hash(o) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
||||
}
|
||||
|
||||
std::string_view strtok(std::string_view &str, char token = ',');
|
||||
}
|
||||
Reference in New Issue
Block a user