aboutsummaryrefslogtreecommitdiff
path: root/src/cast_hash.h
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2018-11-28 16:58:50 -0500
committerGitHub <noreply@github.com>2018-11-28 16:58:50 -0500
commit0eabcb34cbcddc0ecaec6585d9e0218d6e91f32f (patch)
tree6d44d5eedd798f3150bfaef5a89be9e476e1214c /src/cast_hash.h
parent08f848aae847d99cb9a81fac49401b921e5f930b (diff)
downloadamber-0eabcb34cbcddc0ecaec6585d9e0218d6e91f32f.tar.gz
Fill in some documentation. (#116)
Diffstat (limited to 'src/cast_hash.h')
-rw-r--r--src/cast_hash.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cast_hash.h b/src/cast_hash.h
index c7afbf0..e02c148 100644
--- a/src/cast_hash.h
+++ b/src/cast_hash.h
@@ -17,12 +17,12 @@
namespace amber {
-// A hash implementation for types that can trivially be up-cast to a size_t.
-// For example, use this as a hasher for an enum whose underlying type is
-// an integer no wider than size_t.
-//
-// The need for this was a defect in the C++11 library, and has been fixed
-// in C++14. http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148
+/// A hash implementation for types that can trivially be up-cast to a size_t.
+/// For example, use this as a hasher for an enum whose underlying type is
+/// an integer no wider than size_t.
+///
+/// The need for this was a defect in the C++11 library, and has been fixed
+/// in C++14. http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148
template <typename T>
struct CastHash {
size_t operator()(const T& value) const { return static_cast<size_t>(value); }