Commit 7c94b139 authored by Jim Meyering's avatar Jim Meyering Committed by Sara Golemon

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
parent 797870ec
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment