Skip to content
Snippets Groups Projects
Commit a64ca159 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[Bugfix][Release] Add typedefs to std::hash specializations for standard compliance

According to the standard, all specializations of std::hash must export
argument_type and result_type [20.8.12/1]. The version of libc++ (LLVM's
alternative C++ standard library) tripped over this requirement on my
machine, so this patch adds the typedefs.
parent 4c79a644
No related branches found
No related tags found
No related merge requests found
......@@ -132,20 +132,23 @@ namespace Dune {
// Macro for defining a std::hash specialization for type.
// This should not be called directly. Call DUNE_DEFINE_HASH
// instead.
#define DUNE_DEFINE_STD_HASH(template_args,type) \
namespace std { \
\
#define DUNE_DEFINE_STD_HASH(template_args,type) \
namespace std { \
\
template<template_args> \
struct hash<type> \
{ \
\
typedef type argument_type; \
typedef std::size_t result_type; \
\
std::size_t operator()(const type& arg) const \
{ \
return hash_value(arg); \
} \
}; \
\
} \
\
} \
// Wrapper macro for template arguments.
// This is required because the template arguments can contain commas,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment