folly: avoid use of has_trivial_destructor in FBVector.h
authorJim Meyering <meyering@fb.com>
Wed, 29 May 2013 01:06:16 +0000 (18:06 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 28 Aug 2013 21:30:11 +0000 (14:30 -0700)
Summary:
This is required for gcc-4.8.x.
Use boost::has_trivial_destructor, not std::has_trivial_destructor.
The latter was never standard, and the now-std name (and the only one
supported in gcc-4.8.0) is std::is_trivially_destructible.

Test Plan:
fbmake runtests and then
run_unit_tests.sh with -r and again with -d

Reviewed By: njormrod@fb.com

FB internal diff: D923359

@override-unit-failures

folly/FBVector.h

index 9e593c608a56dabf8e556b77aa6ef1ca77fd5a33..7a0cc0f54f0dda23fb3a2e479ed89598d010bd2c 100644 (file)
@@ -428,7 +428,7 @@ private:
 
   void M_destroy(T* p) noexcept {
     if (usingStdAllocator::value) {
-      if (!std::has_trivial_destructor<T>::value) p->~T();
+      if (!boost::has_trivial_destructor<T>::value) p->~T();
     } else {
       folly::fbv_allocator_traits<Allocator>::destroy(impl_, p);
     }
@@ -466,7 +466,7 @@ private:
 
   // optimized
   static void S_destroy_range(T* first, T* last) noexcept {
-    if (!std::has_trivial_destructor<T>::value) {
+    if (!boost::has_trivial_destructor<T>::value) {
       // EXPERIMENTAL DATA on fbvector<vector<int>> (where each vector<int> has
       //  size 0).
       // The unrolled version seems to work faster for small to medium sized
@@ -1761,4 +1761,3 @@ void attach(fbvector<T, A>& v, T* data, size_t sz, size_t cap) {
 } // namespace folly
 
 #endif // FOLLY_FBVECTOR_H
-