-//=============================================================================
-// compatibility
-
-#if __GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 7
-// PLEASE UPGRADE TO GCC 4.7 or above
-#define FOLLY_FBV_COMPATIBILITY_MODE
-#endif
-
-#ifndef FOLLY_FBV_COMPATIBILITY_MODE
-
-namespace folly {
-
-template <typename A>
-struct fbv_allocator_traits
- : std::allocator_traits<A> {};
-
-template <typename T>
-struct fbv_is_nothrow_move_constructible
- : std::is_nothrow_move_constructible<T> {};
-
-template <typename T, typename... Args>
-struct fbv_is_nothrow_constructible
- : std::is_nothrow_constructible<T, Args...> {};
-
-template <typename T>
-struct fbv_is_copy_constructible
- : std::is_copy_constructible<T> {};
-
-}
-
-#else
-
-namespace folly {
-
-template <typename A>
-struct fbv_allocator_traits {
- static_assert(sizeof(A) == 0,
- "If you want to use a custom allocator, then you must upgrade to gcc 4.7");
- // for some old code that deals with this case, see D566719, diff number 10.
-};
-
-template <typename T>
-struct fbv_allocator_traits<std::allocator<T>> {
- typedef std::allocator<T> A;
-
- typedef T* pointer;
- typedef const T* const_pointer;
- typedef size_t size_type;
-
- typedef std::false_type propagate_on_container_copy_assignment;
- typedef std::false_type propagate_on_container_move_assignment;
- typedef std::false_type propagate_on_container_swap;
-
- static pointer allocate(A& a, size_type n) {
- return static_cast<pointer>(::operator new(n * sizeof(T)));
- }
- static void deallocate(A& a, pointer p, size_type n) {
- ::operator delete(p);
- }
-
- template <typename R, typename... Args>
- static void construct(A& a, R* p, Args&&... args) {
- new (p) R(std::forward<Args>(args)...);
- }
- template <typename R>
- static void destroy(A& a, R* p) {
- p->~R();
- }
-
- static A select_on_container_copy_construction(const A& a) {
- return a;
- }
-};
-
-template <typename T>
-struct fbv_is_nothrow_move_constructible
- : std::false_type {};
-
-template <typename T, typename... Args>
-struct fbv_is_nothrow_constructible
- : std::false_type {};
-
-template <typename T>
-struct fbv_is_copy_constructible
- : std::true_type {};
-
-}
-
-#endif
-