diff --git a/folly/AtomicHashMap-inl.h b/folly/AtomicHashMap-inl.h index 41988d189af..c73c13e90c9 100644 --- a/folly/AtomicHashMap-inl.h +++ b/folly/AtomicHashMap-inl.h @@ -164,7 +164,8 @@ AtomicHashMap< // Alloc a new map and shove it in. We can change whatever // we want because other threads are waiting on us... size_t numCellsAllocated = - (size_t)(primarySubMap->capacity_ * std::pow(1.0 + kGrowthFrac_, nextMapIdx - 1)); + (size_t)(primarySubMap->capacity_ * + std::pow(1.0 + kGrowthFrac_, nextMapIdx - 1)); size_t newSize = size_t(numCellsAllocated * kGrowthFrac_); DCHECK( subMaps_[nextMapIdx].load(std::memory_order_relaxed) == diff --git a/folly/AtomicUnorderedMap.h b/folly/AtomicUnorderedMap.h index b974d60435e..bfd58e16cb8 100644 --- a/folly/AtomicUnorderedMap.h +++ b/folly/AtomicUnorderedMap.h @@ -271,10 +271,14 @@ struct AtomicUnorderedInsertMap { // else in this function can throw an exception. In the event of an // exception, deallocate as if the KV was beaten in a concurrent addition. const auto idx = allocateNear(slot); - SCOPE_FAIL { slots_[idx].stateUpdate(CONSTRUCTING, EMPTY); }; + SCOPE_FAIL { + slots_[idx].stateUpdate(CONSTRUCTING, EMPTY); + }; Key* addr = &slots_[idx].keyValue().first; new (addr) Key(key); - SCOPE_FAIL { addr->~Key(); }; + SCOPE_FAIL { + addr->~Key(); + }; func(static_cast(&slots_[idx].keyValue().second)); while (true) { diff --git a/folly/Benchmark.h b/folly/Benchmark.h index 6b7a38d0741..1cf7b464b22 100644 --- a/folly/Benchmark.h +++ b/folly/Benchmark.h @@ -165,7 +165,9 @@ struct BenchmarkSuspender : BenchmarkSuspenderBase { template auto dismissing(F f) -> invoke_result_t { - SCOPE_EXIT { rehire(); }; + SCOPE_EXIT { + rehire(); + }; dismiss(); return f(); } diff --git a/folly/Expected.h b/folly/Expected.h index 734bcaa40f1..823ac6c6884 100644 --- a/folly/Expected.h +++ b/folly/Expected.h @@ -660,10 +660,11 @@ struct ExpectedHelper { class... Fns, class E = ExpectedErrorType, class T = ExpectedHelper> - static auto then_(This&& ex, Fn&& fn, Fns&&... fns) -> decltype(T::then_( - T::template return_( - (std::declval()(std::declval().value()), unit)), - std::declval()...)) { + static auto then_(This&& ex, Fn&& fn, Fns&&... fns) + -> decltype(T::then_( + T::template return_( + (std::declval()(std::declval().value()), unit)), + std::declval()...)) { if (FOLLY_LIKELY(ex.which_ == expected_detail::Which::eValue)) { return T::then_( T::template return_( @@ -1122,7 +1123,8 @@ class Expected final : expected_detail::ExpectedStorage { * swap */ void swap(Expected& that) noexcept( - std::is_nothrow_swappable_v&& std::is_nothrow_swappable_v) { + std::is_nothrow_swappable_v && + std::is_nothrow_swappable_v) { if (this->uninitializedByException() || that.uninitializedByException()) { throw_exception>(); } @@ -1249,7 +1251,7 @@ class Expected final : expected_detail::ExpectedStorage { template = 1)> auto then(Fns&&... fns) const& -> decltype(expected_detail::ExpectedHelper::then_( - std::declval(), std::declval()...)) { + std::declval(), std::declval()...)) { if (this->uninitializedByException()) { throw_exception>(); } @@ -1259,7 +1261,8 @@ class Expected final : expected_detail::ExpectedStorage { template = 1)> auto then(Fns&&... fns) & -> decltype(expected_detail::ExpectedHelper::then_( - std::declval(), std::declval()...)) { + std::declval(), + std::declval()...)) { if (this->uninitializedByException()) { throw_exception>(); } @@ -1269,7 +1272,8 @@ class Expected final : expected_detail::ExpectedStorage { template = 1)> auto then(Fns&&... fns) && -> decltype(expected_detail::ExpectedHelper::then_( - std::declval(), std::declval()...)) { + std::declval(), + std::declval()...)) { if (this->uninitializedByException()) { throw_exception>(); } @@ -1284,7 +1288,7 @@ class Expected final : expected_detail::ExpectedStorage { template = 1)> auto orElse(Fns&&... fns) const& -> decltype(expected_detail::ExpectedHelper::orElse_( - std::declval(), std::declval()...)) { + std::declval(), std::declval()...)) { if (this->uninitializedByException()) { throw_exception>(); } @@ -1295,7 +1299,7 @@ class Expected final : expected_detail::ExpectedStorage { template = 1)> auto orElse(Fns&&... fns) & -> decltype(expected_detail::ExpectedHelper::orElse_( - std::declval(), std::declval()...)) { + std::declval(), std::declval()...)) { if (this->uninitializedByException()) { throw_exception>(); } @@ -1306,7 +1310,7 @@ class Expected final : expected_detail::ExpectedStorage { template = 1)> auto orElse(Fns&&... fns) && -> decltype(expected_detail::ExpectedHelper::orElse_( - std::declval(), std::declval()...)) { + std::declval(), std::declval()...)) { if (this->uninitializedByException()) { throw_exception>(); } @@ -1330,7 +1334,7 @@ class Expected final : expected_detail::ExpectedStorage { template auto thenOrThrow(Yes&& yes, No&& no = No{}) & -> decltype(std::declval()( - std::declval())) { + std::declval())) { using Ret = decltype(std::declval()(std::declval())); if (this->uninitializedByException()) { throw_exception>(); @@ -1459,7 +1463,7 @@ inline bool operator>=( */ template void swap(Expected& lhs, Expected& rhs) noexcept( - std::is_nothrow_swappable_v&& std::is_nothrow_swappable_v) { + std::is_nothrow_swappable_v && std::is_nothrow_swappable_v) { lhs.swap(rhs); } diff --git a/folly/File.cpp b/folly/File.cpp index f61fc3cc736..b0ac777cedd 100644 --- a/folly/File.cpp +++ b/folly/File.cpp @@ -76,7 +76,9 @@ File::~File() { // make a temp file with tmpfile(), dup the fd, then return it in a File. FILE* tmpFile = tmpfile(); checkFopenError(tmpFile, "tmpfile() failed"); - SCOPE_EXIT { fclose(tmpFile); }; + SCOPE_EXIT { + fclose(tmpFile); + }; // TODO(nga): consider setting close-on-exec for the resulting FD int fd = ::dup(fileno(tmpFile)); diff --git a/folly/Function.h b/folly/Function.h index 57c6f77d94d..3dd8705ef93 100644 --- a/folly/Function.h +++ b/folly/Function.h @@ -264,7 +264,7 @@ constexpr bool isEmptyFunction(T const& t) { } template -using CallableResult = decltype(FOLLY_DECLVAL(F &&)(FOLLY_DECLVAL(Args &&)...)); +using CallableResult = decltype(FOLLY_DECLVAL(F&&)(FOLLY_DECLVAL(Args&&)...)); template constexpr bool CallableNoexcept = diff --git a/folly/IPAddressV6.cpp b/folly/IPAddressV6.cpp index 32a15e685cb..39a1313aad6 100644 --- a/folly/IPAddressV6.cpp +++ b/folly/IPAddressV6.cpp @@ -107,7 +107,9 @@ Expected IPAddressV6::tryFromString( hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICHOST; if (::getaddrinfo(ipBuffer.data(), nullptr, &hints, &result) == 0) { - SCOPE_EXIT { ::freeaddrinfo(result); }; + SCOPE_EXIT { + ::freeaddrinfo(result); + }; const struct sockaddr_in6* sa = reinterpret_cast(result->ai_addr); return IPAddressV6(*sa); diff --git a/folly/Indestructible.h b/folly/Indestructible.h index 682fef88af4..6757a6909dc 100644 --- a/folly/Indestructible.h +++ b/folly/Indestructible.h @@ -140,7 +140,7 @@ class Indestructible final { T const* operator->() const noexcept { return get(); } /* implicit */ operator T&() noexcept { return *get(); } - /* implicit */ operator T const &() const noexcept { return *get(); } + /* implicit */ operator T const&() const noexcept { return *get(); } private: struct Storage { diff --git a/folly/Overload.h b/folly/Overload.h index 72525d91ec0..2147a0dc6bb 100644 --- a/folly/Overload.h +++ b/folly/Overload.h @@ -64,7 +64,7 @@ struct FunctionClassType Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return function_(std::forward(args)...); } @@ -90,11 +90,11 @@ struct FunctionClassType Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return (self.*memberPointer_)(std::forward(args)...); } constexpr auto operator()(Self&& self, Args... args) const - FOLLY_DETAIL_NOEXCEPT_SPECIFICATION -> Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return (self.*memberPointer_)(std::forward(args)...); } @@ -115,7 +115,7 @@ struct FunctionClassType Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return (self.*memberPointer_)(std::forward(args)...); } @@ -135,7 +135,7 @@ struct FunctionClassType< /* implicit */ constexpr type(Ptr memberPointer) noexcept : memberPointer_(memberPointer) {} constexpr auto operator()(Self& self, Args&&... args) const - FOLLY_DETAIL_NOEXCEPT_SPECIFICATION -> Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return (self.*memberPointer_)(std::forward(args)...); } @@ -156,7 +156,7 @@ struct FunctionClassType< /* implicit */ constexpr type(Ptr memberPointer) noexcept : memberPointer_(memberPointer) {} constexpr auto operator()(const Self& self, Args... args) const - FOLLY_DETAIL_NOEXCEPT_SPECIFICATION -> Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return (self.*memberPointer_)(std::forward(args)...); } @@ -176,7 +176,7 @@ struct FunctionClassType< /* implicit */ constexpr type(Ptr memberPointer) noexcept : memberPointer_(memberPointer) {} constexpr auto operator()(Self&& self, Args... args) const - FOLLY_DETAIL_NOEXCEPT_SPECIFICATION -> Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return (std::move(self).*memberPointer_)(std::forward(args)...); } @@ -197,7 +197,7 @@ struct FunctionClassType< /* implicit */ constexpr type(Ptr memberPointer) noexcept : memberPointer_(memberPointer) {} constexpr auto operator()(const Self&& self, Args... args) const - FOLLY_DETAIL_NOEXCEPT_SPECIFICATION -> Return { + FOLLY_DETAIL_NOEXCEPT_SPECIFICATION->Return { return (std::move(self).*memberPointer_)(std::forward(args)...); } diff --git a/folly/Poly.h b/folly/Poly.h index baa2d3775f9..7bf7edb7d26 100644 --- a/folly/Poly.h +++ b/folly/Poly.h @@ -217,7 +217,8 @@ template < typename... As, std::enable_if_t::value, int> = 0> auto poly_call(Poly&& _this, As&&... as) -> decltype(poly_call( - static_cast(_this).get(), static_cast(as)...)) { + static_cast(_this).get(), + static_cast(as)...)) { return poly_call( static_cast(_this).get(), static_cast(as)...); } diff --git a/folly/Replaceable.h b/folly/Replaceable.h index a97cd6e4d43..233ea1e4026 100644 --- a/folly/Replaceable.h +++ b/folly/Replaceable.h @@ -280,8 +280,8 @@ struct move_assignment_mixin { move_assignment_mixin(move_assignment_mixin const&) = default; inline move_assignment_mixin& operator=(move_assignment_mixin&& other) noexcept( - std::is_nothrow_destructible::value&& - std::is_nothrow_move_constructible::value) { + std::is_nothrow_destructible::value && + std::is_nothrow_move_constructible::value) { T* destruct_ptr = std::launder(reinterpret_cast( reinterpret_cast*>(this)->storage_)); destruct_ptr->~T(); @@ -344,8 +344,8 @@ struct copy_assignment_mixin { copy_assignment_mixin& operator=(copy_assignment_mixin&&) = default; inline copy_assignment_mixin& operator=(copy_assignment_mixin const& other) noexcept( - std::is_nothrow_destructible::value&& - std::is_nothrow_copy_constructible::value) { + std::is_nothrow_destructible::value && + std::is_nothrow_copy_constructible::value) { T* destruct_ptr = std::launder(reinterpret_cast( reinterpret_cast*>(this)->storage_)); destruct_ptr->~T(); diff --git a/folly/String.cpp b/folly/String.cpp index 9c2e9521f91..e4ee383f1d1 100644 --- a/folly/String.cpp +++ b/folly/String.cpp @@ -220,7 +220,9 @@ void stringAppendfImpl(std::string& output, const char* format, va_list args) { std::string stringPrintf(const char* format, ...) { va_list ap; va_start(ap, format); - SCOPE_EXIT { va_end(ap); }; + SCOPE_EXIT { + va_end(ap); + }; return stringVPrintf(format, ap); } @@ -235,7 +237,9 @@ std::string stringVPrintf(const char* format, va_list ap) { std::string& stringAppendf(std::string* output, const char* format, ...) { va_list ap; va_start(ap, format); - SCOPE_EXIT { va_end(ap); }; + SCOPE_EXIT { + va_end(ap); + }; return stringVAppendf(output, format, ap); } @@ -248,7 +252,9 @@ std::string& stringVAppendf( void stringPrintf(std::string* output, const char* format, ...) { va_list ap; va_start(ap, format); - SCOPE_EXIT { va_end(ap); }; + SCOPE_EXIT { + va_end(ap); + }; return stringVPrintf(output, format, ap); } diff --git a/folly/Subprocess.cpp b/folly/Subprocess.cpp index 6e2793bb213..bcc6ed14ad2 100644 --- a/folly/Subprocess.cpp +++ b/folly/Subprocess.cpp @@ -153,8 +153,7 @@ SubprocessSpawnError::SubprocessSpawnError( namespace { // Copy pointers to the given strings in a format suitable for posix_spawn -std::unique_ptr cloneStrings( - const std::vector& s) { +std::unique_ptr cloneStrings(const std::vector& s) { std::unique_ptr d(new const char*[s.size() + 1]); for (size_t i = 0; i < s.size(); i++) { d[i] = s[i].c_str(); diff --git a/folly/Synchronized.h b/folly/Synchronized.h index 338c048b60e..5bb2587beb5 100644 --- a/folly/Synchronized.h +++ b/folly/Synchronized.h @@ -1738,8 +1738,9 @@ void swap(Synchronized& lhs, Synchronized& rhs) { namespace detail { struct [[deprecated( - "use explicit lock(), wlock(), or rlock() instead")]] SYNCHRONIZED_macro_is_deprecated{}; -} + "use explicit lock(), wlock(), or rlock() instead")]] SYNCHRONIZED_macro_is_deprecated { +}; +} // namespace detail /** * NOTE: This API is deprecated. Use lock(), wlock(), rlock() or the withLock diff --git a/folly/Utility.h b/folly/Utility.h index 6ac6f235397..745a708e089 100644 --- a/folly/Utility.h +++ b/folly/Utility.h @@ -58,7 +58,7 @@ template T* decay_1_(T*); template -auto decay_0_(int) -> decltype(detail::decay_1_(FOLLY_DECLVAL(T &&))); +auto decay_0_(int) -> decltype(detail::decay_1_(FOLLY_DECLVAL(T&&))); template auto decay_0_(short) -> void; @@ -277,8 +277,8 @@ struct inheritable_contain_ { : v(static_cast(a)...) {} FOLLY_ERASE operator T&() & noexcept { return v; } FOLLY_ERASE operator T&&() && noexcept { return static_cast(v); } - FOLLY_ERASE operator T const &() const& noexcept { return v; } - FOLLY_ERASE operator T const &&() const&& noexcept { + FOLLY_ERASE operator T const&() const& noexcept { return v; } + FOLLY_ERASE operator T const&&() const&& noexcept { return static_cast(v); } }; diff --git a/folly/concurrency/ThreadCachedSynchronized.h b/folly/concurrency/ThreadCachedSynchronized.h index b0090fba332..15a6e486bc0 100644 --- a/folly/concurrency/ThreadCachedSynchronized.h +++ b/folly/concurrency/ThreadCachedSynchronized.h @@ -96,8 +96,8 @@ class thread_cached_synchronized { using tlp_cache_state = ThreadLocalPtr; template - static constexpr bool nx = noexcept(truth_state{ - std::in_place, FOLLY_DECLVAL(A)...}); + static constexpr bool nx = + noexcept(truth_state{std::in_place, FOLLY_DECLVAL(A)...}); template using if_ = std::enable_if_t; diff --git a/folly/concurrency/test/ConcurrentHashMapBench.cpp b/folly/concurrency/test/ConcurrentHashMapBench.cpp index 28406f355ad..25e37cf585f 100644 --- a/folly/concurrency/test/ConcurrentHashMapBench.cpp +++ b/folly/concurrency/test/ConcurrentHashMapBench.cpp @@ -214,8 +214,7 @@ void benches() { << std::endl; for (int nthr : {1, 10}) { std::cout << "========================= " << std::setw(2) << nthr - << " threads" - << " =========================" << std::endl; + << " threads" << " =========================" << std::endl; bench_ctor_dtor(nthr, 0, "CHM ctor/dtor -- empty "); bench_ctor_dtor(nthr, 1, "CHM ctor/dtor -- 1 item "); dottedLine(); diff --git a/folly/container/Access.h b/folly/container/Access.h index 91ca8a3802b..8b221fd55f7 100644 --- a/folly/container/Access.h +++ b/folly/container/Access.h @@ -64,8 +64,8 @@ inline constexpr empty_fn empty{}; // mimic: std::data, C++17 struct data_fn { template - FOLLY_ERASE constexpr auto operator()(C& c) const noexcept(noexcept(c.data())) - -> decltype(c.data()) { + FOLLY_ERASE constexpr auto operator()(C& c) const + noexcept(noexcept(c.data())) -> decltype(c.data()) { return c.data(); } template diff --git a/folly/container/F14Map.h b/folly/container/F14Map.h index bbef7615f7e..2eb42111bea 100644 --- a/folly/container/F14Map.h +++ b/folly/container/F14Map.h @@ -1190,12 +1190,13 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14ValueMap(InputIt, InputIt, std::size_t, Alloc) -> F14ValueMap< - iterator_key_type_t, - iterator_mapped_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14ValueMap(InputIt, InputIt, std::size_t, Alloc) + -> F14ValueMap< + iterator_key_type_t, + iterator_mapped_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -1204,12 +1205,13 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14ValueMap(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14ValueMap< - iterator_key_type_t, - iterator_mapped_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14ValueMap(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14ValueMap< + iterator_key_type_t, + iterator_mapped_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, @@ -1338,12 +1340,13 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14NodeMap(InputIt, InputIt, std::size_t, Alloc) -> F14NodeMap< - iterator_key_type_t, - iterator_mapped_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14NodeMap(InputIt, InputIt, std::size_t, Alloc) + -> F14NodeMap< + iterator_key_type_t, + iterator_mapped_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -1352,12 +1355,13 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14NodeMap(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14NodeMap< - iterator_key_type_t, - iterator_mapped_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14NodeMap(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14NodeMap< + iterator_key_type_t, + iterator_mapped_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, @@ -1745,12 +1749,13 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14VectorMap(InputIt, InputIt, std::size_t, Alloc) -> F14VectorMap< - iterator_key_type_t, - iterator_mapped_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14VectorMap(InputIt, InputIt, std::size_t, Alloc) + -> F14VectorMap< + iterator_key_type_t, + iterator_mapped_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -1759,12 +1764,13 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14VectorMap(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14VectorMap< - iterator_key_type_t, - iterator_mapped_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14VectorMap(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14VectorMap< + iterator_key_type_t, + iterator_mapped_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, @@ -1880,12 +1886,13 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14FastMap(InputIt, InputIt, std::size_t, Alloc) -> F14FastMap< - iterator_key_type_t, - iterator_mapped_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14FastMap(InputIt, InputIt, std::size_t, Alloc) + -> F14FastMap< + iterator_key_type_t, + iterator_mapped_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -1894,12 +1901,13 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14FastMap(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14FastMap< - iterator_key_type_t, - iterator_mapped_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14FastMap(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14FastMap< + iterator_key_type_t, + iterator_mapped_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, diff --git a/folly/container/F14Set.h b/folly/container/F14Set.h index 7f8c158b0c0..9d1fa2f1c00 100644 --- a/folly/container/F14Set.h +++ b/folly/container/F14Set.h @@ -879,11 +879,12 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14ValueSet(InputIt, InputIt, std::size_t, Alloc) -> F14ValueSet< - iterator_value_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14ValueSet(InputIt, InputIt, std::size_t, Alloc) + -> F14ValueSet< + iterator_value_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -892,11 +893,12 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14ValueSet(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14ValueSet< - iterator_value_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14ValueSet(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14ValueSet< + iterator_value_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, @@ -917,11 +919,12 @@ template < typename Key, typename Alloc, typename = detail::RequireAllocator> -F14ValueSet(std::initializer_list, std::size_t, Alloc) -> F14ValueSet< - Key, - f14::DefaultHasher, - f14::DefaultKeyEqual, - Alloc>; +F14ValueSet(std::initializer_list, std::size_t, Alloc) + -> F14ValueSet< + Key, + f14::DefaultHasher, + f14::DefaultKeyEqual, + Alloc>; template < typename Key, @@ -995,11 +998,12 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14NodeSet(InputIt, InputIt, std::size_t, Alloc) -> F14NodeSet< - iterator_value_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14NodeSet(InputIt, InputIt, std::size_t, Alloc) + -> F14NodeSet< + iterator_value_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -1008,11 +1012,12 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14NodeSet(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14NodeSet< - iterator_value_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14NodeSet(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14NodeSet< + iterator_value_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, @@ -1033,11 +1038,12 @@ template < typename Key, typename Alloc, typename = detail::RequireAllocator> -F14NodeSet(std::initializer_list, std::size_t, Alloc) -> F14NodeSet< - Key, - f14::DefaultHasher, - f14::DefaultKeyEqual, - Alloc>; +F14NodeSet(std::initializer_list, std::size_t, Alloc) + -> F14NodeSet< + Key, + f14::DefaultHasher, + f14::DefaultKeyEqual, + Alloc>; template < typename Key, @@ -1311,11 +1317,12 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14VectorSet(InputIt, InputIt, std::size_t, Alloc) -> F14VectorSet< - iterator_value_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14VectorSet(InputIt, InputIt, std::size_t, Alloc) + -> F14VectorSet< + iterator_value_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -1324,11 +1331,12 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14VectorSet(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14VectorSet< - iterator_value_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14VectorSet(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14VectorSet< + iterator_value_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, @@ -1349,11 +1357,12 @@ template < typename Key, typename Alloc, typename = detail::RequireAllocator> -F14VectorSet(std::initializer_list, std::size_t, Alloc) -> F14VectorSet< - Key, - f14::DefaultHasher, - f14::DefaultKeyEqual, - Alloc>; +F14VectorSet(std::initializer_list, std::size_t, Alloc) + -> F14VectorSet< + Key, + f14::DefaultHasher, + f14::DefaultKeyEqual, + Alloc>; template < typename Key, @@ -1413,11 +1422,12 @@ template < typename Alloc, typename = detail::RequireInputIterator, typename = detail::RequireAllocator> -F14FastSet(InputIt, InputIt, std::size_t, Alloc) -> F14FastSet< - iterator_value_type_t, - f14::DefaultHasher>, - f14::DefaultKeyEqual>, - Alloc>; +F14FastSet(InputIt, InputIt, std::size_t, Alloc) + -> F14FastSet< + iterator_value_type_t, + f14::DefaultHasher>, + f14::DefaultKeyEqual>, + Alloc>; template < typename InputIt, @@ -1426,11 +1436,12 @@ template < typename = detail::RequireInputIterator, typename = detail::RequireNotAllocator, typename = detail::RequireAllocator> -F14FastSet(InputIt, InputIt, std::size_t, Hasher, Alloc) -> F14FastSet< - iterator_value_type_t, - Hasher, - f14::DefaultKeyEqual>, - Alloc>; +F14FastSet(InputIt, InputIt, std::size_t, Hasher, Alloc) + -> F14FastSet< + iterator_value_type_t, + Hasher, + f14::DefaultKeyEqual>, + Alloc>; template < typename Key, @@ -1451,11 +1462,12 @@ template < typename Key, typename Alloc, typename = detail::RequireAllocator> -F14FastSet(std::initializer_list, std::size_t, Alloc) -> F14FastSet< - Key, - f14::DefaultHasher, - f14::DefaultKeyEqual, - Alloc>; +F14FastSet(std::initializer_list, std::size_t, Alloc) + -> F14FastSet< + Key, + f14::DefaultHasher, + f14::DefaultKeyEqual, + Alloc>; template < typename Key, diff --git a/folly/container/detail/F14Table.h b/folly/container/detail/F14Table.h index c6941c51817..5c6ec888355 100644 --- a/folly/container/detail/F14Table.h +++ b/folly/container/detail/F14Table.h @@ -1264,9 +1264,9 @@ class F14Table : public Policy { } F14Table(F14Table&& rhs) noexcept( - std::is_nothrow_move_constructible::value&& - std::is_nothrow_move_constructible::value&& - std::is_nothrow_move_constructible::value) + std::is_nothrow_move_constructible::value && + std::is_nothrow_move_constructible::value && + std::is_nothrow_move_constructible::value) : Policy{std::move(rhs)} { swapContents(rhs); } @@ -1296,8 +1296,8 @@ class F14Table : public Policy { } F14Table& operator=(F14Table&& rhs) noexcept( - std::is_nothrow_move_assignable::value&& - std::is_nothrow_move_assignable::value && + std::is_nothrow_move_assignable::value && + std::is_nothrow_move_assignable::value && (kAllocIsAlwaysEqual || (AllocTraits::propagate_on_container_move_assignment::value && std::is_nothrow_move_assignable::value))) { diff --git a/folly/container/heap_vector_types.h b/folly/container/heap_vector_types.h index f9118e14353..7c3c622077b 100644 --- a/folly/container/heap_vector_types.h +++ b/folly/container/heap_vector_types.h @@ -1268,8 +1268,8 @@ class heap_vector_container : growth_policy_wrapper { } void swap(heap_vector_container& o) noexcept( - std::is_nothrow_swappable::value&& noexcept( - std::declval().swap(std::declval()))) { + std::is_nothrow_swappable::value && + noexcept(std::declval().swap(std::declval()))) { using std::swap; // Allow ADL for swap(); fall back to std::swap(). Compare& a = m_; Compare& b = o.m_; @@ -1318,22 +1318,22 @@ class heap_vector_container : growth_policy_wrapper { explicit EBO(const value_compare& c, const Allocator& alloc) noexcept( std::is_nothrow_default_constructible::value) : value_compare(c), cont_(alloc) {} - EBO(const EBO& other, const Allocator& alloc) - noexcept(std::is_nothrow_constructible< - Container, - const Container&, - const Allocator&>::value) + EBO(const EBO& other, const Allocator& alloc) noexcept( + std::is_nothrow_constructible< + Container, + const Container&, + const Allocator&>::value) : value_compare(static_cast(other)), cont_(other.cont_, alloc) {} - EBO(EBO&& other, const Allocator& alloc) - noexcept(std::is_nothrow_constructible< - Container, - Container&&, - const Allocator&>::value) + EBO(EBO&& other, const Allocator& alloc) noexcept( + std::is_nothrow_constructible< + Container, + Container&&, + const Allocator&>::value) : value_compare(static_cast(other)), cont_(std::move(other.cont_), alloc) {} - EBO(const Compare& c, Container&& cont) - noexcept(std::is_nothrow_move_constructible::value) + EBO(const Compare& c, Container&& cont) noexcept( + std::is_nothrow_move_constructible::value) : value_compare(c), cont_(std::move(cont)) {} Container cont_; } m_; diff --git a/folly/container/tape.h b/folly/container/tape.h index ceca087d05a..7e8fb45dafc 100644 --- a/folly/container/tape.h +++ b/folly/container/tape.h @@ -231,9 +231,10 @@ class tape { } template - auto push_back(R&& r) -> std::enable_if_t< - range_of_scalars && - !std::is_convertible_v> // handle \0 separately + auto push_back(R&& r) + -> std::enable_if_t< + range_of_scalars && + !std::is_convertible_v> // handle \0 separately { push_back(std::begin(r), std::end(r)); } @@ -264,9 +265,10 @@ class tape { } template - auto push_back_unsafe(R&& r) -> std::enable_if_t< - range_of_scalars && - !std::is_convertible_v> // handle \0 separately + auto push_back_unsafe(R&& r) + -> std::enable_if_t< + range_of_scalars && + !std::is_convertible_v> // handle \0 separately { push_back_unsafe(std::begin(r), std::end(r)); } @@ -292,9 +294,10 @@ class tape { -> std::enable_if_t, iterator>; template - auto insert(const_iterator pos, R&& r) -> std::enable_if_t< - range_of_scalars && !std::is_convertible_v, - iterator> { + auto insert(const_iterator pos, R&& r) + -> std::enable_if_t< + range_of_scalars && !std::is_convertible_v, + iterator> { return insert(pos, std::begin(r), std::end(r)); } diff --git a/folly/container/test/F14MapTest.cpp b/folly/container/test/F14MapTest.cpp index 9204e4054ae..d15aa6d2b54 100644 --- a/folly/container/test/F14MapTest.cpp +++ b/folly/container/test/F14MapTest.cpp @@ -1390,9 +1390,8 @@ TEST(F14VectorMap, destructuringErase) { resetTracking(); m.erase(p1.first); - LOG(INFO) << "erase -> " - << "key_type ops " << Tracked<0>::counts() << ", mapped_type ops " - << Tracked<1>::counts(); + LOG(INFO) << "erase -> " << "key_type ops " << Tracked<0>::counts() + << ", mapped_type ops " << Tracked<1>::counts(); // deleting p1 will cause p2 to be moved to the front of the values array EXPECT_EQ( Tracked<0>::counts().dist(Counts{0, 1, 0, 0}) + diff --git a/folly/container/test/F14SetTest.cpp b/folly/container/test/F14SetTest.cpp index aa3cc800640..004e28bd926 100644 --- a/folly/container/test/F14SetTest.cpp +++ b/folly/container/test/F14SetTest.cpp @@ -1538,9 +1538,8 @@ void runRandomInsertOrderTest(F&& func) { TEST(F14Set, randomInsertOrder) { runRandomInsertOrderTest>([](char x) { return x; }); runRandomInsertOrderTest>([](char x) { return x; }); - runRandomInsertOrderTest>([](char x) { - return std::string{std::size_t{1}, x}; - }); + runRandomInsertOrderTest>( + [](char x) { return std::string{std::size_t{1}, x}; }); } template