From: Jim Meyering Date: Wed, 29 May 2013 01:06:16 +0000 (-0700) Subject: folly: avoid use of has_trivial_destructor in FBVector.h X-Git-Tag: v0.22.0~906 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7c94b13973b22a1e61155429e126280147294bc2;p=folly.git folly: avoid use of has_trivial_destructor in FBVector.h 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 --- diff --git a/folly/FBVector.h b/folly/FBVector.h index 9e593c60..7a0cc0f5 100644 --- a/folly/FBVector.h +++ b/folly/FBVector.h @@ -428,7 +428,7 @@ private: void M_destroy(T* p) noexcept { if (usingStdAllocator::value) { - if (!std::has_trivial_destructor::value) p->~T(); + if (!boost::has_trivial_destructor::value) p->~T(); } else { folly::fbv_allocator_traits::destroy(impl_, p); } @@ -466,7 +466,7 @@ private: // optimized static void S_destroy_range(T* first, T* last) noexcept { - if (!std::has_trivial_destructor::value) { + if (!boost::has_trivial_destructor::value) { // EXPERIMENTAL DATA on fbvector> (where each vector has // size 0). // The unrolled version seems to work faster for small to medium sized @@ -1761,4 +1761,3 @@ void attach(fbvector& v, T* data, size_t sz, size_t cap) { } // namespace folly #endif // FOLLY_FBVECTOR_H -