mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 13:20:32 +01:00
Small reading utility.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <charconv>
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
|
||||
namespace aoc2019 {
|
||||
|
||||
template<typename T>
|
||||
inline std::from_chars_result from_chars(std::string_view str, T& value) {
|
||||
return std::from_chars(str.data(), str.data() + str.size(), value);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void combine_hash(std::size_t& seed, const T& o) {
|
||||
// Algorithm taken from boost::combine_hash.
|
||||
|
||||
Reference in New Issue
Block a user