Export of internal Abseil changes.
-- 28b634d3e8e879546e20006b81086a2b02390f1d by Abseil Team <absl-team@google.com>: Indicate Solaris / Illumos has mmap support https://github.com/abseil/abseil-cpp/pull/139 This change is **untested** as Abseil does not officially support Solaris/Illumos. PiperOrigin-RevId: 205094615 -- 3c4cc80abcd91c6cd88209a61b50936d1c498bac by Xiaoyi Zhang <zhangxy@google.com>: Make is_trivially_copy_assignable work with reference types. PiperOrigin-RevId: 204982099 -- 98c6658b3d6cd5eddba9f498747dc84c172ffe05 by Abseil Team <absl-team@google.com>: Fix typo in comments for c_mismatch. PiperOrigin-RevId: 204962537 -- deef8b23585f7831d67c1d4b1c9ef7f3e30d9028 by Matt Kulukundis <kfm@google.com>: Internal change PiperOrigin-RevId: 204956873 GitOrigin-RevId: 28b634d3e8e879546e20006b81086a2b02390f1d Change-Id: I1da029f8cb83d83ee5a05f3b0c6a07bc3dd5368e
This commit is contained in:
parent
b973bc53ef
commit
42f22a2840
4 changed files with 8 additions and 4 deletions
|
@ -314,7 +314,7 @@ container_algorithm_internal::ContainerDifferenceType<const C> c_count_if(
|
||||||
|
|
||||||
// c_mismatch()
|
// c_mismatch()
|
||||||
//
|
//
|
||||||
// Container-based version of the <algorithm> `std::mismatchf()` function to
|
// Container-based version of the <algorithm> `std::mismatch()` function to
|
||||||
// return the first element where two ordered containers differ.
|
// return the first element where two ordered containers differ.
|
||||||
template <typename C1, typename C2>
|
template <typename C1, typename C2>
|
||||||
container_algorithm_internal::ContainerIterPairType<C1, C2>
|
container_algorithm_internal::ContainerIterPairType<C1, C2>
|
||||||
|
|
|
@ -1788,5 +1788,4 @@ TEST(AllocatorSupportTest, SizeAllocConstructor) {
|
||||||
EXPECT_THAT(v, AllOf(SizeIs(len), Each(0)));
|
EXPECT_THAT(v, AllOf(SizeIs(len), Each(0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
|
@ -263,7 +263,8 @@ struct is_trivially_copy_constructible
|
||||||
// `is_trivially_assignable<T&, const T&>`.
|
// `is_trivially_assignable<T&, const T&>`.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct is_trivially_copy_assignable
|
struct is_trivially_copy_assignable
|
||||||
: std::integral_constant<bool, __has_trivial_assign(T) &&
|
: std::integral_constant<
|
||||||
|
bool, __has_trivial_assign(typename std::remove_reference<T>::type) &&
|
||||||
std::is_copy_assignable<T>::value> {
|
std::is_copy_assignable<T>::value> {
|
||||||
#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
|
#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -528,6 +528,10 @@ TEST(TypeTraitsTest, TestTrivialCopyAssign) {
|
||||||
// Verify that arrays are not trivially copy assignable
|
// Verify that arrays are not trivially copy assignable
|
||||||
using int10 = int[10];
|
using int10 = int[10];
|
||||||
EXPECT_FALSE(absl::is_trivially_copy_assignable<int10>::value);
|
EXPECT_FALSE(absl::is_trivially_copy_assignable<int10>::value);
|
||||||
|
|
||||||
|
// Verify that references are handled correctly
|
||||||
|
EXPECT_TRUE(absl::is_trivially_copy_assignable<Trivial&&>::value);
|
||||||
|
EXPECT_TRUE(absl::is_trivially_copy_assignable<Trivial&>::value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ABSL_INTERNAL_EXPECT_ALIAS_EQUIVALENCE(trait_name, ...) \
|
#define ABSL_INTERNAL_EXPECT_ALIAS_EQUIVALENCE(trait_name, ...) \
|
||||||
|
|
Loading…
Reference in a new issue