react-native-windows 0.81.34 → 0.81.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Directory.Build.props +1 -16
- package/Folly/ThreadNameStub.cpp +4 -6
- package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +27 -4
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +8 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +7 -3
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -7
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +0 -3
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/React.Cpp.props +3 -3
- package/ReactCommon/ReactCommon.vcxproj +0 -10
- package/ReactCommon/packages.lock.win32.json +0 -10
- package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +4 -37
- package/Shared/Shared.vcxitems +2 -0
- package/{Folly → external}/.clang-format +0 -1
- package/external/External.vcxitems +10 -0
- package/external/fast-float/.syncignore +11 -0
- package/external/fast-float/LICENSE-APACHE +190 -0
- package/external/fast-float/LICENSE-BOOST +23 -0
- package/external/fast-float/LICENSE-MIT +27 -0
- package/external/fast-float/cgmanifest.json +15 -0
- package/external/fast-float/fast-float.vcxitems +14 -0
- package/external/fast-float/include/fast_float/ascii_number.h +588 -0
- package/external/fast-float/include/fast_float/bigint.h +638 -0
- package/external/fast-float/include/fast_float/constexpr_feature_detect.h +46 -0
- package/external/fast-float/include/fast_float/decimal_to_binary.h +212 -0
- package/external/fast-float/include/fast_float/digit_comparison.h +457 -0
- package/external/fast-float/include/fast_float/fast_float.h +59 -0
- package/external/fast-float/include/fast_float/fast_table.h +708 -0
- package/external/fast-float/include/fast_float/float_common.h +1240 -0
- package/external/fast-float/include/fast_float/parse_number.h +399 -0
- package/external/fast-float/sync-config.json +8 -0
- package/external/fmt/.syncignore +12 -0
- package/external/fmt/CONTRIBUTING.md +20 -0
- package/external/fmt/LICENSE +27 -0
- package/{fmt → external/fmt}/cgmanifest.json +1 -1
- package/external/fmt/fmt.vcxitems +28 -0
- package/external/fmt/include/fmt/args.h +228 -0
- package/{fmt/TEMP_UntilFmtUpdate/core.h → external/fmt/include/fmt/base.h} +1188 -1036
- package/external/fmt/include/fmt/chrono.h +2432 -0
- package/external/fmt/include/fmt/color.h +612 -0
- package/external/fmt/include/fmt/compile.h +529 -0
- package/external/fmt/include/fmt/core.h +5 -0
- package/external/fmt/include/fmt/format-inl.h +1928 -0
- package/external/fmt/include/fmt/format.h +4427 -0
- package/external/fmt/include/fmt/os.h +439 -0
- package/external/fmt/include/fmt/ostream.h +211 -0
- package/external/fmt/include/fmt/printf.h +656 -0
- package/external/fmt/include/fmt/ranges.h +882 -0
- package/external/fmt/include/fmt/std.h +699 -0
- package/external/fmt/include/fmt/xchar.h +322 -0
- package/external/fmt/src/fmt.cc +135 -0
- package/external/fmt/src/format.cc +43 -0
- package/external/fmt/src/os.cc +403 -0
- package/external/fmt/sync-config.json +8 -0
- package/external/folly/.syncignore +61 -0
- package/external/folly/LICENSE +200 -0
- package/{fmt → external/folly/folly}/.clang-format +0 -1
- package/external/folly/folly/AtomicHashArray-inl.h +546 -0
- package/external/folly/folly/AtomicHashArray.h +431 -0
- package/external/folly/folly/AtomicHashMap-inl.h +653 -0
- package/external/folly/folly/AtomicHashMap.h +484 -0
- package/external/folly/folly/AtomicIntrusiveLinkedList.h +206 -0
- package/external/folly/folly/AtomicLinkedList.h +110 -0
- package/external/folly/folly/AtomicUnorderedMap.h +522 -0
- package/external/folly/folly/BUCK +1631 -0
- package/external/folly/folly/BUILD_MODE.bzl +72 -0
- package/external/folly/folly/Benchmark.cpp +986 -0
- package/external/folly/folly/Benchmark.h +680 -0
- package/external/folly/folly/BenchmarkUtil.h +47 -0
- package/external/folly/folly/Bits.h +17 -0
- package/external/folly/folly/CMakeLists.txt +110 -0
- package/external/folly/folly/CPortability.h +338 -0
- package/external/folly/folly/CancellationToken-inl.h +449 -0
- package/external/folly/folly/CancellationToken.cpp +250 -0
- package/external/folly/folly/CancellationToken.h +365 -0
- package/external/folly/folly/Chrono.h +132 -0
- package/external/folly/folly/ClockGettimeWrappers.cpp +93 -0
- package/external/folly/folly/ClockGettimeWrappers.h +29 -0
- package/external/folly/folly/ConcurrentBitSet.h +157 -0
- package/external/folly/folly/ConcurrentLazy.h +74 -0
- package/external/folly/folly/ConcurrentSkipList-inl.h +341 -0
- package/external/folly/folly/ConcurrentSkipList.h +824 -0
- package/external/folly/folly/ConstructorCallbackList.h +158 -0
- package/external/folly/folly/Conv.h +2026 -0
- package/external/folly/folly/CppAttributes.h +170 -0
- package/external/folly/folly/CpuId.h +297 -0
- package/external/folly/folly/DefaultKeepAliveExecutor.h +172 -0
- package/external/folly/folly/Demangle.cpp +255 -0
- package/external/folly/folly/Demangle.h +73 -0
- package/external/folly/folly/DiscriminatedPtr.h +236 -0
- package/external/folly/folly/DynamicConverter.h +17 -0
- package/external/folly/folly/Exception.h +150 -0
- package/external/folly/folly/ExceptionString.cpp +51 -0
- package/external/folly/folly/ExceptionString.h +33 -0
- package/external/folly/folly/ExceptionWrapper-inl.h +264 -0
- package/external/folly/folly/ExceptionWrapper.cpp +37 -0
- package/external/folly/folly/ExceptionWrapper.h +377 -0
- package/external/folly/folly/Executor.cpp +111 -0
- package/external/folly/folly/Executor.h +351 -0
- package/external/folly/folly/Expected.h +1725 -0
- package/external/folly/folly/FBString.h +2888 -0
- package/external/folly/folly/FBVector.h +17 -0
- package/external/folly/folly/File.cpp +180 -0
- package/external/folly/folly/File.h +177 -0
- package/external/folly/folly/FileUtil.cpp +378 -0
- package/external/folly/folly/FileUtil.h +332 -0
- package/external/folly/folly/Fingerprint.cpp +135 -0
- package/external/folly/folly/Fingerprint.h +289 -0
- package/external/folly/folly/FixedString.h +2965 -0
- package/external/folly/folly/FollyMemcpy.cpp +30 -0
- package/external/folly/folly/FollyMemcpy.h +23 -0
- package/external/folly/folly/FollyMemset.cpp +29 -0
- package/external/folly/folly/FollyMemset.h +25 -0
- package/external/folly/folly/Format-inl.h +1152 -0
- package/external/folly/folly/Format.cpp +429 -0
- package/external/folly/folly/Format.h +463 -0
- package/external/folly/folly/FormatArg.h +285 -0
- package/external/folly/folly/FormatTraits.h +65 -0
- package/external/folly/folly/Function.h +1159 -0
- package/external/folly/folly/GLog.h +85 -0
- package/external/folly/folly/GroupVarint.cpp +153 -0
- package/external/folly/folly/GroupVarint.h +630 -0
- package/external/folly/folly/Hash.h +20 -0
- package/external/folly/folly/IPAddress.cpp +490 -0
- package/external/folly/folly/IPAddress.h +667 -0
- package/external/folly/folly/IPAddressException.h +82 -0
- package/external/folly/folly/IPAddressV4.cpp +305 -0
- package/external/folly/folly/IPAddressV4.h +495 -0
- package/external/folly/folly/IPAddressV6.cpp +541 -0
- package/external/folly/folly/IPAddressV6.h +627 -0
- package/external/folly/folly/Indestructible.h +164 -0
- package/external/folly/folly/IndexedMemPool.h +550 -0
- package/external/folly/folly/IntrusiveList.h +17 -0
- package/external/folly/folly/Lazy.h +142 -0
- package/external/folly/folly/Likely.h +76 -0
- package/external/folly/folly/MPMCPipeline.h +280 -0
- package/external/folly/folly/MPMCQueue.h +1556 -0
- package/external/folly/folly/MacAddress.cpp +188 -0
- package/external/folly/folly/MacAddress.h +260 -0
- package/external/folly/folly/MapUtil.h +17 -0
- package/external/folly/folly/Math.h +258 -0
- package/external/folly/folly/MaybeManagedPtr.h +120 -0
- package/external/folly/folly/Memory.h +900 -0
- package/external/folly/folly/MicroLock.cpp +76 -0
- package/external/folly/folly/MicroLock.h +354 -0
- package/external/folly/folly/MicroSpinLock.h +17 -0
- package/external/folly/folly/MoveWrapper.h +76 -0
- package/external/folly/folly/ObserverContainer.h +1026 -0
- package/external/folly/folly/Optional.h +743 -0
- package/external/folly/folly/Overload.h +325 -0
- package/external/folly/folly/PackedSyncPtr.h +147 -0
- package/external/folly/folly/Padded.h +464 -0
- package/external/folly/folly/Poly-inl.h +230 -0
- package/external/folly/folly/Poly.h +1095 -0
- package/external/folly/folly/PolyException.h +43 -0
- package/external/folly/folly/Portability.h +644 -0
- package/external/folly/folly/Preprocessor.h +236 -0
- package/external/folly/folly/ProducerConsumerQueue.h +182 -0
- package/external/folly/folly/RWSpinLock.h +17 -0
- package/external/folly/folly/Random-inl.h +86 -0
- package/external/folly/folly/Random.cpp +184 -0
- package/external/folly/folly/Random.h +434 -0
- package/external/folly/folly/Range.h +1772 -0
- package/external/folly/folly/Replaceable.h +636 -0
- package/external/folly/folly/ScopeGuard.cpp +29 -0
- package/external/folly/folly/ScopeGuard.h +420 -0
- package/external/folly/folly/SharedMutex.cpp +81 -0
- package/external/folly/folly/SharedMutex.h +1751 -0
- package/external/folly/folly/Singleton-inl.h +332 -0
- package/external/folly/folly/Singleton.cpp +512 -0
- package/external/folly/folly/Singleton.h +891 -0
- package/external/folly/folly/SingletonThreadLocal.cpp +53 -0
- package/external/folly/folly/SingletonThreadLocal.h +263 -0
- package/external/folly/folly/SocketAddress.cpp +786 -0
- package/external/folly/folly/SocketAddress.h +768 -0
- package/external/folly/folly/SpinLock.h +55 -0
- package/external/folly/folly/String-inl.h +668 -0
- package/external/folly/folly/String.cpp +777 -0
- package/external/folly/folly/String.h +767 -0
- package/external/folly/folly/Subprocess.cpp +1142 -0
- package/external/folly/folly/Subprocess.h +1055 -0
- package/external/folly/folly/Synchronized.h +1833 -0
- package/external/folly/folly/SynchronizedPtr.h +106 -0
- package/external/folly/folly/ThreadCachedInt.h +175 -0
- package/external/folly/folly/ThreadLocal.h +478 -0
- package/external/folly/folly/TimeoutQueue.cpp +78 -0
- package/external/folly/folly/TimeoutQueue.h +123 -0
- package/external/folly/folly/TokenBucket.h +673 -0
- package/external/folly/folly/Traits.h +1442 -0
- package/external/folly/folly/Try-inl.h +372 -0
- package/external/folly/folly/Try.cpp +23 -0
- package/external/folly/folly/Try.h +728 -0
- package/external/folly/folly/UTF8String.h +56 -0
- package/external/folly/folly/Unicode.cpp +201 -0
- package/external/folly/folly/Unicode.h +94 -0
- package/external/folly/folly/Unit.h +65 -0
- package/external/folly/folly/Uri-inl.h +101 -0
- package/external/folly/folly/Uri.cpp +190 -0
- package/external/folly/folly/Uri.h +142 -0
- package/external/folly/folly/Utility.h +932 -0
- package/external/folly/folly/VERSION +1 -0
- package/external/folly/folly/Varint.h +230 -0
- package/external/folly/folly/VirtualExecutor.h +17 -0
- package/external/folly/folly/algorithm/simd/BUCK +47 -0
- package/external/folly/folly/algorithm/simd/Contains.cpp +42 -0
- package/external/folly/folly/algorithm/simd/Contains.h +116 -0
- package/external/folly/folly/algorithm/simd/FindFixed.h +301 -0
- package/external/folly/folly/algorithm/simd/Ignore.h +52 -0
- package/external/folly/folly/algorithm/simd/Movemask.h +207 -0
- package/external/folly/folly/algorithm/simd/detail/BUCK +70 -0
- package/external/folly/folly/algorithm/simd/detail/ContainsImpl.h +91 -0
- package/external/folly/folly/algorithm/simd/detail/SimdAnyOf.h +83 -0
- package/external/folly/folly/algorithm/simd/detail/SimdForEach.h +209 -0
- package/external/folly/folly/algorithm/simd/detail/SimdPlatform.h +445 -0
- package/external/folly/folly/algorithm/simd/detail/Traits.h +125 -0
- package/external/folly/folly/algorithm/simd/detail/UnrollUtils.h +126 -0
- package/external/folly/folly/base64.h +264 -0
- package/external/folly/folly/chrono/BUCK +29 -0
- package/external/folly/folly/chrono/Clock.h +65 -0
- package/external/folly/folly/chrono/Conv.h +712 -0
- package/external/folly/folly/chrono/test/BUCK +26 -0
- package/external/folly/folly/chrono/test/ClockTest.cpp +68 -0
- package/external/folly/folly/chrono/test/ConvTest.cpp +652 -0
- package/external/folly/folly/concurrency/AtomicSharedPtr.h +387 -0
- package/external/folly/folly/concurrency/BUCK +170 -0
- package/external/folly/folly/concurrency/CacheLocality.h +460 -0
- package/external/folly/folly/concurrency/ConcurrentHashMap.h +822 -0
- package/external/folly/folly/concurrency/CoreCachedSharedPtr.h +232 -0
- package/external/folly/folly/concurrency/DeadlockDetector.cpp +27 -0
- package/external/folly/folly/concurrency/DeadlockDetector.h +44 -0
- package/external/folly/folly/concurrency/DynamicBoundedQueue.h +751 -0
- package/external/folly/folly/concurrency/PriorityUnboundedQueueSet.h +207 -0
- package/external/folly/folly/concurrency/ProcessLocalUniqueId.cpp +46 -0
- package/external/folly/folly/concurrency/ProcessLocalUniqueId.h +38 -0
- package/external/folly/folly/concurrency/SingletonRelaxedCounter.h +325 -0
- package/external/folly/folly/concurrency/ThreadCachedSynchronized.h +227 -0
- package/external/folly/folly/concurrency/UnboundedQueue.h +891 -0
- package/external/folly/folly/concurrency/container/BUCK +77 -0
- package/external/folly/folly/concurrency/container/FlatCombiningPriorityQueue.h +426 -0
- package/external/folly/folly/concurrency/container/LockFreeRingBuffer.h +306 -0
- package/external/folly/folly/concurrency/container/RelaxedConcurrentPriorityQueue.h +1212 -0
- package/external/folly/folly/concurrency/container/SingleWriterFixedHashMap.h +322 -0
- package/external/folly/folly/concurrency/container/atomic_grow_array.h +564 -0
- package/external/folly/folly/concurrency/container/test/BUCK +75 -0
- package/external/folly/folly/concurrency/container/test/FlatCombiningPriorityQueueTest.cpp +570 -0
- package/external/folly/folly/concurrency/container/test/LockFreeRingBufferTest.cpp +276 -0
- package/external/folly/folly/concurrency/container/test/RelaxedConcurrentPriorityQueueTest.cpp +1570 -0
- package/external/folly/folly/concurrency/container/test/SingleWriterFixedHashMapTest.cpp +401 -0
- package/external/folly/folly/concurrency/container/test/atomic_grow_array_test.cpp +187 -0
- package/external/folly/folly/concurrency/detail/AtomicSharedPtr-detail.h +212 -0
- package/external/folly/folly/concurrency/detail/ConcurrentHashMap-detail.h +1911 -0
- package/external/folly/folly/concurrency/memory/AtomicReadMostlyMainPtr.cpp +43 -0
- package/external/folly/folly/concurrency/memory/AtomicReadMostlyMainPtr.h +190 -0
- package/external/folly/folly/concurrency/memory/BUCK +53 -0
- package/external/folly/folly/concurrency/memory/PrimaryPtr.h +338 -0
- package/external/folly/folly/concurrency/memory/ReadMostlySharedPtr.h +511 -0
- package/external/folly/folly/concurrency/memory/TLRefCount.h +228 -0
- package/external/folly/folly/concurrency/memory/test/AtomicReadMostlyMainPtrBenchmark.cpp +56 -0
- package/external/folly/folly/concurrency/memory/test/AtomicReadMostlyMainPtrTest.cpp +454 -0
- package/external/folly/folly/concurrency/memory/test/BUCK +95 -0
- package/external/folly/folly/concurrency/memory/test/PrimaryPtrTest.cpp +303 -0
- package/external/folly/folly/concurrency/memory/test/ReadMostlySharedPtrBenchmark.cpp +138 -0
- package/external/folly/folly/concurrency/memory/test/ReadMostlySharedPtrStressTest.cpp +75 -0
- package/external/folly/folly/concurrency/memory/test/ReadMostlySharedPtrTest.cpp +378 -0
- package/external/folly/folly/concurrency/memory/test/RefCountBenchmark.cpp +90 -0
- package/external/folly/folly/concurrency/memory/test/RefCountTest.cpp +168 -0
- package/external/folly/folly/concurrency/test/AtomicSharedPtrCounted.h +156 -0
- package/external/folly/folly/concurrency/test/AtomicSharedPtrPerformance.cpp +255 -0
- package/external/folly/folly/concurrency/test/AtomicSharedPtrTest.cpp +257 -0
- package/external/folly/folly/concurrency/test/BUCK +229 -0
- package/external/folly/folly/concurrency/test/CacheLocalityBenchmark.cpp +392 -0
- package/external/folly/folly/concurrency/test/CacheLocalityTest.cpp +1229 -0
- package/external/folly/folly/concurrency/test/ConcurrentHashMapBench.cpp +260 -0
- package/external/folly/folly/concurrency/test/ConcurrentHashMapTest.cpp +1242 -0
- package/external/folly/folly/concurrency/test/CoreCachedSharedPtrTest.cpp +408 -0
- package/external/folly/folly/concurrency/test/DynamicBoundedQueueTest.cpp +984 -0
- package/external/folly/folly/concurrency/test/PriorityUnboundedQueueSetTest.cpp +73 -0
- package/external/folly/folly/concurrency/test/ProcessLocalUniqueIdTest.cpp +66 -0
- package/external/folly/folly/concurrency/test/SingletonRelaxedCounterBench.cpp +101 -0
- package/external/folly/folly/concurrency/test/SingletonRelaxedCounterTest.cpp +185 -0
- package/external/folly/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp +76 -0
- package/external/folly/folly/concurrency/test/ThreadCachedSynchronizedTest.cpp +93 -0
- package/external/folly/folly/concurrency/test/UnboundedQueueTest.cpp +1302 -0
- package/external/folly/folly/container/Access.h +57 -0
- package/external/folly/folly/container/Array.h +87 -0
- package/external/folly/folly/container/BUCK +353 -0
- package/external/folly/folly/container/BitIterator.h +203 -0
- package/external/folly/folly/container/Enumerate.h +162 -0
- package/external/folly/folly/container/EvictingCacheMap.h +730 -0
- package/external/folly/folly/container/F14.md +300 -0
- package/external/folly/folly/container/F14Map-fwd.h +113 -0
- package/external/folly/folly/container/F14Map.h +2108 -0
- package/external/folly/folly/container/F14Set-fwd.h +95 -0
- package/external/folly/folly/container/F14Set.h +1603 -0
- package/external/folly/folly/container/FBVector.h +1711 -0
- package/external/folly/folly/container/Foreach-inl.h +316 -0
- package/external/folly/folly/container/Foreach.h +209 -0
- package/external/folly/folly/container/HeterogeneousAccess-fwd.h +33 -0
- package/external/folly/folly/container/HeterogeneousAccess.h +171 -0
- package/external/folly/folly/container/IntrusiveHeap.h +268 -0
- package/external/folly/folly/container/IntrusiveList.h +131 -0
- package/external/folly/folly/container/Iterator.h +843 -0
- package/external/folly/folly/container/MapUtil.h +376 -0
- package/external/folly/folly/container/Merge.h +90 -0
- package/external/folly/folly/container/RegexMatchCache.cpp +521 -0
- package/external/folly/folly/container/RegexMatchCache.h +699 -0
- package/external/folly/folly/container/Reserve.h +109 -0
- package/external/folly/folly/container/SparseByteSet.h +123 -0
- package/external/folly/folly/container/View.h +81 -0
- package/external/folly/folly/container/WeightedEvictingCacheMap.h +651 -0
- package/external/folly/folly/container/detail/BUCK +115 -0
- package/external/folly/folly/container/detail/BitIteratorDetail.h +87 -0
- package/external/folly/folly/container/detail/F14Defaults.h +34 -0
- package/external/folly/folly/container/detail/F14IntrinsicsAvailability.h +67 -0
- package/external/folly/folly/container/detail/F14MapFallback.h +717 -0
- package/external/folly/folly/container/detail/F14Mask.h +235 -0
- package/external/folly/folly/container/detail/F14Policy.h +1523 -0
- package/external/folly/folly/container/detail/F14SetFallback.h +528 -0
- package/external/folly/folly/container/detail/F14Table.cpp +71 -0
- package/external/folly/folly/container/detail/F14Table.h +2680 -0
- package/external/folly/folly/container/detail/Util.h +303 -0
- package/external/folly/folly/container/detail/tape_detail.h +135 -0
- package/external/folly/folly/container/detail/test/BUCK +14 -0
- package/external/folly/folly/container/detail/test/F14DetailTest.cpp +47 -0
- package/external/folly/folly/container/heap_vector_types.h +1683 -0
- package/external/folly/folly/container/range_traits.h +81 -0
- package/external/folly/folly/container/small_vector.h +1476 -0
- package/external/folly/folly/container/sorted_vector_types.h +1652 -0
- package/external/folly/folly/container/span.h +408 -0
- package/external/folly/folly/container/tape.h +608 -0
- package/external/folly/folly/container/test/.clang-tidy +12 -0
- package/external/folly/folly/container/test/AccessTest.cpp +138 -0
- package/external/folly/folly/container/test/ArrayTest.cpp +84 -0
- package/external/folly/folly/container/test/BUCK +568 -0
- package/external/folly/folly/container/test/BitIteratorBench.cpp +112 -0
- package/external/folly/folly/container/test/BitIteratorTest.cpp +109 -0
- package/external/folly/folly/container/test/EnumerateTest.cpp +294 -0
- package/external/folly/folly/container/test/EvictingCacheMapBench.cpp +80 -0
- package/external/folly/folly/container/test/EvictingCacheMapTest.cpp +842 -0
- package/external/folly/folly/container/test/F14AsanSupportTest.cpp +143 -0
- package/external/folly/folly/container/test/F14FwdTest.cpp +37 -0
- package/external/folly/folly/container/test/F14InterprocessTest.cpp +404 -0
- package/external/folly/folly/container/test/F14MapTest.cpp +2543 -0
- package/external/folly/folly/container/test/F14PolicyTest.cpp +49 -0
- package/external/folly/folly/container/test/F14SetTest.cpp +1738 -0
- package/external/folly/folly/container/test/F14SmallOverheads.cpp +215 -0
- package/external/folly/folly/container/test/F14TestUtil.h +117 -0
- package/external/folly/folly/container/test/FBVectorBenchmark.cpp +380 -0
- package/external/folly/folly/container/test/FBVectorBenchmarks.cpp.h +100 -0
- package/external/folly/folly/container/test/FBVectorTest.cpp +326 -0
- package/external/folly/folly/container/test/FBVectorTests.cpp.h +304 -0
- package/external/folly/folly/container/test/ForeachBenchmark.cpp +388 -0
- package/external/folly/folly/container/test/ForeachTest.cpp +338 -0
- package/external/folly/folly/container/test/HashMapsBench.cpp +458 -0
- package/external/folly/folly/container/test/HeterogeneousAccessTest.cpp +242 -0
- package/external/folly/folly/container/test/IntrusiveHeapTest.cpp +262 -0
- package/external/folly/folly/container/test/IteratorTest.cpp +989 -0
- package/external/folly/folly/container/test/MapUtilTest.cpp +365 -0
- package/external/folly/folly/container/test/MergeTest.cpp +66 -0
- package/external/folly/folly/container/test/RegexMatchCacheTest.cpp +634 -0
- package/external/folly/folly/container/test/ReserveTest.cpp +173 -0
- package/external/folly/folly/container/test/SparseByteSetBenchmark.cpp +153 -0
- package/external/folly/folly/container/test/SparseByteSetTest.cpp +117 -0
- package/external/folly/folly/container/test/TrackingTypes.h +584 -0
- package/external/folly/folly/container/test/UtilTest.cpp +609 -0
- package/external/folly/folly/container/test/WeightedEvictingCacheMapTest.cpp +800 -0
- package/external/folly/folly/container/test/heap_vector_types_test.cpp +1774 -0
- package/external/folly/folly/container/test/range_traits_test.cpp +59 -0
- package/external/folly/folly/container/test/small_vector_test.cpp +1571 -0
- package/external/folly/folly/container/test/sorted_vector_test.cpp +1589 -0
- package/external/folly/folly/container/test/span_test.cpp +520 -0
- package/external/folly/folly/container/test/tape_bench.cpp +200 -0
- package/external/folly/folly/container/test/tape_test.cpp +590 -0
- package/external/folly/folly/defs.bzl +238 -0
- package/external/folly/folly/detail/AsyncTrace.cpp +36 -0
- package/external/folly/folly/detail/AsyncTrace.h +44 -0
- package/external/folly/folly/detail/AtomicHashUtils.h +42 -0
- package/external/folly/folly/detail/AtomicUnorderedMapUtils.h +80 -0
- package/external/folly/folly/detail/BUCK +406 -0
- package/external/folly/folly/detail/DiscriminatedPtrDetail.h +172 -0
- package/external/folly/folly/detail/FileUtilDetail.cpp +63 -0
- package/external/folly/folly/detail/FileUtilDetail.h +85 -0
- package/external/folly/folly/detail/FileUtilVectorDetail.h +81 -0
- package/external/folly/folly/detail/FingerprintPolynomial.h +132 -0
- package/external/folly/folly/detail/Futex-inl.h +123 -0
- package/external/folly/folly/detail/Futex.cpp +273 -0
- package/external/folly/folly/detail/Futex.h +109 -0
- package/external/folly/folly/detail/GroupVarintDetail.h +101 -0
- package/external/folly/folly/detail/IPAddress.cpp +37 -0
- package/external/folly/folly/detail/IPAddress.h +57 -0
- package/external/folly/folly/detail/IPAddressSource.h +278 -0
- package/external/folly/folly/detail/Iterators.h +156 -0
- package/external/folly/folly/detail/MPMCPipelineDetail.h +122 -0
- package/external/folly/folly/detail/MemoryIdler.cpp +233 -0
- package/external/folly/folly/detail/MemoryIdler.h +216 -0
- package/external/folly/folly/detail/PerfScoped.cpp +112 -0
- package/external/folly/folly/detail/PerfScoped.h +70 -0
- package/external/folly/folly/detail/PolyDetail.h +921 -0
- package/external/folly/folly/detail/RangeCommon.cpp +55 -0
- package/external/folly/folly/detail/RangeCommon.h +93 -0
- package/external/folly/folly/detail/RangeSse42.cpp +198 -0
- package/external/folly/folly/detail/RangeSse42.h +30 -0
- package/external/folly/folly/detail/SimpleSimdStringUtils.cpp +31 -0
- package/external/folly/folly/detail/SimpleSimdStringUtils.h +27 -0
- package/external/folly/folly/detail/SimpleSimdStringUtilsImpl.h +63 -0
- package/external/folly/folly/detail/Singleton.h +34 -0
- package/external/folly/folly/detail/SlowFingerprint.h +90 -0
- package/external/folly/folly/detail/SocketFastOpen.cpp +175 -0
- package/external/folly/folly/detail/SocketFastOpen.h +89 -0
- package/external/folly/folly/detail/SplitStringSimd.cpp +84 -0
- package/external/folly/folly/detail/SplitStringSimd.h +151 -0
- package/external/folly/folly/detail/SplitStringSimdImpl.h +149 -0
- package/external/folly/folly/detail/Sse.cpp +35 -0
- package/external/folly/folly/detail/Sse.h +45 -0
- package/external/folly/folly/detail/StaticSingletonManager.cpp +119 -0
- package/external/folly/folly/detail/StaticSingletonManager.h +298 -0
- package/external/folly/folly/detail/ThreadLocalDetail.cpp +492 -0
- package/external/folly/folly/detail/ThreadLocalDetail.h +800 -0
- package/external/folly/folly/detail/TrapOnAvx512.cpp +41 -0
- package/external/folly/folly/detail/TrapOnAvx512.h +21 -0
- package/external/folly/folly/detail/TurnSequencer.h +295 -0
- package/external/folly/folly/detail/TypeList.h +551 -0
- package/external/folly/folly/detail/UniqueInstance.cpp +136 -0
- package/external/folly/folly/detail/UniqueInstance.h +68 -0
- package/external/folly/folly/detail/base64_detail/BUCK +102 -0
- package/external/folly/folly/detail/base64_detail/Base64Api.cpp +40 -0
- package/external/folly/folly/detail/base64_detail/Base64Api.h +101 -0
- package/external/folly/folly/detail/base64_detail/Base64Common.h +80 -0
- package/external/folly/folly/detail/base64_detail/Base64Constants.h +79 -0
- package/external/folly/folly/detail/base64_detail/Base64HiddenConstants.h +129 -0
- package/external/folly/folly/detail/base64_detail/Base64SWAR.cpp +161 -0
- package/external/folly/folly/detail/base64_detail/Base64SWAR.h +32 -0
- package/external/folly/folly/detail/base64_detail/Base64Scalar.h +262 -0
- package/external/folly/folly/detail/base64_detail/Base64Simd.h +102 -0
- package/external/folly/folly/detail/base64_detail/Base64_SSE4_2.cpp +42 -0
- package/external/folly/folly/detail/base64_detail/Base64_SSE4_2.h +33 -0
- package/external/folly/folly/detail/base64_detail/Base64_SSE4_2_Platform.h +167 -0
- package/external/folly/folly/detail/base64_detail/README.md +392 -0
- package/external/folly/folly/detail/base64_detail/tests/BUCK +36 -0
- package/external/folly/folly/detail/base64_detail/tests/Base64AgainstScalarTest.cpp +141 -0
- package/external/folly/folly/detail/base64_detail/tests/Base64PlatformTest.cpp +273 -0
- package/external/folly/folly/detail/base64_detail/tests/Base64SpecialCasesTest.cpp +555 -0
- package/external/folly/folly/detail/test/AsyncTraceTest.cpp +43 -0
- package/external/folly/folly/detail/test/BUCK +118 -0
- package/external/folly/folly/detail/test/FileUtilDetailTest.cpp +56 -0
- package/external/folly/folly/detail/test/PerfScopedTest.cpp +107 -0
- package/external/folly/folly/detail/test/SimpleSimdStringUtilsTest.cpp +92 -0
- package/external/folly/folly/detail/test/SplitStringSimdTest.cpp +242 -0
- package/external/folly/folly/detail/test/StaticSingletonManagerTest.cpp +121 -0
- package/external/folly/folly/detail/test/ThreadLocalBenchmark.cpp +116 -0
- package/external/folly/folly/detail/test/ThreadLocalDetailTest.cpp +194 -0
- package/external/folly/folly/detail/test/TrapOnAvx512TestNegative.cpp +29 -0
- package/external/folly/folly/detail/test/UniqueInstanceTest.cpp +60 -0
- package/external/folly/folly/detail/thread_local_globals.cpp +69 -0
- package/external/folly/folly/detail/thread_local_globals.h +36 -0
- package/external/folly/folly/dynamic-inl.h +17 -0
- package/external/folly/folly/dynamic.h +17 -0
- package/external/folly/folly/folly_extended_library.bzl +28 -0
- package/external/folly/folly/functional/ApplyTuple.h +204 -0
- package/external/folly/folly/functional/BUCK +57 -0
- package/external/folly/folly/functional/Invoke.h +880 -0
- package/external/folly/folly/functional/Partial.h +130 -0
- package/external/folly/folly/functional/protocol.h +203 -0
- package/external/folly/folly/functional/test/ApplyTupleTest.cpp +549 -0
- package/external/folly/folly/functional/test/BUCK +57 -0
- package/external/folly/folly/functional/test/InvokeTest.cpp +483 -0
- package/external/folly/folly/functional/test/PartialTest.cpp +141 -0
- package/external/folly/folly/functional/test/protocol_test.cpp +177 -0
- package/external/folly/folly/functional/test/traits_test.cpp +551 -0
- package/external/folly/folly/functional/traits.h +675 -0
- package/external/folly/folly/hash/BUCK +86 -0
- package/external/folly/folly/hash/Checksum.cpp +275 -0
- package/external/folly/folly/hash/Checksum.h +94 -0
- package/external/folly/folly/hash/FarmHash.h +46 -0
- package/external/folly/folly/hash/Hash.h +1045 -0
- package/external/folly/folly/hash/MurmurHash.h +86 -0
- package/external/folly/folly/hash/SpookyHashV1.cpp +391 -0
- package/external/folly/folly/hash/SpookyHashV1.h +307 -0
- package/external/folly/folly/hash/SpookyHashV2.cpp +392 -0
- package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/hash/SpookyHashV2.h +6 -1
- package/external/folly/folly/hash/detail/BUCK +26 -0
- package/external/folly/folly/hash/detail/ChecksumDetail.cpp +296 -0
- package/external/folly/folly/hash/detail/ChecksumDetail.h +137 -0
- package/external/folly/folly/hash/detail/Crc32CombineDetail.cpp +191 -0
- package/external/folly/folly/hash/detail/Crc32cDetail.cpp +303 -0
- package/external/folly/folly/hash/test/BUCK +132 -0
- package/external/folly/folly/hash/test/ChecksumBenchmark.cpp +91 -0
- package/external/folly/folly/hash/test/ChecksumTest.cpp +587 -0
- package/external/folly/folly/hash/test/FarmHashTest.cpp +41 -0
- package/external/folly/folly/hash/test/HashBenchmark.cpp +238 -0
- package/external/folly/folly/hash/test/HashTest.cpp +997 -0
- package/external/folly/folly/hash/test/MurmurHashTest.cpp +76 -0
- package/external/folly/folly/hash/test/SpookyHashV1Test.cpp +559 -0
- package/external/folly/folly/hash/test/SpookyHashV2Test.cpp +549 -0
- package/external/folly/folly/hash/test/traits_test.cpp +69 -0
- package/external/folly/folly/hash/traits.h +115 -0
- package/external/folly/folly/json/BUCK +155 -0
- package/external/folly/folly/json/DynamicConverter.h +464 -0
- package/external/folly/folly/json/DynamicParser-inl.h +316 -0
- package/external/folly/folly/json/DynamicParser.cpp +198 -0
- package/external/folly/folly/json/DynamicParser.h +394 -0
- package/external/folly/folly/json/JSONSchema.cpp +1030 -0
- package/external/folly/folly/json/JSONSchema.h +73 -0
- package/external/folly/folly/json/JsonMockUtil.h +73 -0
- package/external/folly/folly/json/JsonTestUtil.cpp +167 -0
- package/external/folly/folly/json/JsonTestUtil.h +88 -0
- package/external/folly/folly/json/bser/BUCK +24 -0
- package/external/folly/folly/json/bser/Bser.h +107 -0
- package/external/folly/folly/json/bser/Dump.cpp +253 -0
- package/external/folly/folly/json/bser/Load.cpp +246 -0
- package/external/folly/folly/json/bser/test/BUCK +14 -0
- package/external/folly/folly/json/bser/test/BserTest.cpp +149 -0
- package/external/folly/folly/json/dynamic.cpp +552 -0
- package/external/folly/folly/json/dynamic.h +1346 -0
- package/external/folly/folly/json/json.h +238 -0
- package/external/folly/folly/json/json_patch.cpp +325 -0
- package/external/folly/folly/json/json_patch.h +126 -0
- package/external/folly/folly/json/json_pointer.cpp +114 -0
- package/external/folly/folly/json/json_pointer.h +87 -0
- package/external/folly/folly/json/test/BUCK +147 -0
- package/external/folly/folly/json/test/DynamicBenchmark.cpp +146 -0
- package/external/folly/folly/json/test/DynamicConverterTest.cpp +518 -0
- package/external/folly/folly/json/test/DynamicOtherTest.cpp +344 -0
- package/external/folly/folly/json/test/DynamicParserTest.cpp +443 -0
- package/external/folly/folly/json/test/DynamicTest.cpp +1647 -0
- package/external/folly/folly/json/test/JSONSchemaTest.cpp +450 -0
- package/external/folly/folly/json/test/JsonBenchmark.cpp +264 -0
- package/external/folly/folly/json/test/JsonOtherTest.cpp +51 -0
- package/external/folly/folly/json/test/JsonTest.cpp +1153 -0
- package/external/folly/folly/json/test/JsonTestUtilTest.cpp +97 -0
- package/external/folly/folly/json/test/json_patch_test.cpp +361 -0
- package/external/folly/folly/json/test/json_pointer_test.cpp +58 -0
- package/external/folly/folly/json/tool/BUCK +13 -0
- package/external/folly/folly/json/tool/JSONSchemaTester.cpp +58 -0
- package/external/folly/folly/json.h +17 -0
- package/external/folly/folly/json_patch.h +17 -0
- package/external/folly/folly/json_pointer.h +17 -0
- package/external/folly/folly/lang/Access.h +29 -0
- package/external/folly/folly/lang/Align.h +240 -0
- package/external/folly/folly/lang/Aligned.h +92 -0
- package/external/folly/folly/lang/Assume.h +82 -0
- package/external/folly/folly/lang/BUCK +287 -0
- package/external/folly/folly/lang/Badge.h +108 -0
- package/external/folly/folly/lang/Bits.h +570 -0
- package/external/folly/folly/lang/BitsClass.h +312 -0
- package/external/folly/folly/lang/Builtin.h +74 -0
- package/external/folly/folly/lang/CArray.h +34 -0
- package/external/folly/folly/lang/CString.cpp +86 -0
- package/external/folly/folly/lang/CString.h +55 -0
- package/external/folly/folly/lang/Cast.h +51 -0
- package/external/folly/folly/lang/CheckedMath.h +253 -0
- package/external/folly/folly/lang/CustomizationPoint.h +58 -0
- package/external/folly/folly/lang/Exception.cpp +822 -0
- package/external/folly/folly/lang/Exception.h +716 -0
- package/external/folly/folly/lang/Extern.h +55 -0
- package/external/folly/folly/lang/Hint-inl.h +144 -0
- package/external/folly/folly/lang/Hint.h +238 -0
- package/external/folly/folly/lang/Keep.h +98 -0
- package/external/folly/folly/lang/New.h +124 -0
- package/external/folly/folly/lang/Ordering.h +140 -0
- package/external/folly/folly/lang/Pretty.h +159 -0
- package/external/folly/folly/lang/PropagateConst.h +413 -0
- package/external/folly/folly/lang/RValueReferenceWrapper.h +152 -0
- package/external/folly/folly/lang/SafeAssert.cpp +589 -0
- package/external/folly/folly/lang/StaticConst.h +33 -0
- package/external/folly/folly/lang/Thunk.h +100 -0
- package/external/folly/folly/lang/TypeInfo.h +58 -0
- package/external/folly/folly/lang/UncaughtExceptions.cpp +17 -0
- package/external/folly/folly/lang/UncaughtExceptions.h +19 -0
- package/external/folly/folly/lang/test/AlignTest.cpp +87 -0
- package/external/folly/folly/lang/test/AlignedTest.cpp +130 -0
- package/external/folly/folly/lang/test/BUCK +258 -0
- package/external/folly/folly/lang/test/BadgeTest.cpp +89 -0
- package/external/folly/folly/lang/test/BitsBenchmark.cpp +164 -0
- package/external/folly/folly/lang/test/BitsClassBenchmark.cpp +122 -0
- package/external/folly/folly/lang/test/BitsClassTest.cpp +379 -0
- package/external/folly/folly/lang/test/BitsTest.cpp +577 -0
- package/external/folly/folly/lang/test/CStringTest.cpp +60 -0
- package/external/folly/folly/lang/test/CastTest.cpp +47 -0
- package/external/folly/folly/lang/test/CheckedMathTest.cpp +394 -0
- package/external/folly/folly/lang/test/ExceptionBench.cpp +427 -0
- package/external/folly/folly/lang/test/ExceptionTest.cpp +413 -0
- package/external/folly/folly/lang/test/ExternTest.cpp +39 -0
- package/external/folly/folly/lang/test/HintTest.cpp +100 -0
- package/external/folly/folly/lang/test/NewTest.cpp +38 -0
- package/external/folly/folly/lang/test/OrderingTest.cpp +105 -0
- package/external/folly/folly/lang/test/PrettyTest.cpp +44 -0
- package/external/folly/folly/lang/test/PropagateConstTest.cpp +356 -0
- package/external/folly/folly/lang/test/RValueReferenceWrapperTest.cpp +85 -0
- package/external/folly/folly/lang/test/SafeAssertTest.cpp +75 -0
- package/external/folly/folly/lang/test/ThunkTest.cpp +105 -0
- package/external/folly/folly/lang/test/ToAsciiBench.cpp +466 -0
- package/external/folly/folly/lang/test/ToAsciiTest.cpp +266 -0
- package/external/folly/folly/lang/test/TypeInfoTest.cpp +56 -0
- package/external/folly/folly/memcpy.S +292 -0
- package/external/folly/folly/memcpy_select_aarch64.cpp +145 -0
- package/external/folly/folly/memory/Arena-inl.h +83 -0
- package/external/folly/folly/memory/Arena.h +325 -0
- package/external/folly/folly/memory/BUCK +191 -0
- package/external/folly/folly/memory/JemallocHugePageAllocator.cpp +449 -0
- package/external/folly/folly/memory/JemallocHugePageAllocator.h +105 -0
- package/external/folly/folly/memory/JemallocHugePageAllocatorTest.cpp +341 -0
- package/external/folly/folly/memory/JemallocNodumpAllocator.cpp +176 -0
- package/external/folly/folly/memory/JemallocNodumpAllocator.h +119 -0
- package/external/folly/folly/memory/JemallocNodumpAllocatorTest.cpp +61 -0
- package/external/folly/folly/memory/MallctlHelper.cpp +37 -0
- package/external/folly/folly/memory/MallctlHelper.h +167 -0
- package/external/folly/folly/memory/Malloc.h +551 -0
- package/external/folly/folly/memory/MemoryResource.h +57 -0
- package/external/folly/folly/memory/ReentrantAllocator.cpp +162 -0
- package/external/folly/folly/memory/ReentrantAllocator.h +261 -0
- package/external/folly/folly/memory/SanitizeAddress.cpp +75 -0
- package/external/folly/folly/memory/SanitizeAddress.h +117 -0
- package/external/folly/folly/memory/SanitizeLeak.cpp +119 -0
- package/external/folly/folly/memory/SanitizeLeak.h +108 -0
- package/external/folly/folly/memory/ThreadCachedArena.cpp +53 -0
- package/external/folly/folly/memory/ThreadCachedArena.h +90 -0
- package/external/folly/folly/memory/UninitializedMemoryHacks.h +426 -0
- package/external/folly/folly/memory/detail/BUCK +10 -0
- package/external/folly/folly/memory/detail/MallocImpl.cpp +52 -0
- package/external/folly/folly/memory/detail/MallocImpl.h +97 -0
- package/external/folly/folly/memory/not_null-inl.h +522 -0
- package/external/folly/folly/memory/not_null.h +449 -0
- package/external/folly/folly/memory/test/ArenaTest.cpp +354 -0
- package/external/folly/folly/memory/test/BUCK +146 -0
- package/external/folly/folly/memory/test/MallctlHelperTest.cpp +169 -0
- package/external/folly/folly/memory/test/MallocBenchmark.cpp +91 -0
- package/external/folly/folly/memory/test/MallocTest.cpp +78 -0
- package/external/folly/folly/memory/test/MemoryResourceTest.cpp +31 -0
- package/external/folly/folly/memory/test/ReentrantAllocatorTest.cpp +144 -0
- package/external/folly/folly/memory/test/SanitizeAddressTest.cpp +67 -0
- package/external/folly/folly/memory/test/SanitizeLeakTest.cpp +139 -0
- package/external/folly/folly/memory/test/ThreadCachedArenaTest.cpp +276 -0
- package/external/folly/folly/memory/test/UninitializedMemoryHacksODR.cpp +21 -0
- package/external/folly/folly/memory/test/UninitializedMemoryHacksTest.cpp +327 -0
- package/external/folly/folly/memory/test/not_null_test.cpp +608 -0
- package/external/folly/folly/memset.S +245 -0
- package/external/folly/folly/memset_select_aarch64.cpp +72 -0
- package/external/folly/folly/portability/Asm.h +50 -0
- package/external/folly/folly/portability/Atomic.h +31 -0
- package/external/folly/folly/portability/BUCK +456 -0
- package/external/folly/folly/portability/Builtins.cpp +31 -0
- package/external/folly/folly/portability/Builtins.h +161 -0
- package/external/folly/folly/portability/Config.h +43 -0
- package/external/folly/folly/portability/Constexpr.h +145 -0
- package/external/folly/folly/portability/Dirent.cpp +140 -0
- package/external/folly/folly/portability/Dirent.h +41 -0
- package/external/folly/folly/portability/Event.h +44 -0
- package/external/folly/folly/portability/Fcntl.cpp +120 -0
- package/external/folly/folly/portability/Fcntl.h +67 -0
- package/external/folly/folly/portability/Filesystem.cpp +67 -0
- package/external/folly/folly/portability/Filesystem.h +114 -0
- package/external/folly/folly/portability/FmtCompile.h +40 -0
- package/external/folly/folly/portability/GFlags.h +139 -0
- package/external/folly/folly/portability/GMock.h +35 -0
- package/external/folly/folly/portability/GTest.h +35 -0
- package/external/folly/folly/portability/IOVec.h +34 -0
- package/external/folly/folly/portability/Libgen.cpp +59 -0
- package/external/folly/folly/portability/Libgen.h +29 -0
- package/external/folly/folly/portability/Libunwind.h +21 -0
- package/external/folly/folly/portability/Malloc.cpp +31 -0
- package/external/folly/folly/portability/Malloc.h +53 -0
- package/external/folly/folly/portability/Math.h +90 -0
- package/external/folly/folly/portability/Memory.h +26 -0
- package/external/folly/folly/portability/OpenSSL.cpp +17 -0
- package/external/folly/folly/portability/OpenSSL.h +102 -0
- package/external/folly/folly/portability/PThread.cpp +697 -0
- package/external/folly/folly/portability/PThread.h +148 -0
- package/external/folly/folly/portability/README.md +21 -0
- package/external/folly/folly/portability/Sched.cpp +41 -0
- package/external/folly/folly/portability/Sched.h +45 -0
- package/external/folly/folly/portability/Sockets.cpp +245 -0
- package/external/folly/folly/portability/Sockets.h +155 -0
- package/external/folly/folly/portability/SourceLocation.h +49 -0
- package/external/folly/folly/portability/Stdio.cpp +77 -0
- package/external/folly/folly/portability/Stdio.h +32 -0
- package/external/folly/folly/portability/Stdlib.cpp +172 -0
- package/external/folly/folly/portability/Stdlib.h +64 -0
- package/external/folly/folly/portability/String.cpp +53 -0
- package/external/folly/folly/portability/String.h +39 -0
- package/external/folly/folly/portability/SysFile.cpp +46 -0
- package/external/folly/folly/portability/SysFile.h +27 -0
- package/external/folly/folly/portability/SysMembarrier.cpp +104 -0
- package/external/folly/folly/portability/SysMembarrier.h +26 -0
- package/external/folly/folly/portability/SysMman.cpp +242 -0
- package/external/folly/folly/portability/SysMman.h +68 -0
- package/external/folly/folly/portability/SysResource.cpp +108 -0
- package/external/folly/folly/portability/SysResource.h +71 -0
- package/external/folly/folly/portability/SysStat.cpp +66 -0
- package/external/folly/folly/portability/SysStat.h +52 -0
- package/external/folly/folly/portability/SysSyscall.h +73 -0
- package/external/folly/folly/portability/SysTime.cpp +62 -0
- package/external/folly/folly/portability/SysTime.h +50 -0
- package/external/folly/folly/portability/SysTypes.h +44 -0
- package/external/folly/folly/portability/SysUio.cpp +179 -0
- package/external/folly/folly/portability/SysUio.h +51 -0
- package/external/folly/folly/portability/Syslog.h +39 -0
- package/external/folly/folly/portability/Time.cpp +357 -0
- package/external/folly/folly/portability/Time.h +74 -0
- package/external/folly/folly/portability/Unistd.h +111 -0
- package/external/folly/folly/portability/Windows.h +108 -0
- package/external/folly/folly/portability/openat2.c +30 -0
- package/external/folly/folly/portability/openat2.h +39 -0
- package/external/folly/folly/portability/test/BUCK +59 -0
- package/external/folly/folly/portability/test/ConstexprTest.cpp +102 -0
- package/external/folly/folly/portability/test/FilesystemTest.cpp +35 -0
- package/external/folly/folly/portability/test/LibgenTest.cpp +35 -0
- package/external/folly/folly/portability/test/OpenSSLPortabilityTest.cpp +108 -0
- package/external/folly/folly/portability/test/PThreadTest.cpp +80 -0
- package/external/folly/folly/portability/test/TimeTest.cpp +90 -0
- package/external/folly/folly/small_vector.h +17 -0
- package/external/folly/folly/somerge_defs.bzl +399 -0
- package/external/folly/folly/sorted_vector_types.h +17 -0
- package/external/folly/folly/stop_watch.h +317 -0
- package/external/folly/folly/synchronization/AsymmetricThreadFence.cpp +91 -0
- package/external/folly/folly/synchronization/AsymmetricThreadFence.h +60 -0
- package/external/folly/folly/synchronization/AtomicNotification-inl.h +146 -0
- package/external/folly/folly/synchronization/AtomicNotification.cpp +34 -0
- package/external/folly/folly/synchronization/AtomicNotification.h +117 -0
- package/external/folly/folly/synchronization/AtomicRef.h +181 -0
- package/external/folly/folly/synchronization/AtomicStruct.h +150 -0
- package/external/folly/folly/synchronization/AtomicUtil-inl.h +482 -0
- package/external/folly/folly/synchronization/AtomicUtil.h +179 -0
- package/external/folly/folly/synchronization/BUCK +418 -0
- package/external/folly/folly/synchronization/Baton.h +419 -0
- package/external/folly/folly/synchronization/CallOnce.h +263 -0
- package/external/folly/folly/synchronization/DelayedInit.h +179 -0
- package/external/folly/folly/synchronization/DistributedMutex-inl.h +1744 -0
- package/external/folly/folly/synchronization/DistributedMutex.cpp +27 -0
- package/external/folly/folly/synchronization/DistributedMutex.h +342 -0
- package/external/folly/folly/synchronization/EventCount.h +200 -0
- package/external/folly/folly/synchronization/FlatCombining.h +629 -0
- package/external/folly/folly/synchronization/Hazptr-fwd.h +217 -0
- package/external/folly/folly/synchronization/Hazptr.cpp +36 -0
- package/external/folly/folly/synchronization/Hazptr.h +209 -0
- package/external/folly/folly/synchronization/HazptrDomain.cpp +68 -0
- package/external/folly/folly/synchronization/HazptrDomain.h +832 -0
- package/external/folly/folly/synchronization/HazptrHolder.h +431 -0
- package/external/folly/folly/synchronization/HazptrObj.h +533 -0
- package/external/folly/folly/synchronization/HazptrObjLinked.h +315 -0
- package/external/folly/folly/synchronization/HazptrRec.h +68 -0
- package/external/folly/folly/synchronization/HazptrThrLocal.h +180 -0
- package/external/folly/folly/synchronization/HazptrThreadPoolExecutor.cpp +46 -0
- package/external/folly/folly/synchronization/HazptrThreadPoolExecutor.h +25 -0
- package/external/folly/folly/synchronization/Latch.h +160 -0
- package/external/folly/folly/synchronization/LifoSem.h +767 -0
- package/external/folly/folly/synchronization/Lock.h +887 -0
- package/external/folly/folly/synchronization/MicroSpinLock.h +154 -0
- package/external/folly/folly/synchronization/NativeSemaphore.h +187 -0
- package/external/folly/folly/synchronization/ParkingLot.cpp +37 -0
- package/external/folly/folly/synchronization/ParkingLot.h +330 -0
- package/external/folly/folly/synchronization/PicoSpinLock.h +167 -0
- package/external/folly/folly/synchronization/RWSpinLock.h +549 -0
- package/external/folly/folly/synchronization/Rcu.cpp +26 -0
- package/external/folly/folly/synchronization/Rcu.h +553 -0
- package/external/folly/folly/synchronization/RelaxedAtomic.h +336 -0
- package/external/folly/folly/synchronization/SanitizeThread.cpp +141 -0
- package/external/folly/folly/synchronization/SanitizeThread.h +166 -0
- package/external/folly/folly/synchronization/SaturatingSemaphore.h +324 -0
- package/external/folly/folly/synchronization/SmallLocks.h +36 -0
- package/external/folly/folly/synchronization/ThrottledLifoSem.h +362 -0
- package/external/folly/folly/synchronization/WaitOptions.cpp +25 -0
- package/external/folly/folly/synchronization/WaitOptions.h +75 -0
- package/external/folly/folly/synchronization/detail/AtomicUtils.h +59 -0
- package/external/folly/folly/synchronization/detail/BUCK +104 -0
- package/external/folly/folly/synchronization/detail/Hardware.cpp +192 -0
- package/external/folly/folly/synchronization/detail/Hardware.h +75 -0
- package/external/folly/folly/synchronization/detail/HazptrUtils.h +339 -0
- package/external/folly/folly/synchronization/detail/InlineFunctionRef.h +229 -0
- package/external/folly/folly/synchronization/detail/Sleeper.cpp +27 -0
- package/external/folly/folly/synchronization/detail/Sleeper.h +62 -0
- package/external/folly/folly/synchronization/detail/Spin.h +96 -0
- package/external/folly/folly/synchronization/detail/ThreadCachedLists.h +174 -0
- package/external/folly/folly/synchronization/detail/ThreadCachedReaders.h +189 -0
- package/external/folly/folly/synchronization/detail/ThreadCachedTag.h +26 -0
- package/external/folly/folly/synchronization/detail/test/BUCK +28 -0
- package/external/folly/folly/synchronization/detail/test/HardwareTest.cpp +74 -0
- package/external/folly/folly/synchronization/detail/test/InlineFunctionRefTest.cpp +286 -0
- package/external/folly/folly/synchronization/example/BUCK +27 -0
- package/external/folly/folly/synchronization/example/HazptrLockFreeLIFO.h +88 -0
- package/external/folly/folly/synchronization/example/HazptrSWMRSet.h +133 -0
- package/external/folly/folly/synchronization/example/HazptrWideCAS.h +62 -0
- package/external/folly/folly/synchronization/test/AtomicNotificationTest.cpp +236 -0
- package/external/folly/folly/synchronization/test/AtomicRefTest.cpp +170 -0
- package/external/folly/folly/synchronization/test/AtomicStructTest.cpp +65 -0
- package/external/folly/folly/synchronization/test/AtomicUtilBench.cpp +457 -0
- package/external/folly/folly/synchronization/test/AtomicUtilTest.cpp +650 -0
- package/external/folly/folly/synchronization/test/BUCK +495 -0
- package/external/folly/folly/synchronization/test/Barrier.h +52 -0
- package/external/folly/folly/synchronization/test/BarrierTest.cpp +56 -0
- package/external/folly/folly/synchronization/test/BatonBenchmark.cpp +77 -0
- package/external/folly/folly/synchronization/test/BatonTest.cpp +164 -0
- package/external/folly/folly/synchronization/test/BatonTestHelpers.h +118 -0
- package/external/folly/folly/synchronization/test/CallOnceBenchmark.cpp +72 -0
- package/external/folly/folly/synchronization/test/CallOnceTest.cpp +153 -0
- package/external/folly/folly/synchronization/test/DelayedInitTest.cpp +281 -0
- package/external/folly/folly/synchronization/test/DistributedMutexTest.cpp +2074 -0
- package/external/folly/folly/synchronization/test/EventCountTest.cpp +124 -0
- package/external/folly/folly/synchronization/test/FlatCombiningBenchmark.cpp +1789 -0
- package/external/folly/folly/synchronization/test/FlatCombiningExamples.h +222 -0
- package/external/folly/folly/synchronization/test/FlatCombiningTest.cpp +121 -0
- package/external/folly/folly/synchronization/test/FlatCombiningTestHelpers.h +227 -0
- package/external/folly/folly/synchronization/test/HazptrTest.cpp +1689 -0
- package/external/folly/folly/synchronization/test/LatchTest.cpp +224 -0
- package/external/folly/folly/synchronization/test/LifoSemBench.cpp +185 -0
- package/external/folly/folly/synchronization/test/LifoSemTests.cpp +353 -0
- package/external/folly/folly/synchronization/test/LockTest.cpp +1239 -0
- package/external/folly/folly/synchronization/test/NativeSemaphoreTest.cpp +37 -0
- package/external/folly/folly/synchronization/test/ParkingLotBenchmark.cpp +239 -0
- package/external/folly/folly/synchronization/test/ParkingLotTest.cpp +170 -0
- package/external/folly/folly/synchronization/test/RWSpinLockTest.cpp +235 -0
- package/external/folly/folly/synchronization/test/RcuBench.cpp +66 -0
- package/external/folly/folly/synchronization/test/RcuTest.cpp +330 -0
- package/external/folly/folly/synchronization/test/RelaxedAtomicTest.cpp +389 -0
- package/external/folly/folly/synchronization/test/SaturatingSemaphoreTest.cpp +166 -0
- package/external/folly/folly/synchronization/test/Semaphore.h +242 -0
- package/external/folly/folly/synchronization/test/SemaphoreTest.cpp +271 -0
- package/external/folly/folly/synchronization/test/SmallLocksBenchmark.cpp +1296 -0
- package/external/folly/folly/synchronization/test/SmallLocksTest.cpp +510 -0
- package/external/folly/folly/synchronization/test/ThreadCachedEpochBench.h +67 -0
- package/external/folly/folly/synchronization/test/ThreadCachedReadersBench.cpp +42 -0
- package/external/folly/folly/synchronization/test/ThreadCachedReadersTest.cpp +52 -0
- package/external/folly/folly/synchronization/test/ThrottledLifoSemTest.cpp +243 -0
- package/external/folly/folly/system/AtFork.cpp +205 -0
- package/external/folly/folly/system/AtFork.h +116 -0
- package/external/folly/folly/system/AuxVector.h +198 -0
- package/external/folly/folly/system/BUCK +144 -0
- package/external/folly/folly/system/EnvUtil.cpp +93 -0
- package/external/folly/folly/system/EnvUtil.h +113 -0
- package/external/folly/folly/system/HardwareConcurrency.cpp +39 -0
- package/external/folly/folly/system/HardwareConcurrency.h +23 -0
- package/external/folly/folly/system/MemoryMapping.cpp +477 -0
- package/external/folly/folly/system/MemoryMapping.h +287 -0
- package/external/folly/folly/system/Pid.cpp +87 -0
- package/external/folly/folly/system/Pid.h +34 -0
- package/external/folly/folly/system/Shell.cpp +33 -0
- package/external/folly/folly/system/Shell.h +93 -0
- package/external/folly/folly/system/ThreadId.cpp +89 -0
- package/external/folly/folly/system/ThreadId.h +62 -0
- package/external/folly/folly/system/ThreadName.cpp +330 -0
- package/external/folly/folly/system/ThreadName.h +72 -0
- package/external/folly/folly/system/test/AtForkTest.cpp +309 -0
- package/external/folly/folly/system/test/AuxVectorTest.cpp +55 -0
- package/external/folly/folly/system/test/BUCK +120 -0
- package/external/folly/folly/system/test/EnvUtilSubprocess.cpp +26 -0
- package/external/folly/folly/system/test/EnvUtilTest.cpp +197 -0
- package/external/folly/folly/system/test/MemoryMappingTest.cpp +179 -0
- package/external/folly/folly/system/test/PidTest.cpp +46 -0
- package/external/folly/folly/system/test/ShellTest.cpp +66 -0
- package/external/folly/folly/system/test/ThreadIdTest.cpp +114 -0
- package/external/folly/folly/system/test/ThreadNameTest.cpp +85 -0
- package/external/folly/folly.vcxitems +164 -0
- package/external/folly/sync-config.json +8 -0
- package/package.json +3 -3
- package/template/cpp-app/proj/MyApp.sln +0 -33
- package/template/cpp-lib/proj/MyLib.sln +0 -33
- package/template/cs-app/proj/MyApp.sln +0 -33
- package/template/cs-lib/proj/MyLib.sln +0 -33
- package/templates/cpp-app/windows/MyApp.sln +0 -33
- package/templates/cpp-lib/windows/MyLib.sln +0 -33
- package/Folly/Folly.vcxproj +0 -383
- package/Folly/Folly.vcxproj.filters +0 -558
- package/Folly/Folly.win32.vcxproj +0 -11
- package/Folly/packages.lock.win32.json +0 -20
- package/fmt/fmt.vcxproj +0 -163
- package/fmt/fmt.vcxproj.filters +0 -59
- package/fmt/fmt.win32.vcxproj +0 -10
- package/fmt/pch.cpp +0 -4
- package/fmt/pch.h +0 -2
- /package/{Folly → external/folly}/Folly.natvis +0 -0
- /package/{Folly → external/folly}/cgmanifest.json +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/ConstexprMath.h +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/Conv.cpp +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/chrono/Hardware.h +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/concurrency/CacheLocality.cpp +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/json/dynamic-inl.h +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/json/json.cpp +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/lang/SafeAssert.h +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/lang/ToAscii.cpp +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/lang/ToAscii.h +0 -0
- /package/{Folly/TEMP_UntilFollyUpdate → external/folly/folly}/portability/Unistd.cpp +0 -0
|
@@ -0,0 +1,989 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#include <folly/container/Iterator.h>
|
|
18
|
+
|
|
19
|
+
#include <algorithm>
|
|
20
|
+
#include <cassert>
|
|
21
|
+
#include <cstddef>
|
|
22
|
+
#include <deque>
|
|
23
|
+
#include <functional>
|
|
24
|
+
#include <iterator>
|
|
25
|
+
#include <list>
|
|
26
|
+
#include <map>
|
|
27
|
+
#include <numeric>
|
|
28
|
+
#include <set>
|
|
29
|
+
#include <tuple>
|
|
30
|
+
#include <type_traits>
|
|
31
|
+
#include <utility>
|
|
32
|
+
#include <vector>
|
|
33
|
+
|
|
34
|
+
#include <folly/portability/GTest.h>
|
|
35
|
+
|
|
36
|
+
#if defined(__cpp_lib_concepts)
|
|
37
|
+
#include <concepts>
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
class IteratorTest : public testing::Test {};
|
|
41
|
+
|
|
42
|
+
TEST_F(IteratorTest, iterator_has_known_distance_v) {
|
|
43
|
+
EXPECT_FALSE((folly::iterator_has_known_distance_v<int*, int const*>));
|
|
44
|
+
EXPECT_TRUE((folly::iterator_has_known_distance_v<int*, int*>));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
TEST_F(IteratorTest, range_has_known_distance_v) {
|
|
48
|
+
EXPECT_FALSE(folly::range_has_known_distance_v<std::list<int>&>);
|
|
49
|
+
EXPECT_TRUE(folly::range_has_known_distance_v<std::vector<int>&>);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
TEST_F(IteratorTest, iterator_category_t) {
|
|
53
|
+
EXPECT_TRUE(( //
|
|
54
|
+
std::is_same_v<
|
|
55
|
+
folly::iterator_category_t<
|
|
56
|
+
std::iterator<std::input_iterator_tag, int>>,
|
|
57
|
+
std::input_iterator_tag>));
|
|
58
|
+
EXPECT_FALSE(( //
|
|
59
|
+
std::is_same_v<
|
|
60
|
+
folly::iterator_category_t<
|
|
61
|
+
std::iterator<std::input_iterator_tag, int>>,
|
|
62
|
+
std::output_iterator_tag>));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
TEST_F(IteratorTest, iterator_category_matches_v) {
|
|
66
|
+
EXPECT_TRUE(( //
|
|
67
|
+
folly::iterator_category_matches_v<
|
|
68
|
+
std::iterator<std::input_iterator_tag, int>,
|
|
69
|
+
std::input_iterator_tag>));
|
|
70
|
+
EXPECT_FALSE(( //
|
|
71
|
+
folly::iterator_category_matches_v<
|
|
72
|
+
std::iterator<std::input_iterator_tag, int>,
|
|
73
|
+
std::output_iterator_tag>));
|
|
74
|
+
EXPECT_FALSE(( //
|
|
75
|
+
folly::iterator_category_matches_v<int, std::input_iterator_tag>));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
TEST_F(IteratorTest, iterator_value_type_t) {
|
|
79
|
+
EXPECT_TRUE(( //
|
|
80
|
+
std::is_same_v<
|
|
81
|
+
std::map<int, double>::value_type,
|
|
82
|
+
folly::iterator_value_type_t<std::map<int, double>::iterator>>));
|
|
83
|
+
EXPECT_TRUE(( //
|
|
84
|
+
std::is_same_v<
|
|
85
|
+
std::map<std::reference_wrapper<int>, double&>::value_type,
|
|
86
|
+
folly::iterator_value_type_t<
|
|
87
|
+
std::map<std::reference_wrapper<int>, double&>::iterator>>));
|
|
88
|
+
EXPECT_FALSE(( //
|
|
89
|
+
std::is_same_v<
|
|
90
|
+
std::map<int, float>::value_type,
|
|
91
|
+
folly::iterator_value_type_t<std::map<int, double>::iterator>>));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
TEST_F(IteratorTest, iterator_key_type_t) {
|
|
95
|
+
EXPECT_TRUE(( //
|
|
96
|
+
std::is_same_v<
|
|
97
|
+
std::map<int, double>::key_type,
|
|
98
|
+
folly::iterator_key_type_t<std::map<int, double>::iterator>>));
|
|
99
|
+
EXPECT_TRUE(( //
|
|
100
|
+
std::is_same_v<
|
|
101
|
+
std::map<std::reference_wrapper<int>, double&>::key_type,
|
|
102
|
+
folly::iterator_key_type_t<
|
|
103
|
+
std::map<std::reference_wrapper<int>, double&>::iterator>>));
|
|
104
|
+
EXPECT_TRUE(( //
|
|
105
|
+
std::is_same_v<
|
|
106
|
+
int,
|
|
107
|
+
folly::iterator_key_type_t<std::iterator<
|
|
108
|
+
std::input_iterator_tag,
|
|
109
|
+
std::pair<const int&, double>>>>));
|
|
110
|
+
EXPECT_FALSE(( //
|
|
111
|
+
std::is_same_v<
|
|
112
|
+
std::map<char, double>::key_type,
|
|
113
|
+
folly::iterator_key_type_t<std::map<int, double>::iterator>>));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
TEST_F(IteratorTest, iterator_mapped_type_t) {
|
|
117
|
+
EXPECT_TRUE(( //
|
|
118
|
+
std::is_same_v<
|
|
119
|
+
std::map<int, double>::mapped_type,
|
|
120
|
+
folly::iterator_mapped_type_t<std::map<int, double>::iterator>>));
|
|
121
|
+
EXPECT_TRUE(( //
|
|
122
|
+
std::is_same_v<
|
|
123
|
+
std::map<std::reference_wrapper<int>, double&>::mapped_type,
|
|
124
|
+
folly::iterator_mapped_type_t<
|
|
125
|
+
std::map<std::reference_wrapper<int>, double&>::iterator>>));
|
|
126
|
+
EXPECT_FALSE(( //
|
|
127
|
+
std::is_same_v<
|
|
128
|
+
std::map<int, float>::mapped_type,
|
|
129
|
+
folly::iterator_mapped_type_t<std::map<int, double>::iterator>>));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
namespace {
|
|
133
|
+
/**
|
|
134
|
+
* Container type used for unit tests.
|
|
135
|
+
*/
|
|
136
|
+
template <typename T>
|
|
137
|
+
using Container = std::deque<T>;
|
|
138
|
+
|
|
139
|
+
// Constructor and assignment operator call counters for struct Object.
|
|
140
|
+
std::size_t gDefaultCtrCnt;
|
|
141
|
+
std::size_t gCopyCtrCnt;
|
|
142
|
+
std::size_t gMoveCtrCnt;
|
|
143
|
+
std::size_t gExplicitCtrCnt;
|
|
144
|
+
std::size_t gMultiargCtrCnt;
|
|
145
|
+
std::size_t gCopyOpCnt;
|
|
146
|
+
std::size_t gMoveOpCnt;
|
|
147
|
+
std::size_t gConvertOpCnt;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Class that increases various counters to keep track of how objects have
|
|
151
|
+
* been constructed or assigned to, to verify iterator behavior.
|
|
152
|
+
*/
|
|
153
|
+
struct Object {
|
|
154
|
+
Object() { ++gDefaultCtrCnt; }
|
|
155
|
+
Object(const Object&) { ++gCopyCtrCnt; }
|
|
156
|
+
Object(Object&&) noexcept { ++gMoveCtrCnt; }
|
|
157
|
+
explicit Object(int) { ++gExplicitCtrCnt; }
|
|
158
|
+
explicit Object(int, int) { ++gMultiargCtrCnt; }
|
|
159
|
+
Object& operator=(const Object&) {
|
|
160
|
+
++gCopyOpCnt;
|
|
161
|
+
return *this;
|
|
162
|
+
}
|
|
163
|
+
Object& operator=(Object&&) noexcept {
|
|
164
|
+
++gMoveOpCnt;
|
|
165
|
+
return *this;
|
|
166
|
+
}
|
|
167
|
+
Object& operator=(int) noexcept {
|
|
168
|
+
++gConvertOpCnt;
|
|
169
|
+
return *this;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Reset all call counters to 0.
|
|
175
|
+
*/
|
|
176
|
+
void init_counters() {
|
|
177
|
+
gDefaultCtrCnt = gCopyCtrCnt = gMoveCtrCnt = gExplicitCtrCnt =
|
|
178
|
+
gMultiargCtrCnt = gCopyOpCnt = gMoveOpCnt = gConvertOpCnt = 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Test for iterator copy and move.
|
|
183
|
+
*/
|
|
184
|
+
template <typename Iterator>
|
|
185
|
+
void copy_and_move_test(Container<int>& q, Iterator it) {
|
|
186
|
+
assert(q.empty());
|
|
187
|
+
const auto it2(it); // copy construct
|
|
188
|
+
it = it2; // copy assign from const
|
|
189
|
+
FOLLY_PUSH_WARNING
|
|
190
|
+
FOLLY_CLANG_DISABLE_WARNING("-Wself-assign-overloaded")
|
|
191
|
+
it = it; // self assign
|
|
192
|
+
FOLLY_POP_WARNING
|
|
193
|
+
auto it3(std::move(it)); // move construct
|
|
194
|
+
it = std::move(it3); // move assign
|
|
195
|
+
// Make sure iterator still works.
|
|
196
|
+
it = 4711; // emplace
|
|
197
|
+
EXPECT_EQ(q, Container<int>{4711});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Test for emplacement with perfect forwarding.
|
|
202
|
+
*/
|
|
203
|
+
template <typename Iterator>
|
|
204
|
+
void emplace_test(Container<Object>& q, Iterator it) {
|
|
205
|
+
using folly::make_emplace_args;
|
|
206
|
+
assert(q.empty());
|
|
207
|
+
init_counters();
|
|
208
|
+
it = Object{}; // default construct + move construct
|
|
209
|
+
Object obj; // default construct
|
|
210
|
+
it = obj; // copy construct
|
|
211
|
+
it = std::move(obj); // move construct
|
|
212
|
+
const Object obj2; // default construct
|
|
213
|
+
it = obj2; // copy construct from const
|
|
214
|
+
it = std::move(obj2); // copy construct (const defeats move)
|
|
215
|
+
it = 0; // explicit construct
|
|
216
|
+
it = make_emplace_args(0, 0); // explicit multiarg construct
|
|
217
|
+
it = std::make_pair(0, 0); // implicit multiarg construct
|
|
218
|
+
it = std::make_tuple(0, 0); // implicit multiarg construct
|
|
219
|
+
auto args = make_emplace_args(Object{}); // default construct + move construct
|
|
220
|
+
it = args; // copy construct
|
|
221
|
+
it = const_cast<const decltype(args)&>(args); // copy construct from const
|
|
222
|
+
it = std::move(args); // move construct
|
|
223
|
+
auto args2 = std::make_tuple(Object{}); // default construct + move construct
|
|
224
|
+
it = args2; // (implicit multiarg) copy construct
|
|
225
|
+
it = std::move(args2); // (implicit multiarg) move construct
|
|
226
|
+
auto args3 = std::make_pair(0, 0);
|
|
227
|
+
it = args3; // implicit multiarg construct
|
|
228
|
+
it = std::move(args3); // implicit multiarg construct
|
|
229
|
+
ASSERT_EQ(q.size(), 16);
|
|
230
|
+
EXPECT_EQ(gDefaultCtrCnt, 5);
|
|
231
|
+
EXPECT_EQ(gCopyCtrCnt, 6);
|
|
232
|
+
EXPECT_EQ(gMoveCtrCnt, 6);
|
|
233
|
+
EXPECT_EQ(gExplicitCtrCnt, 1);
|
|
234
|
+
EXPECT_EQ(gMultiargCtrCnt, 5);
|
|
235
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
236
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
237
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
238
|
+
}
|
|
239
|
+
} // namespace
|
|
240
|
+
|
|
241
|
+
using namespace folly;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Basic tests for folly::emplace_iterator.
|
|
245
|
+
*/
|
|
246
|
+
TEST(EmplaceIterator, EmplacerTest) {
|
|
247
|
+
{
|
|
248
|
+
Container<int> q;
|
|
249
|
+
copy_and_move_test(q, emplacer(q, q.begin()));
|
|
250
|
+
}
|
|
251
|
+
{
|
|
252
|
+
Container<Object> q;
|
|
253
|
+
emplace_test(q, emplacer(q, q.begin()));
|
|
254
|
+
}
|
|
255
|
+
{
|
|
256
|
+
Container<int> q;
|
|
257
|
+
auto it = emplacer(q, q.begin());
|
|
258
|
+
it = 0;
|
|
259
|
+
it = 1;
|
|
260
|
+
it = 2;
|
|
261
|
+
it = emplacer(q, q.begin());
|
|
262
|
+
it = 3;
|
|
263
|
+
it = 4;
|
|
264
|
+
EXPECT_EQ(q, Container<int>({3, 4, 0, 1, 2}));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Basic tests for folly::front_emplace_iterator.
|
|
270
|
+
*/
|
|
271
|
+
TEST(EmplaceIterator, FrontEmplacerTest) {
|
|
272
|
+
{
|
|
273
|
+
Container<int> q;
|
|
274
|
+
copy_and_move_test(q, front_emplacer(q));
|
|
275
|
+
}
|
|
276
|
+
{
|
|
277
|
+
Container<Object> q;
|
|
278
|
+
emplace_test(q, front_emplacer(q));
|
|
279
|
+
}
|
|
280
|
+
{
|
|
281
|
+
Container<int> q;
|
|
282
|
+
auto it = front_emplacer(q);
|
|
283
|
+
it = 0;
|
|
284
|
+
it = 1;
|
|
285
|
+
it = 2;
|
|
286
|
+
it = front_emplacer(q);
|
|
287
|
+
it = 3;
|
|
288
|
+
it = 4;
|
|
289
|
+
EXPECT_EQ(q, Container<int>({4, 3, 2, 1, 0}));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Basic tests for folly::back_emplace_iterator.
|
|
295
|
+
*/
|
|
296
|
+
TEST(EmplaceIterator, BackEmplacerTest) {
|
|
297
|
+
{
|
|
298
|
+
Container<int> q;
|
|
299
|
+
copy_and_move_test(q, back_emplacer(q));
|
|
300
|
+
}
|
|
301
|
+
{
|
|
302
|
+
Container<Object> q;
|
|
303
|
+
emplace_test(q, back_emplacer(q));
|
|
304
|
+
}
|
|
305
|
+
{
|
|
306
|
+
Container<int> q;
|
|
307
|
+
auto it = back_emplacer(q);
|
|
308
|
+
it = 0;
|
|
309
|
+
it = 1;
|
|
310
|
+
it = 2;
|
|
311
|
+
it = back_emplacer(q);
|
|
312
|
+
it = 3;
|
|
313
|
+
it = 4;
|
|
314
|
+
EXPECT_EQ(q, Container<int>({0, 1, 2, 3, 4}));
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Basic tests for folly::hint_emplace_iterator.
|
|
320
|
+
*/
|
|
321
|
+
TEST(EmplaceIterator, HintEmplacerTest) {
|
|
322
|
+
{
|
|
323
|
+
init_counters();
|
|
324
|
+
std::map<int, Object> m;
|
|
325
|
+
auto it = hint_emplacer(m, m.end());
|
|
326
|
+
it = make_emplace_args(
|
|
327
|
+
std::piecewise_construct,
|
|
328
|
+
std::forward_as_tuple(0),
|
|
329
|
+
std::forward_as_tuple(0));
|
|
330
|
+
it = make_emplace_args(
|
|
331
|
+
std::piecewise_construct,
|
|
332
|
+
std::forward_as_tuple(1),
|
|
333
|
+
std::forward_as_tuple(0, 0));
|
|
334
|
+
it = make_emplace_args(
|
|
335
|
+
std::piecewise_construct,
|
|
336
|
+
std::forward_as_tuple(2),
|
|
337
|
+
std::forward_as_tuple(Object{}));
|
|
338
|
+
ASSERT_EQ(m.size(), 3);
|
|
339
|
+
EXPECT_EQ(gDefaultCtrCnt, 1);
|
|
340
|
+
EXPECT_EQ(gCopyCtrCnt, 0);
|
|
341
|
+
EXPECT_EQ(gMoveCtrCnt, 1);
|
|
342
|
+
EXPECT_EQ(gExplicitCtrCnt, 1);
|
|
343
|
+
EXPECT_EQ(gMultiargCtrCnt, 1);
|
|
344
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
345
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
346
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
347
|
+
}
|
|
348
|
+
{
|
|
349
|
+
struct O {
|
|
350
|
+
explicit O(int i_) : i(i_) {}
|
|
351
|
+
bool operator<(const O& other) const { return i < other.i; }
|
|
352
|
+
bool operator==(const O& other) const { return i == other.i; }
|
|
353
|
+
int i;
|
|
354
|
+
};
|
|
355
|
+
std::vector<int> v1 = {0, 1, 2, 3, 4};
|
|
356
|
+
std::vector<int> v2 = {0, 2, 4};
|
|
357
|
+
std::set<O> diff;
|
|
358
|
+
std::set_difference(
|
|
359
|
+
v1.begin(),
|
|
360
|
+
v1.end(),
|
|
361
|
+
v2.begin(),
|
|
362
|
+
v2.end(),
|
|
363
|
+
hint_emplacer(diff, diff.end()));
|
|
364
|
+
std::set<O> expected = {O(1), O(3)};
|
|
365
|
+
ASSERT_EQ(diff, expected);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Test std::copy() with explicit conversion. This would not compile with a
|
|
371
|
+
* std::back_insert_iterator, because the constructor of Object that takes a
|
|
372
|
+
* single int is explicit.
|
|
373
|
+
*/
|
|
374
|
+
TEST(EmplaceIterator, Copy) {
|
|
375
|
+
init_counters();
|
|
376
|
+
Container<int> in({0, 1, 2});
|
|
377
|
+
Container<Object> out;
|
|
378
|
+
std::copy(in.begin(), in.end(), back_emplacer(out));
|
|
379
|
+
EXPECT_EQ(3, out.size());
|
|
380
|
+
EXPECT_EQ(gDefaultCtrCnt, 0);
|
|
381
|
+
EXPECT_EQ(gCopyCtrCnt, 0);
|
|
382
|
+
EXPECT_EQ(gMoveCtrCnt, 0);
|
|
383
|
+
EXPECT_EQ(gExplicitCtrCnt, 3);
|
|
384
|
+
EXPECT_EQ(gMultiargCtrCnt, 0);
|
|
385
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
386
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
387
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Test std::transform() with multi-argument constructors. This would require
|
|
392
|
+
* a temporary Object with std::back_insert_iterator.
|
|
393
|
+
*/
|
|
394
|
+
TEST(EmplaceIterator, Transform) {
|
|
395
|
+
init_counters();
|
|
396
|
+
Container<int> in({0, 1, 2});
|
|
397
|
+
Container<Object> out;
|
|
398
|
+
std::transform(in.begin(), in.end(), back_emplacer(out), [](int i) {
|
|
399
|
+
return make_emplace_args(i, i);
|
|
400
|
+
});
|
|
401
|
+
EXPECT_EQ(3, out.size());
|
|
402
|
+
EXPECT_EQ(gDefaultCtrCnt, 0);
|
|
403
|
+
EXPECT_EQ(gCopyCtrCnt, 0);
|
|
404
|
+
EXPECT_EQ(gMoveCtrCnt, 0);
|
|
405
|
+
EXPECT_EQ(gExplicitCtrCnt, 0);
|
|
406
|
+
EXPECT_EQ(gMultiargCtrCnt, 3);
|
|
407
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
408
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
409
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Test multi-argument store and forward.
|
|
414
|
+
*/
|
|
415
|
+
TEST(EmplaceIterator, EmplaceArgs) {
|
|
416
|
+
Object o1;
|
|
417
|
+
const Object o2;
|
|
418
|
+
Object& o3 = o1;
|
|
419
|
+
const Object& o4 = o3;
|
|
420
|
+
Object o5;
|
|
421
|
+
|
|
422
|
+
{
|
|
423
|
+
// Test copy construction.
|
|
424
|
+
auto args = make_emplace_args(0, o1, o2, o3, o4, Object{}, std::cref(o2));
|
|
425
|
+
init_counters();
|
|
426
|
+
auto args2 = args;
|
|
427
|
+
EXPECT_EQ(gDefaultCtrCnt, 0);
|
|
428
|
+
EXPECT_EQ(gCopyCtrCnt, 5);
|
|
429
|
+
EXPECT_EQ(gMoveCtrCnt, 0);
|
|
430
|
+
EXPECT_EQ(gExplicitCtrCnt, 0);
|
|
431
|
+
EXPECT_EQ(gMultiargCtrCnt, 0);
|
|
432
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
433
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
434
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
435
|
+
|
|
436
|
+
// Test copy assignment.
|
|
437
|
+
init_counters();
|
|
438
|
+
args = args2;
|
|
439
|
+
EXPECT_EQ(gDefaultCtrCnt, 0);
|
|
440
|
+
EXPECT_EQ(gCopyCtrCnt, 0);
|
|
441
|
+
EXPECT_EQ(gMoveCtrCnt, 0);
|
|
442
|
+
EXPECT_EQ(gExplicitCtrCnt, 0);
|
|
443
|
+
EXPECT_EQ(gMultiargCtrCnt, 0);
|
|
444
|
+
EXPECT_EQ(gCopyOpCnt, 5);
|
|
445
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
446
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
{
|
|
450
|
+
// Test RVO.
|
|
451
|
+
init_counters();
|
|
452
|
+
auto args = make_emplace_args(
|
|
453
|
+
0, o1, o2, o3, o4, Object{}, std::cref(o2), rref(std::move(o5)));
|
|
454
|
+
EXPECT_EQ(gDefaultCtrCnt, 1);
|
|
455
|
+
EXPECT_EQ(gCopyCtrCnt, 4);
|
|
456
|
+
EXPECT_EQ(gMoveCtrCnt, 1);
|
|
457
|
+
EXPECT_EQ(gExplicitCtrCnt, 0);
|
|
458
|
+
EXPECT_EQ(gMultiargCtrCnt, 0);
|
|
459
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
460
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
461
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
462
|
+
|
|
463
|
+
// Test move construction.
|
|
464
|
+
init_counters();
|
|
465
|
+
auto args2 = std::move(args);
|
|
466
|
+
EXPECT_EQ(gDefaultCtrCnt, 0);
|
|
467
|
+
EXPECT_EQ(gCopyCtrCnt, 0);
|
|
468
|
+
EXPECT_EQ(gMoveCtrCnt, 5);
|
|
469
|
+
EXPECT_EQ(gExplicitCtrCnt, 0);
|
|
470
|
+
EXPECT_EQ(gMultiargCtrCnt, 0);
|
|
471
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
472
|
+
EXPECT_EQ(gMoveOpCnt, 0);
|
|
473
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
474
|
+
|
|
475
|
+
// Test move assignment.
|
|
476
|
+
init_counters();
|
|
477
|
+
args = std::move(args2);
|
|
478
|
+
EXPECT_EQ(gDefaultCtrCnt, 0);
|
|
479
|
+
EXPECT_EQ(gCopyCtrCnt, 0);
|
|
480
|
+
EXPECT_EQ(gMoveCtrCnt, 0);
|
|
481
|
+
EXPECT_EQ(gExplicitCtrCnt, 0);
|
|
482
|
+
EXPECT_EQ(gMultiargCtrCnt, 0);
|
|
483
|
+
EXPECT_EQ(gCopyOpCnt, 0);
|
|
484
|
+
EXPECT_EQ(gMoveOpCnt, 5);
|
|
485
|
+
EXPECT_EQ(gConvertOpCnt, 0);
|
|
486
|
+
|
|
487
|
+
// Make sure arguments are stored correctly. lvalues by reference, rvalues
|
|
488
|
+
// by (moved) copy. Rvalues cannot be stored by reference because they may
|
|
489
|
+
// refer to an expired temporary by the time they are accessed.
|
|
490
|
+
static_assert(
|
|
491
|
+
std::is_same<
|
|
492
|
+
int,
|
|
493
|
+
std::tuple_element_t<0, decltype(args)::storage_type>>::value,
|
|
494
|
+
"");
|
|
495
|
+
static_assert(
|
|
496
|
+
std::is_same<
|
|
497
|
+
Object,
|
|
498
|
+
std::tuple_element_t<1, decltype(args)::storage_type>>::value,
|
|
499
|
+
"");
|
|
500
|
+
static_assert(
|
|
501
|
+
std::is_same<
|
|
502
|
+
Object,
|
|
503
|
+
std::tuple_element_t<2, decltype(args)::storage_type>>::value,
|
|
504
|
+
"");
|
|
505
|
+
static_assert(
|
|
506
|
+
std::is_same<
|
|
507
|
+
Object,
|
|
508
|
+
std::tuple_element_t<3, decltype(args)::storage_type>>::value,
|
|
509
|
+
"");
|
|
510
|
+
static_assert(
|
|
511
|
+
std::is_same<
|
|
512
|
+
Object,
|
|
513
|
+
std::tuple_element_t<4, decltype(args)::storage_type>>::value,
|
|
514
|
+
"");
|
|
515
|
+
static_assert(
|
|
516
|
+
std::is_same<
|
|
517
|
+
Object,
|
|
518
|
+
std::tuple_element_t<5, decltype(args)::storage_type>>::value,
|
|
519
|
+
"");
|
|
520
|
+
static_assert(
|
|
521
|
+
std::is_same<
|
|
522
|
+
std::reference_wrapper<const Object>,
|
|
523
|
+
std::tuple_element_t<6, decltype(args)::storage_type>>::value,
|
|
524
|
+
"");
|
|
525
|
+
static_assert(
|
|
526
|
+
std::is_same<
|
|
527
|
+
rvalue_reference_wrapper<Object>,
|
|
528
|
+
std::tuple_element_t<7, decltype(args)::storage_type>>::value,
|
|
529
|
+
"");
|
|
530
|
+
|
|
531
|
+
// Check whether args.get() restores the original argument type for
|
|
532
|
+
// rvalue references to emplace_args.
|
|
533
|
+
static_assert(
|
|
534
|
+
std::is_same<int&&, decltype(get_emplace_arg<0>(std::move(args)))>::
|
|
535
|
+
value,
|
|
536
|
+
"");
|
|
537
|
+
static_assert(
|
|
538
|
+
std::is_same<Object&, decltype(get_emplace_arg<1>(std::move(args)))>::
|
|
539
|
+
value,
|
|
540
|
+
"");
|
|
541
|
+
static_assert(
|
|
542
|
+
std::is_same<
|
|
543
|
+
const Object&,
|
|
544
|
+
decltype(get_emplace_arg<2>(std::move(args)))>::value,
|
|
545
|
+
"");
|
|
546
|
+
static_assert(
|
|
547
|
+
std::is_same<Object&, decltype(get_emplace_arg<3>(std::move(args)))>::
|
|
548
|
+
value,
|
|
549
|
+
"");
|
|
550
|
+
static_assert(
|
|
551
|
+
std::is_same<
|
|
552
|
+
const Object&,
|
|
553
|
+
decltype(get_emplace_arg<4>(std::move(args)))>::value,
|
|
554
|
+
"");
|
|
555
|
+
static_assert(
|
|
556
|
+
std::is_same<Object&&, decltype(get_emplace_arg<5>(std::move(args)))>::
|
|
557
|
+
value,
|
|
558
|
+
"");
|
|
559
|
+
static_assert(
|
|
560
|
+
std::is_same<
|
|
561
|
+
const Object&,
|
|
562
|
+
decltype(get_emplace_arg<6>(std::move(args)))>::value,
|
|
563
|
+
"");
|
|
564
|
+
static_assert(
|
|
565
|
+
std::is_same<Object&&, decltype(get_emplace_arg<7>(std::move(args)))>::
|
|
566
|
+
value,
|
|
567
|
+
"");
|
|
568
|
+
|
|
569
|
+
// lvalue references to emplace_args should behave mostly like std::tuples.
|
|
570
|
+
// Note that get_emplace_arg<7>(args) does not compile, because
|
|
571
|
+
// folly::rvalue_reference_wrappers can only be unwrapped through an rvalue
|
|
572
|
+
// reference.
|
|
573
|
+
static_assert(
|
|
574
|
+
std::is_same<int&, decltype(get_emplace_arg<0>(args))>::value, "");
|
|
575
|
+
static_assert(
|
|
576
|
+
std::is_same<Object&, decltype(get_emplace_arg<1>(args))>::value, "");
|
|
577
|
+
static_assert(
|
|
578
|
+
std::is_same<Object&, decltype(get_emplace_arg<2>(args))>::value, "");
|
|
579
|
+
static_assert(
|
|
580
|
+
std::is_same<Object&, decltype(get_emplace_arg<3>(args))>::value, "");
|
|
581
|
+
static_assert(
|
|
582
|
+
std::is_same<Object&, decltype(get_emplace_arg<4>(args))>::value, "");
|
|
583
|
+
static_assert(
|
|
584
|
+
std::is_same<Object&, decltype(get_emplace_arg<5>(args))>::value, "");
|
|
585
|
+
static_assert(
|
|
586
|
+
std::is_same<const Object&, decltype(get_emplace_arg<6>(args))>::value,
|
|
587
|
+
"");
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Test implicit unpacking.
|
|
593
|
+
*/
|
|
594
|
+
TEST(EmplaceIterator, ImplicitUnpack) {
|
|
595
|
+
static std::size_t multiCtrCnt;
|
|
596
|
+
static std::size_t pairCtrCnt;
|
|
597
|
+
static std::size_t tupleCtrCnt;
|
|
598
|
+
|
|
599
|
+
struct Object2 {
|
|
600
|
+
Object2(int, int) { ++multiCtrCnt; }
|
|
601
|
+
explicit Object2(const std::pair<int, int>&) { ++pairCtrCnt; }
|
|
602
|
+
explicit Object2(const std::tuple<int, int>&) { ++tupleCtrCnt; }
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
auto test = [](auto&& it, bool expectUnpack) {
|
|
606
|
+
multiCtrCnt = pairCtrCnt = tupleCtrCnt = 0;
|
|
607
|
+
it = std::make_pair(0, 0);
|
|
608
|
+
it = std::make_tuple(0, 0);
|
|
609
|
+
if (expectUnpack) {
|
|
610
|
+
EXPECT_EQ(multiCtrCnt, 2);
|
|
611
|
+
EXPECT_EQ(pairCtrCnt, 0);
|
|
612
|
+
EXPECT_EQ(tupleCtrCnt, 0);
|
|
613
|
+
} else {
|
|
614
|
+
EXPECT_EQ(multiCtrCnt, 0);
|
|
615
|
+
EXPECT_EQ(pairCtrCnt, 1);
|
|
616
|
+
EXPECT_EQ(tupleCtrCnt, 1);
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
Container<Object2> q;
|
|
621
|
+
|
|
622
|
+
test(emplacer(q, q.begin()), true);
|
|
623
|
+
test(emplacer<false>(q, q.begin()), false);
|
|
624
|
+
test(front_emplacer(q), true);
|
|
625
|
+
test(front_emplacer<false>(q), false);
|
|
626
|
+
test(back_emplacer(q), true);
|
|
627
|
+
test(back_emplacer<false>(q), false);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// IndexIterator -------------
|
|
631
|
+
|
|
632
|
+
namespace index_iterator_type_tests {
|
|
633
|
+
namespace {
|
|
634
|
+
|
|
635
|
+
struct WeirdContainer {
|
|
636
|
+
std::vector<bool> body_;
|
|
637
|
+
|
|
638
|
+
using value_type = bool;
|
|
639
|
+
using size_type = std::uint32_t;
|
|
640
|
+
using difference_type = std::int32_t;
|
|
641
|
+
|
|
642
|
+
auto operator[](size_type idx) { return body_[idx]; }
|
|
643
|
+
auto operator[](size_type idx) const { return body_[idx]; }
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
// iterator concepts ------------------------
|
|
647
|
+
#if defined(__cpp_lib_concepts)
|
|
648
|
+
|
|
649
|
+
using vit = folly::index_iterator<std::vector<int>>;
|
|
650
|
+
using cvit = folly::index_iterator<const std::vector<int>>;
|
|
651
|
+
using vit_weird = folly::index_iterator<WeirdContainer>;
|
|
652
|
+
using cvit_weird = folly::index_iterator<const WeirdContainer>;
|
|
653
|
+
|
|
654
|
+
static_assert(std::random_access_iterator<vit>);
|
|
655
|
+
static_assert(std::random_access_iterator<cvit>);
|
|
656
|
+
static_assert(std::random_access_iterator<vit_weird>);
|
|
657
|
+
static_assert(std::random_access_iterator<cvit_weird>);
|
|
658
|
+
|
|
659
|
+
#endif
|
|
660
|
+
|
|
661
|
+
// dependent type computations ------------------------
|
|
662
|
+
struct ref_type {};
|
|
663
|
+
struct cref_type {};
|
|
664
|
+
|
|
665
|
+
struct just_operator {
|
|
666
|
+
using value_type = int;
|
|
667
|
+
ref_type operator[](std::size_t) { return {}; }
|
|
668
|
+
cref_type operator[](std::size_t) const { return {}; }
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
struct has_size_type : just_operator {
|
|
672
|
+
using size_type = std::uint32_t;
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
struct has_difference_type : just_operator {
|
|
676
|
+
using difference_type = std::int32_t;
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
struct has_both_size_and_difference_type : just_operator {
|
|
680
|
+
using size_type = std::uint32_t;
|
|
681
|
+
using difference_type = std::int32_t;
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
struct no_operator {
|
|
685
|
+
using value_type = int;
|
|
686
|
+
|
|
687
|
+
friend ref_type tag_invoke(
|
|
688
|
+
folly::cpo_t<index_iterator_access_at>, no_operator&, std::size_t) {
|
|
689
|
+
return {};
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
friend cref_type tag_invoke(
|
|
693
|
+
folly::cpo_t<index_iterator_access_at>, const no_operator&, std::size_t) {
|
|
694
|
+
return {};
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
[[maybe_unused]] int operator[](std::size_t);
|
|
698
|
+
[[maybe_unused]] int operator[](std::size_t) const;
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
struct no_operator_private {
|
|
702
|
+
using value_type = int;
|
|
703
|
+
|
|
704
|
+
private:
|
|
705
|
+
friend ref_type tag_invoke(
|
|
706
|
+
folly::cpo_t<index_iterator_access_at>,
|
|
707
|
+
no_operator_private&,
|
|
708
|
+
std::size_t) {
|
|
709
|
+
return {};
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
friend cref_type tag_invoke(
|
|
713
|
+
folly::cpo_t<index_iterator_access_at>,
|
|
714
|
+
const no_operator_private&,
|
|
715
|
+
std::size_t) {
|
|
716
|
+
return {};
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
template <typename T>
|
|
721
|
+
using all_types = std::tuple<
|
|
722
|
+
typename std::iterator_traits<folly::index_iterator<T>>::value_type,
|
|
723
|
+
typename std::iterator_traits<folly::index_iterator<T>>::reference,
|
|
724
|
+
typename std::iterator_traits<folly::index_iterator<T>>::difference_type,
|
|
725
|
+
typename folly::index_iterator<T>::size_type>;
|
|
726
|
+
|
|
727
|
+
// gives better error messages than std::is_same
|
|
728
|
+
template <typename T>
|
|
729
|
+
void is_same_test(T, T) {}
|
|
730
|
+
|
|
731
|
+
} // namespace
|
|
732
|
+
|
|
733
|
+
TEST(IndexIterator, Types) {
|
|
734
|
+
is_same_test(
|
|
735
|
+
all_types<just_operator>{},
|
|
736
|
+
std::tuple<int, ref_type, std::ptrdiff_t, std::size_t>{});
|
|
737
|
+
is_same_test(
|
|
738
|
+
all_types<const just_operator>{},
|
|
739
|
+
std::tuple<int, cref_type, std::ptrdiff_t, std::size_t>{});
|
|
740
|
+
is_same_test(
|
|
741
|
+
all_types<has_size_type>{},
|
|
742
|
+
std::tuple<int, ref_type, std::ptrdiff_t, std::uint32_t>{});
|
|
743
|
+
is_same_test(
|
|
744
|
+
all_types<const has_size_type>{},
|
|
745
|
+
std::tuple<int, cref_type, std::ptrdiff_t, std::uint32_t>{});
|
|
746
|
+
is_same_test(
|
|
747
|
+
all_types<has_difference_type>{},
|
|
748
|
+
std::tuple<int, ref_type, std::int32_t, std::size_t>{});
|
|
749
|
+
is_same_test(
|
|
750
|
+
all_types<const has_difference_type>{},
|
|
751
|
+
std::tuple<int, cref_type, std::int32_t, std::size_t>{});
|
|
752
|
+
is_same_test(
|
|
753
|
+
all_types<has_both_size_and_difference_type>{},
|
|
754
|
+
std::tuple<int, ref_type, std::int32_t, std::uint32_t>{});
|
|
755
|
+
is_same_test(
|
|
756
|
+
all_types<const has_both_size_and_difference_type>{},
|
|
757
|
+
std::tuple<int, cref_type, std::int32_t, std::uint32_t>{});
|
|
758
|
+
is_same_test(
|
|
759
|
+
all_types<no_operator>{},
|
|
760
|
+
std::tuple<int, ref_type, std::ptrdiff_t, std::size_t>{});
|
|
761
|
+
is_same_test(
|
|
762
|
+
all_types<const no_operator>{},
|
|
763
|
+
std::tuple<int, cref_type, std::ptrdiff_t, std::size_t>{});
|
|
764
|
+
is_same_test(
|
|
765
|
+
all_types<no_operator_private>{},
|
|
766
|
+
std::tuple<int, ref_type, std::ptrdiff_t, std::size_t>{});
|
|
767
|
+
is_same_test(
|
|
768
|
+
all_types<const no_operator_private>{},
|
|
769
|
+
std::tuple<int, cref_type, std::ptrdiff_t, std::size_t>{});
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
} // namespace index_iterator_type_tests
|
|
773
|
+
|
|
774
|
+
TEST(IndexIterator, Sort) {
|
|
775
|
+
std::vector<int> v(100, 0);
|
|
776
|
+
std::iota(v.rbegin(), v.rend(), 0);
|
|
777
|
+
|
|
778
|
+
std::sort(
|
|
779
|
+
index_iterator<std::vector<int>>{v, 0},
|
|
780
|
+
index_iterator<std::vector<int>>{v, v.size()});
|
|
781
|
+
|
|
782
|
+
std::vector<int> expected(100, 0);
|
|
783
|
+
std::iota(expected.begin(), expected.end(), 0);
|
|
784
|
+
ASSERT_EQ(expected, v);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
namespace {
|
|
788
|
+
|
|
789
|
+
constexpr bool accessTest() {
|
|
790
|
+
std::array<int, 2> a{0, 1};
|
|
791
|
+
const std::array<int, 2> b{0, 1};
|
|
792
|
+
|
|
793
|
+
const index_iterator<std::array<int, 2>> mutI{a, 0};
|
|
794
|
+
const index_iterator<const std::array<int, 2>> constI{b, 0};
|
|
795
|
+
|
|
796
|
+
if (*mutI != 0 || *constI != 0) {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
if (mutI[1] != 1 || constI[1] != 1) {
|
|
801
|
+
return false;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
return true;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
static_assert(accessTest());
|
|
808
|
+
|
|
809
|
+
template <typename I>
|
|
810
|
+
constexpr bool mutationsTest(I i0, I i1) {
|
|
811
|
+
auto tmp = i0;
|
|
812
|
+
if (++tmp != i1) {
|
|
813
|
+
return false;
|
|
814
|
+
}
|
|
815
|
+
tmp = i0;
|
|
816
|
+
if (tmp++ != i0) {
|
|
817
|
+
return false;
|
|
818
|
+
}
|
|
819
|
+
if (tmp != i1) {
|
|
820
|
+
return false;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
tmp = i1;
|
|
824
|
+
if (--tmp != i0) {
|
|
825
|
+
return false;
|
|
826
|
+
}
|
|
827
|
+
tmp = i1;
|
|
828
|
+
if (tmp-- != i1) {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
if (tmp != i0) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
return true;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
static constexpr std::array<int, 2> kA{0, 1};
|
|
839
|
+
|
|
840
|
+
static constexpr index_iterator<const std::array<int, 2>> kI0{kA, 0};
|
|
841
|
+
static constexpr index_iterator<const std::array<int, 2>> kI1{kA, 1};
|
|
842
|
+
|
|
843
|
+
static_assert(kI0 == kI0);
|
|
844
|
+
static_assert(kI0 != kI1);
|
|
845
|
+
static_assert(kI0 < kI1);
|
|
846
|
+
static_assert(kI0 <= kI0);
|
|
847
|
+
static_assert(kI0 <= kI1);
|
|
848
|
+
static_assert(kI1 >= kI1);
|
|
849
|
+
static_assert(kI1 >= kI0);
|
|
850
|
+
static_assert(kI1 > kI0);
|
|
851
|
+
|
|
852
|
+
static_assert(mutationsTest(kI0, kI1));
|
|
853
|
+
static_assert(kI0 + 1 == kI1);
|
|
854
|
+
static_assert(kI1 - 1 == kI0);
|
|
855
|
+
static_assert(kI1 - kI0 == 1);
|
|
856
|
+
static_assert(kI0 - kI1 == -1);
|
|
857
|
+
|
|
858
|
+
struct IndexedVector {
|
|
859
|
+
std::vector<int> v_;
|
|
860
|
+
|
|
861
|
+
std::pair<int, int&> operator[](std::size_t i) {
|
|
862
|
+
return {static_cast<int>(i), v_[i]};
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
std::pair<int, const int&> operator[](std::size_t i) const {
|
|
866
|
+
return {static_cast<int>(i), v_[i]};
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
using value_type = std::pair<int, int>;
|
|
870
|
+
|
|
871
|
+
using iterator = folly::index_iterator<IndexedVector>;
|
|
872
|
+
using const_iterator = folly::index_iterator<const IndexedVector>;
|
|
873
|
+
|
|
874
|
+
iterator begin() { return {*this, 0}; }
|
|
875
|
+
const_iterator begin() const { return cbegin(); }
|
|
876
|
+
const_iterator cbegin() const { return {*this, 0}; }
|
|
877
|
+
|
|
878
|
+
iterator end() { return {*this, v_.size()}; }
|
|
879
|
+
const_iterator end() const { return cend(); }
|
|
880
|
+
const_iterator cend() const { return {*this, v_.size()}; }
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
struct CustomMapWithIndexedIterator {
|
|
884
|
+
public:
|
|
885
|
+
using size_type = std::uint32_t;
|
|
886
|
+
using value_type = std::pair<int, int>;
|
|
887
|
+
|
|
888
|
+
public:
|
|
889
|
+
using iterator = folly::index_iterator<CustomMapWithIndexedIterator>;
|
|
890
|
+
using const_iterator =
|
|
891
|
+
folly::index_iterator<const CustomMapWithIndexedIterator>;
|
|
892
|
+
|
|
893
|
+
iterator begin() { return {*this, 0}; }
|
|
894
|
+
const_iterator cbegin() const { return {*this, 0}; }
|
|
895
|
+
|
|
896
|
+
std::vector<int> keys;
|
|
897
|
+
std::vector<int> values;
|
|
898
|
+
|
|
899
|
+
private:
|
|
900
|
+
friend std::pair<int, int> tag_invoke(
|
|
901
|
+
folly::cpo_t<index_iterator_access_at>,
|
|
902
|
+
const CustomMapWithIndexedIterator& self,
|
|
903
|
+
size_type idx) {
|
|
904
|
+
return {self.keys[idx], self.values[idx]};
|
|
905
|
+
}
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
} // namespace
|
|
909
|
+
|
|
910
|
+
TEST(IndexIterator, UseProxyReferences) {
|
|
911
|
+
IndexedVector iv{{0, 1, 2, 3}};
|
|
912
|
+
const IndexedVector& civ = iv;
|
|
913
|
+
|
|
914
|
+
using it = decltype(iv.begin());
|
|
915
|
+
using cit = decltype(civ.begin());
|
|
916
|
+
|
|
917
|
+
using it_ref_t = typename std::iterator_traits<it>::reference;
|
|
918
|
+
using it_cref_t = typename std::iterator_traits<cit>::reference;
|
|
919
|
+
|
|
920
|
+
static_assert(std::is_same<it_ref_t, std::pair<int, int&>>::value, "");
|
|
921
|
+
static_assert(std::is_same<it_cref_t, std::pair<int, const int&>>::value, "");
|
|
922
|
+
|
|
923
|
+
static_assert(std::is_same<decltype(it {} -> first), int>::value, "");
|
|
924
|
+
static_assert(std::is_same<decltype(it {} -> second), int&>::value, "");
|
|
925
|
+
static_assert(std::is_same<decltype(cit {} -> first), int>::value, "");
|
|
926
|
+
static_assert(
|
|
927
|
+
std::is_same<decltype(cit {} -> second), const int&>::value, "");
|
|
928
|
+
|
|
929
|
+
ASSERT_EQ(4, (std::count_if(civ.begin(), civ.end(), [](auto&& pair) {
|
|
930
|
+
return pair.first == pair.second;
|
|
931
|
+
})));
|
|
932
|
+
ASSERT_EQ(4, (std::count_if(iv.begin(), iv.end(), [](auto&& pair) {
|
|
933
|
+
return pair.first == pair.second;
|
|
934
|
+
})));
|
|
935
|
+
cit conversion = iv.begin() + 1;
|
|
936
|
+
ASSERT_EQ(&iv, conversion.get_container());
|
|
937
|
+
ASSERT_EQ(1, conversion.get_index());
|
|
938
|
+
|
|
939
|
+
static_assert(!std::is_convertible<cit, it>::value);
|
|
940
|
+
|
|
941
|
+
for (auto&& x : iv) {
|
|
942
|
+
x.second = -1;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
std::vector<int> expected{-1, -1, -1, -1};
|
|
946
|
+
ASSERT_EQ(expected, iv.v_);
|
|
947
|
+
|
|
948
|
+
// testing pointer proxies
|
|
949
|
+
for (auto f = iv.begin(); f != iv.end(); ++f) {
|
|
950
|
+
f->second = 1;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
expected = {1, 1, 1, 1};
|
|
954
|
+
ASSERT_EQ(expected, iv.v_);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
TEST(IndexIterator, OperatorArrowForNonProxies) {
|
|
958
|
+
using v_t = std::vector<std::array<int, 2>>;
|
|
959
|
+
using iterator = folly::index_iterator<v_t>;
|
|
960
|
+
|
|
961
|
+
static_assert(std::is_same<iterator::pointer, v_t::pointer>::value, "");
|
|
962
|
+
|
|
963
|
+
v_t v;
|
|
964
|
+
v.resize(3);
|
|
965
|
+
iterator f{v, 0};
|
|
966
|
+
iterator l{v, v.size()};
|
|
967
|
+
|
|
968
|
+
f->at(0) = 1;
|
|
969
|
+
(f + 1)->at(0) = 2;
|
|
970
|
+
(f + 2)->at(0) = 3;
|
|
971
|
+
|
|
972
|
+
v_t expected{{1, 0}, {2, 0}, {3, 0}};
|
|
973
|
+
|
|
974
|
+
ASSERT_EQ(expected, v);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
TEST(IndexIterator, NoOperatorIntegration) {
|
|
978
|
+
CustomMapWithIndexedIterator m{.keys{1, 2, 3}, .values{4, 5, 6}};
|
|
979
|
+
|
|
980
|
+
auto it = m.begin();
|
|
981
|
+
ASSERT_EQ((std::pair{1, 4}), it[0]);
|
|
982
|
+
ASSERT_EQ((std::pair{2, 5}), it[1]);
|
|
983
|
+
ASSERT_EQ((std::pair{3, 6}), it[2]);
|
|
984
|
+
|
|
985
|
+
auto cit = m.cbegin();
|
|
986
|
+
ASSERT_EQ((std::pair{1, 4}), cit[0]);
|
|
987
|
+
ASSERT_EQ((std::pair{2, 5}), cit[1]);
|
|
988
|
+
ASSERT_EQ((std::pair{3, 6}), cit[2]);
|
|
989
|
+
}
|