This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logging when an AbsolutePath instance is not actually absolute
- Loading branch information
1 parent
2ed3437
commit af8997e
Showing
9 changed files
with
107 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
|
||
// http://stackoverflow.com/a/38140932 | ||
// | ||
// struct SomeHashKey { | ||
// std::string key1; | ||
// std::string key2; | ||
// bool key3; | ||
// }; | ||
// MAKE_HASHABLE(SomeHashKey, t.key1, t.key2, t.key3) | ||
|
||
inline void hash_combine(std::size_t& seed) {} | ||
|
||
template <typename T, typename... Rest> | ||
inline void hash_combine(std::size_t& seed, const T& v, Rest... rest) { | ||
std::hash<T> hasher; | ||
seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); | ||
hash_combine(seed, rest...); | ||
} | ||
|
||
#define MAKE_HASHABLE(type, ...) \ | ||
namespace std { \ | ||
template <> \ | ||
struct hash<type> { \ | ||
std::size_t operator()(const type& t) const { \ | ||
std::size_t ret = 0; \ | ||
hash_combine(ret, __VA_ARGS__); \ | ||
return ret; \ | ||
} \ | ||
}; \ | ||
} | ||
|
||
#define MAKE_ENUM_HASHABLE(type) \ | ||
namespace std { \ | ||
template <> \ | ||
struct hash<type> { \ | ||
std::size_t operator()(const type& t) const { \ | ||
return hash<int>()(static_cast<int>(t)); \ | ||
} \ | ||
}; \ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters