Permalink
Browse files

(minor changes, part of unrelated diff)

Test Plan: no

Reviewed By: philipp@fb.com

FB internal diff: D512868
  • Loading branch information...
1 parent 53d4209 commit 6dca2b329e9b25799b0856265f02714754087ec4 @tudor tudor committed Jul 6, 2012
Showing with 4 additions and 8 deletions.
  1. +4 −8 folly/Bits.h
View
@@ -528,8 +528,6 @@ BitIterator<BaseIter> findFirstSet(BitIterator<BaseIter> begin,
}
-namespace detail {
-
template <class T, class Enable=void> struct Unaligned;
template <class T>
@@ -539,24 +537,22 @@ struct Unaligned<
T value;
} __attribute__((packed));
-} // namespace detail
-
/**
* Read an unaligned value of type T and return it.
*/
template <class T>
inline T loadUnaligned(const void* p) {
- static_assert(alignof(detail::Unaligned<T>) == 1, "Invalid alignment");
- return static_cast<const detail::Unaligned<T>*>(p)->value;
+ static_assert(alignof(Unaligned<T>) == 1, "Invalid alignment");
+ return static_cast<const Unaligned<T>*>(p)->value;
}
/**
* Write an unaligned value of type T.
*/
template <class T>
inline void storeUnaligned(void* p, T value) {
- static_assert(alignof(detail::Unaligned<T>) == 1, "Invalid alignment");
- static_cast<detail::Unaligned<T>*>(p)->value = value;
+ static_assert(alignof(Unaligned<T>) == 1, "Invalid alignment");
+ static_cast<Unaligned<T>*>(p)->value = value;
}
} // namespace folly

0 comments on commit 6dca2b3

Please sign in to comment.