1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix addressof implementation

This commit is contained in:
bolero-MURAKAMI 2015-03-04 23:01:10 +09:00
parent 586c9972dc
commit 5b190c8b6e
9 changed files with 34 additions and 28 deletions

View file

@ -143,7 +143,7 @@ namespace sprout {
}
template<typename T, std::size_t N>
inline SPROUT_CONSTEXPR std::size_t
hash_value_impl(T const (&v)[N]) {
hash_value_impl(T const (& v)[N]) {
return sprout::hash_range(v);
}
template<typename T>
@ -151,7 +151,7 @@ namespace sprout {
!std::is_arithmetic<T>::value && !std::is_enum<T>::value && !std::is_pointer<T>::value,
std::size_t
>::type
hash_value_impl(T const &v) {
hash_value_impl(T const& v) {
return std::hash<typename std::decay<T>::type>()(v);
}
} // namespace hash_detail

View file

@ -19,6 +19,7 @@
#include <sprout/functional/base.hpp>
#include <sprout/functional/type_traits/weak_result_type.hpp>
#include <sprout/functional/type_traits/has_type.hpp>
#include <sprout/memory/addressof.hpp>
namespace sprout {
// 20.8.3 reference_wrapper
@ -152,7 +153,7 @@ namespace sprout {
public:
// construct/copy/destroy
SPROUT_CONSTEXPR reference_wrapper(T& t) SPROUT_NOEXCEPT
: t_(&t)
: t_(sprout::addressof(t))
{}
reference_wrapper(reference_wrapper const&) = default;
// assignment