- improve voice chat smoothness

- fixed the position of the speaker indicator. constant aspect ratio added
- fixed voice chat functionality to work with the latest commits
- add support for cross compiling windows64 builds on linux
This commit is contained in:
haxi0 committed 2026-03-23 00:58:13 +03:00
1 parent 8be27511bb
commit 784242fcf7
1320 files changed
+361482 -116

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
{"manifestVersion":"1.1","info":{"id":"VisualStudio.17.Release/17.14.29+37111.16.-march.2026-","buildBranch":"d17.14","buildVersion":"17.14.37111.16","commitId":"7ab96268189f94fb2a5ce00bfd5d1c057c3cc348","communityOrLowerFlightId":"189ef7af9954446","localBuild":"build-lab","manifestName":"VisualStudio.17.Release","manifestType":"channel","productDisplayVersion":"17.14.29 (March 2026)","productLine":"Dev17","productLineVersion":"2022","productMilestone":"RTW","productMilestoneIsPreRelease":"False","productName":"Visual Studio","productPatchVersion":"29","productPreReleaseMilestoneSuffix":"1.0","productReleaseNameSuffix":"(March 2026)","productSemanticVersion":"17.14.29+37111.16.-march.2026-","professionalOrGreaterFlightId":"c259ff278e48463","qBuildSessionId":"097f4d2d-5d05-5c75-0ece-4bfec2da277d"},"channelItems":[{"id":"Microsoft.VisualStudio.Manifests.VisualStudio","version":"17.14.37111.16","type":"Manifest","payloads":[{"fileName":"VisualStudio.vsman","sha256":"0589fbd29209f6b10486b5b581f34a7972368b059f452d83a2defc5e45bd9cd1","size":30434000,"url":"https://download.visualstudio.microsoft.com/download/pr/83ec5fa2-d38d-43d5-9f58-31ea8e1c66e4/0589fbd29209f6b10486b5b581f34a7972368b059f452d83a2defc5e45bd9cd1/VisualStudio.vsman"}]},{"id":"Microsoft.VisualStudio.Product.BuildTools","version":"17.14.37111.16","type":"ChannelProduct","icon":{"mimeType":"image/svg+xml","base64":"PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9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ksMCwwLDEtMS0uM0w5LjksMTYuMiw2LjIsMTIsNCw5LjQsMS44LDYuOEExLjIwOCwxLjIwOCwwLDAsMCwuNCw2LjdsNC0zQTEuNDIzLDEuNDIzLDAsMCwxLDUsMy41YS45MDguOTA4LDAsMCwxLC43LjNsLjEuMUw5LjksNy44LDE0LjMsMTJsMy4yLDMuMS41LjUsNC4yLDQuMS4xLjFhLjkwOC45MDgsMCwwLDAsLjcuM1oiLz4NCiAgPHBhdGggY2xhc3M9ImNscy0yIiBkPSJNMjMuNiwxOS44bC02LDRjLS4xLDAtLjIuMS0uMy4xYS43NjIuNzYyLDAsMCwwLC4yLS40VjE1LjFsLjUuNSw0LjIsNC4xLjEuMWEuOTA4LjkwOCwwLDAsMCwuNy4zWiIvPg0KICA8cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0xNy41LjJhLjM2Ni4zNjYsMCwwLDAtLjMtLjEuNTE3LjUxNywwLDAsMSwuMi40VjguOWwuNi0uNSw0LjItNC4xLjEtLjFBMS40NDgsMS40NDgsMCwwLDEsMjMsNGExLjQyMywxLjQyMywwLDAsMSwuNi4yWiIvPg0KICA8cGF0aCBjbGFzcz0iY2xzLTUiIGQ9Ik0yNCw1VjE5YTEsMSwwLDAsMS0uNDQ1LjgzNWwtNiw0QTEsMSwwLDAsMCwxOCwyM1YxYTEuMDEsMS4wMSwwLDAsMC0uNDYtLjgzNWw2LjAxNSw0QTEuMDA5LDEuMDA5LDAsMCwxLDI0LDVaIi8+DQo8L3N2Zz4="},"isHidden":true,"releaseNotes":"https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.14#17.14.29","localizedResources":[{"language":"en-us","title":"Visual Studio Build Tools 2022","description":"The Visual Studio Build Tools allows you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support.","license":"https://go.microsoft.com/fwlink/?LinkId=2179911"},{"langLine truncated
"signature" : {
"signInfo" : {
"signatureMethod" : "sha256RSA_cng",
"digestMethod" : "sha256",
"digestValue" : "oZedSQOqouR9BVeJ+Twfg4o3Lc82LY5aba5ea6OGv9U=",
"canonicalization" : ""
},
"signatureValue" : "IGPzezmdAkSR4YMV+kWx+UDvhYkCiXroIIIswdbNg1nQEZqLx9GVL1HIZ/ghrBNtHQZRA5AeaIokOl6HhWq0gZPAkQeiOKgPciyzNI3uP2T7tgjo5CfKmt/nuC20VePMNI5HEZCERKj5EtXe0DLDhL46m/Jp6WS3zN/zdHCUphPOOiZ7EtHUx4cexeFE9DMmvKL+gZsRNih9Beqdktxglr6ZSU2fPIa+yjTmOjrrSkh33Acv17NAWwsdERr14oWqljeMQr+ghnpZXPqdyvasLAbc6m/WdX4xrG/jSiizFBvGRtms8nt1c+P2ymGpVUg9kJuMbigu5hbNd2tIp5Hoow==",
"keyInfo" : {
"keyValue" : {
"rsaKeyValue" : {
"modulus" : "7XpKjCg5837MnNU9UKR3xba/q5Iq/JXcyzypjF20Q6LlVwLLwX3ehPNrT4+GM2kpbhg0KF9zaTCqKCnlRY4zUat+8sk/4dUEyzAfHaZrGf+9FDPlP7GMb7dT1lsS4zDSF6swfD4xuoux9mBYJOGDoXxknpL581td3SwLX4w9MIsERD7wjZYpUc+16BXXuSjtNXhYlnrXoePKlDqlGgJCM5wuFwd7BXdS1lJrqVxytOUHyUpp3ovamSQWE7fGYQKxg4e50J/mNYzgN6AYglCeJ9QjGlnQ4a4HTLrtNuqFgG3wt6a6pFJ/C1qdvB/tki3rTRuSkGWcL8t2XJ+/j0BpeQ==",
"exponent" : "AQAB"
}
},
"x509Data" : [
"MIIGAzCCA+ugAwIBAgITMwAABISY4hLgeKMxXQAAAAAEhDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQgQ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Oi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDANBgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th542DYunKmCVgADsAW+iehp4LoJLine truncated
}
}
}
@@ -0,0 +1,35 @@
{"manifestVersion":"1.1","engineVersion":"3.14.2086.54749","info":{"id":"VisualStudio/17.14.29+37111.16.-march.2026-","buildBranch":"d17.14","buildVersion":"17.14.37111.16","localBuild":"build-lab","manifestName":"VisualStudio","manifestType":"installer","productDisplayVersion":"17.14.29 (March 2026)","productLine":"Dev17","productLineVersion":"2022","productMilestone":"RTW","productMilestoneIsPreRelease":"False","productName":"Visual Studio","productPatchVersion":"29","productPreReleaseMilestoneSuffix":"1.0","productReleaseNameSuffix":"(March 2026)","productSemanticVersion":"17.14.29+37111.16.-march.2026-"},"signers":[{"$id":"1","subjectName":"CN=Microsoft Corporation, OU=OPC, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"},{"$id":"2","subjectName":"CN=.NET, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"},{"$id":"3","subjectName":"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"},{"$id":"4","subjectName":"CN=Microsoft Corporation, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"},{"$id":"5","subjectName":"CN=Microsoft Windows Kits Publisher, OU=MOPR, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"},{"$id":"6","subjectName":"CN=Microsoft Windows Kits Publisher, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"},{"$id":"7","subjectName":"CN=\"PreEmptive Solutions, LLC.\", O=\"PreEmptive Solutions, LLC.\", STREET=767 Beta Drive, L=CLEVELAND, S=Ohio, PostalCode=44143, C=US"},{"$id":"8","subjectName":"CN=Unity Technologies SF, O=Unity Technologies SF, L=San Francisco, S=California, C=US"},{"$id":"9","subjectName":"CN=Johannes Schindelin, O=Johannes Schindelin, L=Köln, S=North Rhine-Westphalia, C=DE"},{"$id":"10","subjectName":"CN=Python Software Foundation, O=Python Software Foundation, L=Beaverton, S=Oregon, C=US"},{"$id":"11","subjectName":"CN=IncrediBuild Software Ltd., O=IncrediBuild Software Ltd., STREET=4 Ariel Sharon st, L=Givatayim, S=Tel Aviv, PostalCode=5300047, C=IL"},{"$id":"12","subjectName":"CN=Incredibuild Software Ltd., O=Incredibuild Software Ltd., S=Tel Aviv, C=IL"}],"packages":[{"id":"android","version":"35.0.78.0","type":"Component","ui":{"isAdvertisedPackage":false},"dependencies":{"microsoft.net.runtime.android.net8":{"version":"1.0.0.0","behaviors":"IgnoreApplicabilityFailures"},"microsoft.net.runtime.android.aot.net8":{"version":"1.0.0.0","behaviors":"IgnoreApplicabilityFailures"},"microsoft.net.runtime.android":{"version":"1.0.0.0","behaviors":"IgnoreApplicabilityFailures"},"microsoft.net.runtime.android.aot":{"version":"1.0.0.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Sdk.net9.35.0.78":{"version":"35.0.78.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Sdk.net8.34.0.154":{"version":"34.0.154.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Ref.35.35.0.78":{"version":"35.0.78.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Runtime.35.android-arm.35.0.78":{"version":"35.0.78.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Runtime.35.android-arm64.35.0.78":{"version":"35.0.78.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Runtime.35.android-x86.35.0.78":{"version":"35.0.78.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Runtime.35.android-x64.35.0.78":{"version":"35.0.78.0","behaviors":"IgnoreApplicabilityFailures"},"Microsoft.Android.Templates.35.0.78":{"version":"35.0.78.0","behaviors":"IgnoreApplicabilityFailures"}},"localizedResources":[{"language":"en-us","title":".NET SDK for Android","description":".NET SDK Workload for building Android applications.","category":".NET"}]},{"id":"Android.Manifest-9.0.100.35.0.78","version":"35.0.78","type":"Msi","machineArch":"arm64","payloads":[{"fileName":"d1465ced354bf01dc655904192b1a13d-arm64.msi","sha256":"c5e54476eaf8b80442ceade41bff57b738efa703ca93426d1114881b2e7549f1","size":471040,"url":"https://download.visualstudio.microsoft.com/download/pr/8ae0f5d5-a2ce-46e7-9a99-4964cd75313a/c5e54476eaf8b80442ceade41bff57b738efa703ca93426d1114881b2e7549f1/d1465ced354bf01dc655904192b1a13d-arm64.msi","signer":{"$ref":"3"}}],"msiProperties":{"MSIFASTINSTALL":"7","VSEXTUI":"1"},"productCode":"{9EA31988-2E1C-4472-B734-24915F0A52A8}","upgradeCode":"{919C9CA1-4108-3BE5-9214-6E20219AABF1}","productVersion":"35.0.78","productLanguage":1033,"providerKey":"Microsoft.NET.Sdk.Android,9.0.100,35.0.78,arm64","installSizes":{"systemDrive":9594},"logFiles":[{"pattern":"dd_setup*Android.Manifest-9.0.100.35.0.78*.log"}]},{"id":"Android.Manifest-9.0.100.35.0.78","version":"35.0.78","type":"Msi","machineArch":"x64","payloads":[{"fileName":"d1465ced354bf01dc655904192b1a13d-x64.msi","sha256":"c35fbefc00cb87b0b092a581899467a53ef3d76a66a754f0ffd80292f4dbfe5a","size":704512,"url":"https://download.visualstudio.microsoft.com/download/pr/8ae0f5d5-a2ce-46e7-9a99-4964cd75313a/c35fbefc00cb87b0b092a581899467a53ef3d76a66a754f0ffd80292f4dbfe5a/d1465ced354bf01dc655904192b1a13d-x64.msiLine truncated
"signature" : {
"signInfo" : {
"signatureMethod" : "sha256RSA_cng",
"digestMethod" : "sha256",
"digestValue" : "lTLInrsKeNcNyjh5dw95OUDLbeEEY8sxBi+J/etJXCo=",
"canonicalization" : ""
},
"signatureValue" : "HDwbEtbDUcXDxTehOmtjI61OF1nTQPqO9JfzcVtwCO2eXEn5SktGmnyDfVdrDo78aUevEVMTj3K1d2KGGIkTsglN3RV0zdJ6uMS5pmlwRvASlE+s9OHUz16DHuZNTZ/37k0TR37OwpHRsHzSRWdZ2DgAe1EQBVIWDmDF6wSzsv/AWUJcRunaUfsj7EfOdV+wbIsW9Vv0inS/DGDJ2fpwA+CsIQECzfxcbCqh6ku3ZYLSgDdXEALFEAhFSy1c69HuPZLbJ6JFEp90OTewoJPhr3PDtRIj9U0QYoVdCQa9rsjNK0DFNO6MoTrLl8VVnz/9iY/r9dgbW9QI3/R+OMW0lQ==",
"keyInfo" : {
"keyValue" : {
"rsaKeyValue" : {
"modulus" : "wEpIdXKb7lKn26sXpXuywkhxGplTQXxROLmNRZBrAHVBf7546RNXZwA/bzDqsuWTuPSC4T+I4j/z9j5/WqPuUw7SpnEPqWXc2xu7eN8kVyQt5170xkK6KHT4vVEkIvayPtIMLl0SgSCOy/pN5DJCi5ha7FlI84F1Qi2GumR+wQgCwHCVmU8Fj6Ik+B6akISXGCwe6X3rQFQngRFWQ/IrSkOkAOfy0EfvV+nZUo+FcbWuCZ6cb4Eq5I1ws/rZSeuwAWeedZcNt0VlNbsn4AnxBYQX4sj0dlko7JD5fWqeqq3/HzUNbBmLp9qeCXV8XlACn9YVWv900F47z04kVwpyTw==",
"exponent" : "AQAB"
}
},
"x509Data" : [
"MIIF9DCCA9ygAwIBAgITMwAABIVemewOWS/N1wAAAAAEhTANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgY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vbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkYLine truncated
}
}
}
@@ -0,0 +1,41 @@
//
// This is a GENERATED file. It should *not* be edited directly.
// Changes should be made to the defectdefs.xml file
// This file contains symbolic constants for warning numbers.
//
#pragma once
enum EConcurrencyCheckWarningCodes
{
WARNING_RACE_CONDITION = 26100, // Race condition. Variable '%1$s' should be protected by lock '%2$s'.
WARNING_INTERLOCKED_VIOLATION = 26101, // Failing to use interlocked operation properly for variable '%1$s'.
WARNING_RACE_CONDITION_VIA_PARAMETER = 26102, // Race condition through parameter access. Parameter '%1$s' is passed to a function and may be used to access variable '%2$s' which is guarded by lock '%3$s'. But this lock is not held and the callee does not guarantee to do so.
WARNING_LOCKORDER_ACQUIRE_VIOLATION = 26105, // Lock order violation. Acquiring lock '%1$s' with level %2$s causes order inversion.
WARNING_LOCKORDER_RELEASE_VIOLATION = 26106, // Lock order violation. Releasing lock '%1$s' with level %2$s causes order inversion.
WARNING_CALLER_FAILING_TO_HOLD = 26110, // Caller failing to hold lock '%1$s' before calling function '%2$s'.
WARNING_CALLER_FAILING_TO_RELEASE = 26111, // Caller failing to release lock '%1$s' before calling function '%2$s'.
WARNING_CALLER_CANNOT_HOLD_ANY_LOCK = 26112, // Caller cannot hold any lock before calling function '%1$s'.
WARNING_FAILING_TO_RELEASE = 26115, // Failing to release lock '%1$s' in function '%2$s'.
WARNING_FAILING_TO_ACQUIRE = 26116, // Failing to acquire or to hold lock '%1$s' in function '%2$s'.
WARNING_RELEASING_UNHELD_LOCK = 26117, // Releasing unheld lock '%1$s' in function '%2$s'.
WARNING_NEED_NO_COMPETING_THREAD = 26130, // Missing annotation _Requires_lock_held_(%1$s) or _No_competing_thread_ at function '%4$s'. Otherwise it could be a race condition. Variable '%2$s' should be protected by lock '%3$s'.
WARNING_OBJECT_MEMBER_LOCKED_ANNOTATION_MISMATCH = 26132, // Variable '%2$s' should be protected by '%3$s', but '%1$s' is held instead. Possible annotation mismatch.
WARNING_FUNCTION_MEMBER_LOCKED_ANNOTATION_MISMATCH = 26133, // Caller failing to hold lock '%1$s' before calling function '%2$s', but '%3$s' is held instead. Possible annotation mismatch.
WARNING_NEED_LOCKING_SIDE_EFFECT = 26135, // Missing annotation %1$s%2$s) at function '%3$s'.
WARNING_NEED_GUARDED_BY = 26136, // Missing _Guarded_by_ annotation: variable '%2$s' is guarded by lock '%1$s'.
WARNING_NEED_INTERLOCKED = 26137, // Missing annotation _Interlocked_ for variable %1$s.
WARNING_SUSPENDED_WITH_LOCK = 26138, // Suspending a coroutine while holding lock %1$s.
WARNING_CSAL_ANNOTATION_ERROR = 26140, // Undefined lock kind '%1$s' in annotation _Has_lock_kind_(%2$s) on lock '%3$s'.
WARNING_CALLER_FAILING_TO_HOLD_MEDIUM_CONFIDENCE = 26160, // Caller possibly failing to hold lock '%1$s' before calling function '%2$s'.
WARNING_FAILING_TO_RELEASE_MEDIUM_CONFIDENCE = 26165, // Possibly failing to release lock '%1$s' in function '%2$s'.
WARNING_FAILING_TO_ACQUIRE_MEDIUM_CONFIDENCE = 26166, // Possibly failing to acquire or to hold lock '%1$s' in function '%2$s'.
WARNING_RELEASING_UNHELD_LOCK_MEDIUM_CONFIDENCE = 26167, // Possibly releasing unheld lock '%1$s' in function '%2$s'.
};
#define ALL_CONCURRENCYCHECK_WARNINGS 26100 26101 26102 26105 26106 26110 26111 26112 26115 26116 26117 26130 26132 26133 26135 26136 26137 26138 26140 26160 26165 26166 26167
#define CONCURRENCYCHECK_DEFAULT_WARNINGS 26100 26101 26110 26111 26112 26115 26116 26117
#define CONCURRENCYCHECK_SECURITY_WARNINGS 26100 26101 26102 26105 26106 26110 26111 26112 26115 26116 26117 26130 26132 26133 26135 26136 26137 26160 26165 26166 26167
@@ -0,0 +1,172 @@
//
// This is a GENERATED file. It should *not* be edited directly.
// Changes should be made to the defectdefs.xml file
// This file contains symbolic constants for warning numbers.
//
#pragma once
enum ECppCoreCheckWarningCodes
{
WARNING_NO_RAW_POINTER_ASSIGNMENT = 26400, // Do not assign the result of an allocation or a function call with an owner<T> return value to a raw pointer, use owner<T> instead (i.11).
WARNING_DONT_DELETE_NON_OWNER = 26401, // Do not delete a raw pointer that is not an owner<T> (i.11).
WARNING_DONT_HEAP_ALLOCATE_MOVABLE_RESULT = 26402, // Return a scoped object instead of a heap-allocated if it has a move constructor (r.3).
WARNING_RESET_OR_DELETE_OWNER = 26403, // Reset or explicitly delete an owner<T> pointer '%1$s' (r.3).
WARNING_DONT_DELETE_INVALID = 26404, // Do not delete an owner<T> which may be in invalid state (r.3).
WARNING_DONT_ASSIGN_TO_VALID = 26405, // Do not assign to an owner<T> which may be in valid state (r.3).
WARNING_DONT_ASSIGN_RAW_TO_OWNER = 26406, // Do not assign a raw pointer to an owner<T> (r.3).
WARNING_DONT_HEAP_ALLOCATE_UNNECESSARILY = 26407, // Prefer scoped objects, don't heap-allocate unnecessarily (r.5).
WARNING_NO_MALLOC_FREE = 26408, // Avoid malloc() and free(), prefer the nothrow version of new with delete (r.10).
WARNING_NO_NEW_DELETE = 26409, // Avoid calling new and delete explicitly, use std::make_unique<T> instead (r.11).
WARNING_NO_REF_TO_CONST_UNIQUE_PTR = 26410, // The parameter '%1$s' is a reference to const unique pointer, use const T* or const T& instead (r.32).
WARNING_NO_REF_TO_UNIQUE_PTR = 26411, // The parameter '%1$s' is a reference to unique pointer and it is never reassigned or reset, use T* or T& instead (r.33).
WARNING_RESET_LOCAL_SMART_PTR = 26414, // Move, copy, reassign or reset a local smart pointer '%1$s' (r.5).
WARNING_SMART_PTR_NOT_NEEDED = 26415, // Smart pointer parameter '%1$s' is used only to access contained pointer. Use T* or T& instead (r.30).
WARNING_NO_RVALUE_REF_SHARED_PTR = 26416, // Shared pointer parameter '%1$s' is passed by rvalue reference. Pass by value instead (r.34).
WARNING_NO_LVALUE_REF_SHARED_PTR = 26417, // Shared pointer parameter '%1$s' is passed by reference and not reset or reassigned. Use T* or T& instead (r.35).
WARNING_NO_VALUE_OR_CONST_REF_SHARED_PTR = 26418, // Shared pointer parameter '%1$s' is not copied or moved. Use T* or T& instead (r.36).
WARNING_NO_GLOBAL_INIT_CALLS = 26426, // Global initializer calls a non-constexpr function '%1$s' (i.22).
WARNING_NO_GLOBAL_INIT_EXTERNS = 26427, // Global initializer accesses extern object '%1$s' (i.22).
WARNING_USE_NOTNULL = 26429, // Symbol '%1$s' is never tested for nullness, it can be marked as not_null (f.23).
WARNING_TEST_ON_ALL_PATHS = 26430, // Symbol '%1$s' is not tested for nullness on all paths (f.23).
WARNING_DONT_TEST_NOTNULL = 26431, // The type of expression '%1$s' is already gsl::not_null. Do not test it for nullness (f.23).
WARNING_DEFINE_OR_DELETE_SPECIAL_OPS = 26432, // If you define or delete any default operation in the type '%1$s', define or delete them all (c.21).
WARNING_NEED_VIRTUAL_DTOR = 26436, // The type '%1$s' with a virtual function needs either public virtual or protected non-virtual destructor (c.35).
WARNING_DONT_SLICE = 26437, // Do not slice (es.63).
WARNING_NO_GOTO = 26438, // Avoid 'goto' (es.76).
WARNING_SPECIAL_NOEXCEPT = 26439, // This kind of function should not throw. Declare it 'noexcept' (f.6).
WARNING_DECLARE_NOEXCEPT = 26440, // Function '%1$s' can be declared 'noexcept' (f.6).
WARNING_NO_UNNAMED_GUARDS = 26441, // Guard objects must be named (cp.44).
WARNING_NO_UNNAMED_RAII_OBJECTS = 26444, // Don't try to declare a local variable with no name (es.84).
WARNING_NO_SPAN_REF = 26445, // Do not assign gsl::span or std::string_view to a reference. They are cheap to construct and are not owners of the underlying data. (gsl.view).
WARNING_USE_GSL_AT = 26446, // Prefer to use gsl::at() instead of unchecked subscript operator (bounds.4).
WARNING_DONT_THROW_IN_NOEXCEPT = 26447, // The function is declared 'noexcept' but calls function '%1$s()' which may throw exceptions (f.6).
WARNING_USE_GSL_FINALLY = 26448, // Consider using gsl::finally if final action is intended (gsl.util).
WARNING_NO_SPAN_FROM_TEMPORARY = 26449, // gsl::span or std::string_view created from a temporary will be invalid when the temporary is invalidated (gsl.view).
WARNING_RESULT_OF_ARITHMETIC_OPERATION_PROVABLY_LOSSY = 26450, // Arithmetic overflow: '%1$s' operation causes overflow at compile time. Use a wider type to store the operands (io.1).
WARNING_RESULT_OF_ARITHMETIC_OPERATION_CAST_TO_LARGER_SIZE = 26451, // Arithmetic overflow: Using operator '%1$s' on a %2$d byte value and then casting the result to a %3$d byte value. Cast the value to the wider type before calling operator '%1$s' to avoid overflow (io.2).
WARNING_SHIFT_COUNT_NEGATIVE_OR_TOO_BIG = 26452, // Arithmetic overflow: Left shift count is negative or greater than or equal to the operand size which is undefined behavior (io.3).
WARNING_LEFTSHIFT_NEGATIVE_SIGNED_NUMBER = 26453, // Arithmetic overflow: Left shift of a negative signed number is undefined behavior (io.4).
WARNING_RESULT_OF_ARITHMETIC_OPERATION_NEGATIVE_UNSIGNED = 26454, // Arithmetic overflow: '%1$s' operation produces a negative unsigned result at compile time (io.5).
WARNING_DEFAULT_CTOR_NOEXCEPT = 26455, // Default constructor should not throw. Declare it 'noexcept' (f.6).
WARNING_USE_STD_IGNORE_INSTEAD_OF_VOID_CAST = 26457, // (void) should not be used to ignore return values, use 'std::ignore =' instead (es.48).
WARNING_PATH_SENSITIVE_USE_GSL_AT = 26458, // Prefer to use gsl::at() instead of unchecked subscript operator (bounds.4).
WARNING_NO_RAW_POINTER_IN_STL_RANGE_CHECKED = 26459, // You called an STL function '%s' with a raw pointer parameter at position '%d' that may be unsafe - this relies on the caller to check that the passed values are correct. Consider wrapping your range in a gsl::span and pass as a span iterator (stl.1).
WARNING_USE_CONST_REFERENCE_ARGUMENTS = 26460, // The reference argument '%s' for function '%s' can be marked as const (con.3).
WARNING_USE_CONST_POINTER_ARGUMENTS = 26461, // The pointer argument '%s' for function '%s' can be marked as a pointer to const (con.3).
WARNING_USE_CONST_POINTER_FOR_VARIABLE = 26462, // The value pointed to by '%1$s' is assigned only once, mark it as a pointer to const (con.4).
WARNING_USE_CONST_FOR_ELEMENTS = 26463, // The elements of array '%1$s' are assigned only once, mark elements const (con.4).
WARNING_USE_CONST_POINTER_FOR_ELEMENTS = 26464, // The values pointed to by elements of array '%1$s' are assigned only once, mark elements as pointer to const (con.4).
WARNING_NO_CONST_CAST_NECESSARY = 26465, // Don't use const_cast to cast away const or volatile. const_cast is not required; constness or volatility is not being removed by this conversion (type.3).
WARNING_NO_STATIC_DOWNCAST_POLYMORPHIC = 26466, // Don't use static_cast downcasts. A cast from a polymorphic type should use dynamic_cast (type.2).
WARNING_AVOID_CAST_FLOAT_TO_UNSIGNED_INTEGER = 26467, // Converting from floating point to unsigned integral types results in non-portable code if the double/float has a negative value. Use gsl::narrow_cast or gsl::narrow instead to guard against undefined behavior and potential data loss (es.46).
WARNING_NO_REINTERPRET_CAST_FROM_VOID_PTR = 26471, // Don't use reinterpret_cast. A cast from void* can use static_cast (type.1).
WARNING_NO_CASTS_FOR_ARITHMETIC_CONVERSION = 26472, // Don't use a static_cast for arithmetic conversions. Use brace initialization, gsl::narrow_cast or gsl::narrow (type.1).
WARNING_NO_IDENTITY_CAST = 26473, // Don't cast between pointer types where the source type and the target type are the same (type.1).
WARNING_NO_IMPLICIT_CAST = 26474, // Don't cast between pointer types when the conversion could be implicit (type.1).
WARNING_NO_FUNCTION_STYLE_CASTS = 26475, // Do not use function style casts (es.49). Prefer 'Type{value}' over 'Type(value)'..
WARNING_USE_VARIANT = 26476, // Expression/symbol '%s' uses a naked union '%s' with multiple type pointers: Use variant instead (type.7).
WARNING_USE_NULLPTR_NOT_CONSTANT = 26477, // Use 'nullptr' rather than 0 or NULL (es.47).
WARNING_NO_MOVE_OP_ON_CONST = 26478, // Don't use std::move on constant variables. (es.56).
WARNING_NO_MOVE_RET_ON_LOCALS = 26479, // Don't use std::move to return a local variable. (f.48).
WARNING_NO_POINTER_ARITHMETIC = 26481, // Don't use pointer arithmetic. Use span instead (bounds.1).
WARNING_NO_DYNAMIC_ARRAY_INDEXING = 26482, // Only index into arrays using constant expressions (bounds.2).
WARNING_STATIC_INDEX_OUT_OF_RANGE = 26483, // Value %1$lld is outside the bounds (0, %2$lld) of variable '%3$s'. Only index into arrays using constant expressions that are within bounds of the array (bounds.2).
WARNING_NO_ARRAY_TO_POINTER_DECAY = 26485, // Expression '%1$s': No array to pointer decay (bounds.3).
WARNING_LIFETIMES_FUNCTION_PRECONDITION_VIOLATION = 26486, // Don't pass a pointer that may be invalid to a function. Parameter %1$d '%2$s' in call to '%3$s' may be invalid (lifetime.3).
WARNING_LIFETIMES_FUNCTION_POSTCONDITION_VIOLATION = 26487, // Don't return a pointer '%1$s' that may be invalid (lifetime.4).
WARNING_LIFETIMES_DEREF_NULL_POINTER = 26488, // Do not dereference a potentially null pointer: '%1$s'. '%2$s' was null at line %3$u (lifetime.1).
WARNING_LIFETIMES_DEREF_INVALID_POINTER = 26489, // Don't dereference a pointer that may be invalid: '%1$s'. '%2$s' may have been invalidated at line %3$u (lifetime.1).
WARNING_NO_REINTERPRET_CAST = 26490, // Don't use reinterpret_cast (type.1).
WARNING_NO_STATIC_DOWNCAST = 26491, // Don't use static_cast downcasts (type.2).
WARNING_NO_CONST_CAST = 26492, // Don't use const_cast to cast away const or volatile (type.3).
WARNING_NO_CSTYLE_CAST = 26493, // Don't use C-style casts (type.4).
WARNING_VAR_USE_BEFORE_INIT = 26494, // Variable '%1$s' is uninitialized. Always initialize an object (type.5).
WARNING_MEMBER_UNINIT = 26495, // Variable '%1$s' is uninitialized. Always initialize a member variable (type.6).
WARNING_USE_CONST_FOR_VARIABLE = 26496, // The variable '%1$s' does not change after construction, mark it as const (con.4).
WARNING_USE_CONSTEXPR_FOR_FUNCTION = 26497, // You can attempt to make '%1$s' constexpr unless it contains any undefined behavior (f.4).
WARNING_USE_CONSTEXPR_FOR_FUNCTIONCALL = 26498, // The function '%1$s' is constexpr, mark variable '%2$s' constexpr if compile-time evaluation is desired (con.5).
WARNING_USE_OF_A_MOVED_FROM_OBJECT = 26800, // Use of a moved from object: ''%1$s'' (lifetime.1).
WARNING_COROUTINES_USE_AFTER_FREE_CAPTURE = 26810, // Lifetime of captured variable ''%1$s'' might end by the time the coroutine is resumed (lifetime.1).
WARNING_COROUTINES_USE_AFTER_FREE_PARAM = 26811, // Lifetime of the memory referenced by parameter ''%1$s'' might end by the time the coroutine is resumed (lifetime.1).
WARNING_USE_BITWISE_AND_TO_CHEK_ENUM_FLAGS = 26813, // Use 'bitwise and' to check if a flag is set.
WARNING_USE_CONSTEXPR_RATHER_THAN_CONST = 26814, // The const variable '%1$s' can be computed at compile-time. Consider using constexpr (con.5).
WARNING_LIFETIME_LOCAL_USE_AFTER_FREE_TEMP = 26815, // The pointer is dangling because it points at a temporary instance which was destroyed.
WARNING_LIFETIME_LOCAL_USE_AFTER_FREE_STACK = 26816, // The pointer points to memory allocated on the stack.
WARNING_RANGE_FOR_UNNECESSARY_COPY = 26817, // Potentially expensive copy of variable '%1$s' in range-for loop. Consider making it a const reference (es.71).
WARNING_NON_ENUM_SWITCH_MISSING_DEFAULT = 26818, // Switch statement does not cover all cases. Consider adding a 'default' label (es.79).
WARNING_UNANNOTATED_SWITCH_FALLTHROUGH = 26819, // Unannotated fallthrough between switch labels (es.78).
WARNING_CHANGE_AUTO_TO_REFERENCE = 26820, // This is a potentially expensive copy operation. Consider using a reference unless a copy is required (p.9).
WARNING_USE_GSL_SPAN_OVER_STD_SPAN = 26821, // For '%1$s', consider using gsl::span instead of std::span to guarantee runtime bounds safety (gsl.view).
WARNING_NULLPTR_DEREFERENCE = 26822, // Dereferencing a null pointer '%1$s' (lifetime.1).
WARNING_NULLPTR_DEREFERENCE_MAYBE = 26823, // Dereferencing a possibly null pointer '%1$s' (lifetime.1).
WARNING_NULLPTR_POSTCONDITION_VIOLATION = 26824, // Postcondition for null pointer '%1$s' requires it to be non-null (lifetime.1).
WARNING_NULLPTR_POSTCONDITION_VIOLATION_MAYBE = 26825, // Postcondition for possibly null pointer '%1$s' requires it to be non-null (lifetime.1).
WARNING_DONT_USE_VA_ARGS = 26826, // Don't use C-style variable arguments (f.55).
WARNING_ALMOST_BITWISE_ENUM = 26827, // Did you forget to initialize an enum constant, or intend to use another type?.
WARNING_MIXING_OVERLAPPING_ENUMS = 26828, // Different enum types have overlapping values. Did you want to use another enum constant here?.
WARNING_UNWRAP_EMPTY_OPTIONAL = 26829, // Empty optional ''%1$s'' is unwrapped.
WARNING_UNWRAP_EMPTY_OPTIONAL_MAYBE = 26830, // Potentially empty optional ''%1$s'' is unwrapped.
WARNING_DEAD_STORE = 26834, // Variable '%1$s' is assigned a value that is never read.
WARNING_DEAD_STORE_AT_DECLARATION = 26836, // Variable '%1$s' is assigned a value that is never read at declaration.
WARNING_LIFETIMES_FUNCTION_PRECONDITION_VIOLATION_HIGH_CONFIDENCE = 26846, // Don't pass an invalid pointer to a function. Parameter %1$d '%2$s' in call to '%3$s' is invalid (lifetime.3).
WARNING_LIFETIMES_FUNCTION_POSTCONDITION_VIOLATION_HIGH_CONFIDENCE = 26847, // Don't return an invalid pointer '%1$s' (lifetime.4).
WARNING_LIFETIMES_DEREF_NULL_POINTER_HIGH_CONFIDENCE = 26848, // Do not dereference a null pointer: '%1$s'. '%2$s' was null at line %3$u (lifetime.1).
WARNING_LIFETIMES_DEREF_INVALID_POINTER_HIGH_CONFIDENCE = 26849, // Don't dereference an invalid pointer: '%1$s'. '%2$s' have been invalidated at line %3$u (lifetime.1).
WARNING_DONT_ASSIGN_RAW_POINTER_TO_OWNER = 26850, // Do not assign a raw pointer '%2$s' to an owner<T> '%1$s' (ownership.1).
WARNING_SHOULD_MARK_AS_OWNER = 26851, // Variable '%1$s' has ownership on heap memory, should be marked as owner<T> (ownership.2).
WARNING_SHOULD_NOT_RESEAT_ACTIVE_OWNER = 26852, // Variable '%1$s' has ownership on heap memory already. Please transfer or free the owned memory first. (ownership.3).
WARNING_DONT_DELETE_RAW_POINTER = 26853, // Do not delete a raw pointer that is not an owner<T> (ownership.4).
WARNING_DONT_USE_INVALID_OWNER = 26854, // Transferring/freeing owner '%1$s' which has previously transferred ownership or points to garbage (ownership.5).
WARNING_RELEASE_OWNED_MEMORY = 26855, // Owner '%1$s' is going out of scope, please transfer its ownership or free its owned memory (ownership.6).
WARNING_DONT_ASSIGN_RAW_POINTER_TO_OWNER_PARAMETER = 26856, // Raw pointer '%1$s' is used as an owner argument (ownership.7).
WARNING_SHOULD_MARK_AS_OWNER_IN_FUNCTION_SIGNATURE = 26857, // Mark the raw pointers in the target function signature as owners if you expect to send or return heap allocated objects. (ownership.8).
WARNING_SHOULD_ACQUIRE_OWNERSHIP = 26858, // Expected owner pointer '%1$s' to have ownership at the end of the function (ownership.9).
WARNING_UNWRAP_EMPTY_OPTIONAL_VALUE = 26859, // Empty optional ''%1$s'' is unwrapped, will throw exception.
WARNING_UNWRAP_EMPTY_OPTIONAL_VALUE_MAYBE = 26860, // Potentially empty optional ''%1$s'' is unwrapped, may throw exception.
WARNING_DATETIME_MANIPULATION_WITHOHUT_LEAPYEAR_CHECK = 26861, // Field of a date-time object '%1$s' has been modified without proper leap year checking: '%2$s'.
WARNING_INCOMPLETE_DATETIME_CONVERSION = 26862, // A date-time object '%1$s' has been created from a different type of date-time object but conversion was incomplete: '%2$s'.
WARNING_DATETIME_MANIPULATION_FUNCTION_RETURN_IGNORED = 26863, // Return value from a date-time handling function '%1$s' is ignored.
WARNING_DATETIME_MANIPULATION_ASSUMING_365_DAYS_WITHOUT_LEAPYEAR_CHECK = 26864, // Day field of a date-time object '%1$s' has been modified assuming 365 days per year without proper leap year checking: '%2$s'.
};
#define ALL_CPPCORECHECK_WARNINGS 26400 26401 26402 26403 26404 26405 26406 26407 26408 26409 26410 26411 26414 26415 26416 26417 26418 26426 26427 26429 26430 26431 26432 26436 26437 26438 26439 26440 26441 26444 26445 26446 26447 26448 26449 26450 26451 26452 26453 26454 26455 26457 26458 26459 26460 26461 26462 26463 26464 26465 26466 26467 26471 26472 26473 26474 26475 26476 26477 26478 26479 26481 26482 26483 26485 26486 26487 26488 26489 26490 26491 26492 26493 26494 26495 26496 26497 26498 26800 26810 26811 26813 26814 26815 26816 26817 26818 26819 26820 26821 26822 26823 26824 26825 26826 26827 26828 26829 26830 26834 26836 26846 26847 26848 26849 26850 26851 26852 26853 26854 26855 26856 26857 26858 26859 26860 26861 26862 26863 26864
#define CPPCORECHECK_ARITHMETIC_WARNINGS 26450 26451 26452 26453 26454
#define CPPCORECHECK_BOUNDS_WARNINGS 26446 26458 26459 26481 26482 26483 26485
#define CPPCORECHECK_CLASS_WARNINGS 26432 26436
#define CPPCORECHECK_CONCURRENCY_WARNINGS 26441
#define CPPCORECHECK_CONST_WARNINGS 26460 26461 26462 26463 26464 26496 26497 26498 26814
#define CPPCORECHECK_DECLARATION_WARNINGS 26426 26427 26444 26817 26820
#define CPPCORECHECK_DEFAULT_WARNINGS 26437 26441 26444 26449 26450 26451 26452 26453 26454 26495
#define CPPCORECHECK_ENUM_WARNINGS 26813 26827 26828
#define CPPCORECHECK_FUNCTION_WARNINGS 26439 26440 26447 26455
#define CPPCORECHECK_GSL_WARNINGS 26445 26446 26448 26449 26458
#define CPPCORECHECK_LIFETIME_WARNINGS 26486 26487 26488 26489 26800 26810 26811 26815 26816 26822 26823 26824 26825 26846 26847 26848 26849
#define CPPCORECHECK_OWNER_POINTER_WARNINGS 26402 26403 26404 26405 26406 26407 26429 26430 26431
#define CPPCORECHECK_RAW_POINTER_WARNINGS 26400 26401 26402 26408 26409 26429 26430 26431 26481 26485
#define CPPCORECHECK_SECURITY_WARNINGS 26426 26427 26437 26441 26444 26449 26450 26451 26452 26453 26454 26459 26466 26471 26472 26475 26476 26481 26482 26483 26485 26486 26487 26489 26490 26491 26492 26493 26494 26495 26800 26810 26811 26846 26847 26849
#define CPPCORECHECK_SHARED_POINTER_WARNINGS 26414 26415 26416 26417 26418
#define CPPCORECHECK_STL_WARNINGS 26459
#define CPPCORECHECK_STYLE_WARNINGS 26438 26818 26819
#define CPPCORECHECK_TYPE_WARNINGS 26437 26465 26466 26467 26471 26472 26473 26474 26475 26476 26477 26478 26479 26490 26491 26492 26493 26494 26495 26826
#define CPPCORECHECK_UNIQUE_POINTER_WARNINGS 26410 26411 26414 26415
@@ -0,0 +1,16 @@
//
// This is a GENERATED file. It should *not* be edited directly.
// Changes should be made to the defectdefs.xml file
// This file contains symbolic constants for warning numbers.
//
#pragma once
enum EEnumIndexWarningCodes
{
WARNING_UNCHECKED_LOWER_BOUND_FOR_ENUMINDEX = 33010, // Unchecked lower bound for enum %1$s used as index..
WARNING_UNCHECKED_UPPER_BOUND_FOR_ENUMINDEX = 33011, // Unchecked upper bound for enum %1$s used as index..
};
#define ALL_ENUMINDEX_WARNINGS 33010 33011
@@ -0,0 +1,16 @@
//
// This is a GENERATED file. It should *not* be edited directly.
// Changes should be made to the defectdefs.xml file
// This file contains symbolic constants for warning numbers.
//
#pragma once
enum EHResultCheckWarningCodes
{
WARNING_HRESULT_LIKELY_INCORRECT_USAGE = 33020, // Likely incorrect HRESULT usage detected.
WARNING_HRESULT_USAGE_LOW_CONFIDENCE = 33022, // Potentially incorrect HRESULT usage detected (low confidence).
};
#define ALL_HRESULTCHECK_WARNINGS 33020 33022
@@ -0,0 +1,20 @@
//
// This is a GENERATED file. It should *not* be edited directly.
// Changes should be made to the defectdefs.xml file
// This file contains symbolic constants for warning numbers.
//
#pragma once
enum EVariantClearWarningCodes
{
WARNING_VARIANTCLEAR_UNINITIALIZED = 33001, // VARIANT '%1$s' was cleared when it was uninitialized (expression '%2$s').
WARNING_VARIANTCLEAR_MAYBEUNINITIALIZED = 33002, // VARIANT '%1$s' was cleared when it may be uninitialized (expression '%2$s').
WARNING_VARIANTCLEAR_LIKELYFALSEPOSITIVE = 33003, // VARIANT '%1$s' is considered uninitialized but this is likely a false positive. If this is an array you should ignore this warning. (expression '%2$s').
WARNING_VARIANTCLEAR_UNINITOUTPARAM = 33004, // VARIANT '%1$s', which is marked as _Out_ was cleared before being initialized (expression '%2$s').
WARNING_VARIANTCLEAR_UNINITFUNCPARAM = 33005, // VARIANT '%1$s' was provided as an _In_ or _InOut_ parameter but was not initialized (expression '%2$s').
WARNING_VARIANTCLEAR_NOSAL = 33006, // VARIANT '%1$s' was provided as a parameter without SAL and may have been cleared when it was not initialized. (expression '%2$s').
};
#define ALL_VARIANTCLEAR_WARNINGS 33001 33002 33003 33004 33005 33006
@@ -0,0 +1,5 @@
#pragma once
#ifndef ALL_CPPCORECHECK_WARNINGS
#define ALL_CPPCORECHECK_WARNINGS 26400 26401 26402 26403 26404 26405 26406 26407 26408 26409 26410 26411 26414 26415 26416 26417 26418 26426 26427 26429 26430 26431 26432 26436 26437 26438 26439 26440 26441 26444 26445 26446 26447 26448 26449 26450 26451 26452 26453 26454 26455 26457 26458 26459 26460 26461 26462 26463 26464 26465 26466 26467 26471 26472 26473 26474 26475 26476 26477 26478 26479 26481 26482 26483 26485 26486 26487 26488 26489 26490 26491 26492 26493 26494 26495 26496 26497 26498 26800 26810 26811 26813 26814 26815 26816 26817 26818 26819 26820 26821 26822 26823 26824 26825 26826 26827 26828 26829 26830 26834 26836 26846 26847 26848 26849 26850 26851 26852 26853 26854 26855 26856 26857 26858 26859 26860 26861 26862 26863 26864
#endif
#define ALL_CODE_ANALYSIS_WARNINGS 6001 6011 6014 6029 6030 6031 6053 6054 6059 6063 6064 6065 6066 6067 6101 6200 6201 6211 6214 6215 6216 6217 6219 6220 6221 6225 6226 6230 6235 6236 6237 6239 6240 6242 6244 6246 6248 6250 6255 6258 6259 6260 6262 6263 6268 6269 6270 6271 6272 6273 6274 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6302 6303 6305 6306 6308 6310 6312 6313 6314 6315 6316 6317 6318 6319 6320 6322 6323 6324 6326 6328 6329 6330 6331 6332 6333 6334 6335 6336 6340 6381 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6400 6401 6411 6412 6500 6501 6503 6504 6505 6506 6508 6509 6510 6511 6513 6514 6515 6516 6517 6518 6522 6525 6530 6540 6551 6552 6553 6701 6702 6703 6704 6705 6706 6707 6800 6801 6993 6997 26100 26101 26102 26105 26106 26110 26111 26112 26115 26116 26117 26130 26135 26136 26137 26138 26140 26160 26165 26166 26167 26433 26434 26435 26456 26812 26831 26832 26833 26834 26837 26838 26861 26862 26863 26864 28001 28002 28003 28004 28011 28012 28013 28014 28020 28021 28022 28023 28024 28039 28051 28052 28053 28103 28104 28105 28106 28107 28108 28109 28112 28113 28125 28137 28138 28159 28160 28163 28164 28182 28183 28191 28192 28193 28194 28195 28196 28197 28198 28199 28200 28201 28202 28203 28204 28205 28206 28207 28208 28209 28211 28212 28213 28214 28215 28216 28217 28218 28219 28220 28221 28222 28223 28224 28225 28226 28227 28228 28229 28230 28231 28232 28233 28234 28235 28236 28237 28238 28239 28240 28241 28242 28243 28244 28245 28246 28247 28248 28250 28251 28252 28253 28254 28262 28263 28267 28272 28273 28275 28276 28278 28279 28280 28281 28282 28283 28284 28285 28286 28287 28288 28289 28290 28291 28292 28293 28294 28295 28296 28297 28298 28299 28300 28301 28302 28303 28304 28305 28306 28307 28308 28309 28310 28311 28312 28313 28350 28351 28500 28504 33001 33004 33005 33010 33011 33020 33022 36503 36504 36505 36506 36509 36510 36515 36522 36526 36530 ALL_CPPCORECHECK_WARNINGS
@@ -0,0 +1,462 @@
/***
*SourceAnnotations.h - Source Annotation definitions
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* Defines internal structures used by the Source Code analysis engine.
*
****/
#pragma once
#ifndef _M_CEE_SAFE
#ifndef _SIZE_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 size_t;
#else /* _WIN64 */
typedef unsigned int size_t;
#endif /* _WIN64 */
#define _SIZE_T_DEFINED
#endif /* _SIZE_T_DEFINED */
#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif /* _WCHAR_T_DEFINED */
#pragma push_macro( "SA" )
#pragma push_macro( "REPEATABLE" )
#ifdef __cplusplus
#define SA( id ) id
#define REPEATABLE [repeatable]
#else /* __cplusplus */
#define SA( id ) SA_##id
#define REPEATABLE
#endif /* __cplusplus */
#ifdef __cplusplus
namespace vc_attributes
{
#endif /* __cplusplus */
enum SA( YesNoMaybe )
{
// Choose values that we can detect as invalid if they are or'd together
SA( No ) = 0x0fff0001,
SA( Maybe ) = 0x0fff0010,
SA( Yes ) = 0x0fff0100
};
typedef enum SA( YesNoMaybe ) SA( YesNoMaybe );
enum SA( AccessType )
{
SA( NoAccess ) = 0,
SA( Read ) = 1,
SA( Write ) = 2,
SA( ReadWrite ) = 3
};
typedef enum SA( AccessType ) SA( AccessType );
#ifndef SAL_NO_ATTRIBUTE_DECLARATIONS
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct PreAttribute
{
#ifdef __cplusplus
PreAttribute();
#endif /* __cplusplus */
unsigned int Deref;
SA( YesNoMaybe ) Valid;
SA( YesNoMaybe ) Null;
SA( YesNoMaybe ) Tainted;
SA( AccessType ) Access;
unsigned int Notref;
size_t ValidElementsConst;
size_t ValidBytesConst;
const wchar_t* ValidElements;
const wchar_t* ValidBytes;
const wchar_t* ValidElementsLength;
const wchar_t* ValidBytesLength;
size_t WritableElementsConst;
size_t WritableBytesConst;
const wchar_t* WritableElements;
const wchar_t* WritableBytes;
const wchar_t* WritableElementsLength;
const wchar_t* WritableBytesLength;
size_t ElementSizeConst;
const wchar_t* ElementSize;
SA( YesNoMaybe ) NullTerminated;
const wchar_t* Condition;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct PostAttribute
{
#ifdef __cplusplus
PostAttribute();
#endif /* __cplusplus */
unsigned int Deref;
SA( YesNoMaybe ) Valid;
SA( YesNoMaybe ) Null;
SA( YesNoMaybe ) Tainted;
SA( AccessType ) Access;
unsigned int Notref;
size_t ValidElementsConst;
size_t ValidBytesConst;
const wchar_t* ValidElements;
const wchar_t* ValidBytes;
const wchar_t* ValidElementsLength;
const wchar_t* ValidBytesLength;
size_t WritableElementsConst;
size_t WritableBytesConst;
const wchar_t* WritableElements;
const wchar_t* WritableBytes;
const wchar_t* WritableElementsLength;
const wchar_t* WritableBytesLength;
size_t ElementSizeConst;
const wchar_t* ElementSize;
SA( YesNoMaybe ) NullTerminated;
SA( YesNoMaybe ) MustCheck;
const wchar_t* Condition;
};
[source_annotation_attribute( SA( All ) )]
struct FormatStringAttribute
{
#ifdef __cplusplus
FormatStringAttribute();
#endif /* __cplusplus */
const wchar_t* Style;
const wchar_t* UnformattedAlternative;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct InvalidCheckAttribute
{
#ifdef __cplusplus
InvalidCheckAttribute();
#endif /* __cplusplus */
long Value;
};
[source_annotation_attribute( SA( All ) )]
struct SuccessAttribute
{
#ifdef __cplusplus
SuccessAttribute();
#endif /* __cplusplus */
const wchar_t* Condition;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct PreBoundAttribute
{
#ifdef __cplusplus
PreBoundAttribute();
#endif /* __cplusplus */
unsigned int Deref;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct PostBoundAttribute
{
#ifdef __cplusplus
PostBoundAttribute();
#endif /* __cplusplus */
unsigned int Deref;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct PreRangeAttribute
{
#ifdef __cplusplus
PreRangeAttribute();
#endif /* __cplusplus */
unsigned int Deref;
const char* MinVal;
const char* MaxVal;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct PostRangeAttribute
{
#ifdef __cplusplus
PostRangeAttribute();
#endif /* __cplusplus */
unsigned int Deref;
const char* MinVal;
const char* MaxVal;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct DerefAttribute
{
#ifdef __cplusplus
DerefAttribute();
#endif /* __cplusplus */
int unused;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct NotrefAttribute
{
#ifdef __cplusplus
NotrefAttribute();
#endif /* __cplusplus */
int unused;
};
REPEATABLE
[source_annotation_attribute( SA( All ) )]
struct AnnotesAttribute
{
#ifdef __cplusplus
AnnotesAttribute();
#endif /* __cplusplus */
wchar_t *Name;
wchar_t *p1;
wchar_t *p2;
wchar_t *p3;
wchar_t *p4;
wchar_t *p5;
wchar_t *p6;
wchar_t *p7;
wchar_t *p8;
wchar_t *p9;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct AtAttribute
{
#ifdef __cplusplus
AtAttribute();
#endif /* __cplusplus */
wchar_t *p1;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct AtBufferAttribute
{
#ifdef __cplusplus
AtBufferAttribute();
#endif /* __cplusplus */
wchar_t *p1;
wchar_t *p2;
wchar_t *p3;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct WhenAttribute
{
#ifdef __cplusplus
WhenAttribute();
#endif /* __cplusplus */
wchar_t *p1;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct TypefixAttribute
{
#ifdef __cplusplus
TypefixAttribute();
#endif /* __cplusplus */
wchar_t *p1;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct ContextAttribute
{
#ifdef __cplusplus
ContextAttribute();
#endif /* __cplusplus */
wchar_t *p1;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct ExceptAttribute
{
#ifdef __cplusplus
ExceptAttribute();
#endif /* __cplusplus */
int unused;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct PreOpAttribute
{
#ifdef __cplusplus
PreOpAttribute();
#endif /* __cplusplus */
int unused;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct PostOpAttribute
{
#ifdef __cplusplus
PostOpAttribute();
#endif /* __cplusplus */
int unused;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct BeginAttribute
{
#ifdef __cplusplus
BeginAttribute();
#endif /* __cplusplus */
int unused;
};
[source_annotation_attribute( SA( All ) )]
REPEATABLE
struct EndAttribute
{
#ifdef __cplusplus
EndAttribute();
#endif /* __cplusplus */
int unused;
};
#endif /* SAL_NO_ATTRIBUTE_DECLARATIONS */
#ifdef __cplusplus
}; // namespace vc_attributes
#endif /* __cplusplus */
#pragma pop_macro( "REPEATABLE" )
#pragma pop_macro( "SA" )
#ifdef __cplusplus
#define SA_All All
#define SA_Class Class
#define SA_Constructor Constructor
#define SA_Delegate Delegate
#define SA_Enum Enum
#define SA_Event Event
#define SA_Field Field
#define SA_GenericParameter GenericParameter
#define SA_Interface Interface
#define SA_Method Method
#define SA_Module Module
#define SA_Parameter Parameter
#define SA_Property Property
#define SA_ReturnValue ReturnValue
#define SA_Struct Struct
#define SA_Typedef Typedef
typedef ::vc_attributes::YesNoMaybe SA_YesNoMaybe;
const ::vc_attributes::YesNoMaybe SA_Yes = ::vc_attributes::Yes;
const ::vc_attributes::YesNoMaybe SA_No = ::vc_attributes::No;
const ::vc_attributes::YesNoMaybe SA_Maybe = ::vc_attributes::Maybe;
typedef ::vc_attributes::AccessType SA_AccessType;
const ::vc_attributes::AccessType SA_NoAccess = ::vc_attributes::NoAccess;
const ::vc_attributes::AccessType SA_Read = ::vc_attributes::Read;
const ::vc_attributes::AccessType SA_Write = ::vc_attributes::Write;
const ::vc_attributes::AccessType SA_ReadWrite = ::vc_attributes::ReadWrite;
#ifndef SAL_NO_ATTRIBUTE_DECLARATIONS
typedef ::vc_attributes::PreAttribute SA_Pre;
typedef ::vc_attributes::PostAttribute SA_Post;
typedef ::vc_attributes::FormatStringAttribute SA_FormatString;
typedef ::vc_attributes::InvalidCheckAttribute SA_InvalidCheck; /*???*/
typedef ::vc_attributes::SuccessAttribute SA_Success;
typedef ::vc_attributes::PreBoundAttribute SA_PreBound;
typedef ::vc_attributes::PostBoundAttribute SA_PostBound;
typedef ::vc_attributes::PreRangeAttribute SA_PreRange;
typedef ::vc_attributes::PostRangeAttribute SA_PostRange;
typedef ::vc_attributes::DerefAttribute SAL_deref;
typedef ::vc_attributes::NotrefAttribute SAL_notref;
typedef ::vc_attributes::PreOpAttribute SAL_pre;
typedef ::vc_attributes::PostOpAttribute SAL_post;
typedef ::vc_attributes::ExceptAttribute SAL_except;
typedef ::vc_attributes::AtAttribute SAL_at;
typedef ::vc_attributes::AtBufferAttribute SAL_at_buffer;
typedef ::vc_attributes::WhenAttribute SAL_when;
typedef ::vc_attributes::BeginAttribute SAL_begin;
typedef ::vc_attributes::EndAttribute SAL_end;
typedef ::vc_attributes::TypefixAttribute SAL_typefix;
typedef ::vc_attributes::AnnotesAttribute SAL_annotes;
typedef ::vc_attributes::ContextAttribute SAL_context;
#endif /* SAL_NO_ATTRIBUTE_DECLARATIONS */
#else /* __cplusplus */
typedef struct PreAttribute SA_Pre;
typedef struct PreAttribute PreAttribute;
typedef struct PostAttribute SA_Post;
typedef struct PostAttribute PostAttribute;
typedef struct FormatStringAttribute SA_FormatString;
typedef struct InvalidCheckAttribute SA_InvalidCheck; /*???*/
typedef struct SuccessAttribute SA_Success;
typedef struct PreBoundAttribute SA_PreBound;
typedef struct PostBoundAttribute SA_PostBound;
typedef struct PreRangeAttribute SA_PreRange;
typedef struct PostRangeAttribute SA_PostRange;
typedef struct DerefAttribute SAL_deref;
typedef struct NotrefAttribute SAL_notref;
typedef struct PreOpAttribute SAL_pre;
typedef struct PostOpAttribute SAL_post;
typedef struct ExceptAttribute SAL_except;
typedef struct AtAttribute SAL_at;
typedef struct AtBufferAttribute SAL_at_buffer;
typedef struct WhenAttribute SAL_when;
typedef struct BeginAttribute SAL_begin;
typedef struct EndAttribute SAL_end;
typedef struct TypefixAttribute SAL_typefix;
typedef struct AnnotesAttribute SAL_annotes;
typedef struct ContextAttribute SAL_context;
#endif /* __cplusplus */
#endif /* _M_CEE_SAFE */
#ifdef _MANAGED
#ifdef CODE_ANALYSIS
#define SA_SUPPRESS_MESSAGE( category, id, ... ) [::System::Diagnostics::CodeAnalysis::SuppressMessage( category, id, __VA_ARGS__ )]
#define CA_SUPPRESS_MESSAGE( ... ) [System::Diagnostics::CodeAnalysis::SuppressMessage( __VA_ARGS__ )]
#define CA_GLOBAL_SUPPRESS_MESSAGE( ... ) [assembly:System::Diagnostics::CodeAnalysis::SuppressMessage( __VA_ARGS__ )]
#else /* CODE_ANALYSIS */
#define SA_SUPPRESS_MESSAGE( category, id, ... )
#define CA_SUPPRESS_MESSAGE( ... )
#define CA_GLOBAL_SUPPRESS_MESSAGE( ... )
#endif /* CODE_ANALYSIS */
#endif /* _MANAGED */
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
</windowsSettings>
</application>
</assembly>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
</assembly>
@@ -0,0 +1,230 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// This file is intended as a test resource for tools that want to verify that they can parse all MSVC standard
// library headers without warnings. This file disables deprecations, so it should not be included in programs directly.
//
// This file may be changed, renamed, or removed at any time.
#ifndef __MSVC_ALL_PUBLIC_HEADERS_HPP
#define __MSVC_ALL_PUBLIC_HEADERS_HPP
#pragma warning(push)
#pragma warning(1 : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
// All STL headers should protect themselves from macroized new.
#if !(defined(__CUDACC__) && defined(__clang__))
#pragma push_macro("new")
#undef new
#define new WILL NOT COMPILE
#endif // !(defined(__CUDACC__) && defined(__clang__))
// VSO-768746: mbctype.h macroizes _MS, _MP, _M1, and _M2. Include it first for test coverage.
#ifndef _MSVC_TESTING_NVCC
#include <mbctype.h>
#endif // !defined(_MSVC_TESTING_NVCC)
#ifndef _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#endif // !defined(_SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING)
#define _SILENCE_CXX20_CISO646_REMOVED_WARNING
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
// Core STL Headers
#include <bit>
#include <compare>
#include <concepts>
#include <coroutine>
#include <initializer_list>
#include <limits>
#include <numbers>
#include <ratio>
#include <source_location>
#include <stdfloat>
#include <tuple>
#include <type_traits>
#include <utility>
#include <version>
// Core C Wrapper Headers
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfenv>
#include <cfloat>
#include <cinttypes>
#include <climits>
#include <clocale>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cuchar>
#include <cwchar>
#include <cwctype>
#ifndef _CORE_HEADERS_ONLY
// Non-Core STL Headers
#include <algorithm>
#include <any>
#include <array>
#include <bitset>
#include <charconv>
#include <chrono>
#include <codecvt>
#include <complex>
#include <deque>
#include <exception>
#include <expected>
#include <filesystem>
#include <format>
#include <forward_list>
#include <fstream>
#include <functional>
#include <generator>
#include <hash_map>
#include <hash_set>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <list>
#include <locale>
#include <map>
#include <mdspan>
#include <memory>
#include <memory_resource>
#include <new>
#include <numeric>
#include <optional>
#include <ostream>
#include <print>
#include <queue>
#include <random>
#include <ranges>
#include <regex>
#include <scoped_allocator>
#include <set>
#include <span>
#include <spanstream>
#include <sstream>
#include <stack>
#include <stacktrace>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <string_view>
#include <strstream>
#include <syncstream>
#include <system_error>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <valarray>
#include <variant>
#include <vector>
#ifndef _M_CEE_PURE
#include <__msvc_cxx_stdatomic.hpp>
#include <atomic>
#include <barrier>
#include <condition_variable>
#include <execution>
#include <future>
#include <latch>
#include <mutex>
#include <semaphore>
#include <shared_mutex>
#include <stop_token>
#include <thread>
#endif // !defined(_M_CEE_PURE)
// Non-Core C Wrapper Headers
#include <ccomplex>
#include <ciso646>
#include <cmath>
#include <cstdalign>
#include <cstdbool>
#include <ctgmath>
// Non-Core Experimental Headers
#include <experimental/filesystem>
#endif // !defined(_CORE_HEADERS_ONLY)
#ifndef _MSVC_TESTING_NVCC
#include <assert.h>
#include <conio.h>
#include <crtdbg.h>
#include <ctype.h>
#include <direct.h>
#include <dos.h>
#include <errno.h>
#include <excpt.h>
#include <fcntl.h>
#include <fenv.h>
#include <float.h>
#include <intrin.h>
#include <inttypes.h>
#include <io.h>
#include <iso646.h>
#include <limits.h>
#include <locale.h>
#include <malloc.h>
#include <math.h>
#include <mbstring.h>
#include <memory.h>
#include <minmax.h>
#include <process.h>
#include <safeint.h>
#include <sal.h>
#include <search.h>
#include <setjmp.h>
#include <share.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/locking.h>
#include <sys/stat.h>
#include <sys/timeb.h>
#include <sys/types.h>
#include <sys/utime.h>
#include <tchar.h>
#include <time.h>
#include <uchar.h>
#include <wchar.h>
#include <wctype.h>
#ifndef _CORE_HEADERS_ONLY
#include <complex.h>
#include <new.h>
#endif // !defined(_CORE_HEADERS_ONLY)
#ifndef _M_CEE_PURE
#include <fpieee.h>
#endif // !defined(_M_CEE_PURE)
#endif // !defined(_MSVC_TESTING_NVCC)
#if !(defined(__CUDACC__) && defined(__clang__))
#pragma pop_macro("new")
#endif // !(defined(__CUDACC__) && defined(__clang__))
#pragma warning(pop)
#endif // __MSVC_ALL_PUBLIC_HEADERS_HPP
@@ -0,0 +1,398 @@
// __msvc_bit_utils.hpp internal header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_BIT_UTILS_HPP
#define __MSVC_BIT_UTILS_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <climits>
#include <xtr1common>
#include _STL_INTRIN_HEADER
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
extern "C" {
extern int __isa_available;
}
_INLINE_VAR constexpr int _Stl_isa_available_sse42 = 2; // equal to __ISA_AVAILABLE_SSE42
_INLINE_VAR constexpr int _Stl_isa_available_avx2 = 5; // equal to __ISA_AVAILABLE_AVX2
template <class _UInt>
constexpr int _Unsigned_integer_digits = sizeof(_UInt) * CHAR_BIT;
// Implementation of countl_zero without using specialized CPU instructions.
// Used at compile time and when said instructions are not supported.
// see "Hacker's Delight" section 5-3
template <class _Ty>
_NODISCARD constexpr int _Countl_zero_fallback(_Ty _Val) noexcept {
_Ty _Yx = 0;
unsigned int _Nx = _Unsigned_integer_digits<_Ty>;
unsigned int _Cx = _Unsigned_integer_digits<_Ty> / 2;
do {
_Yx = static_cast<_Ty>(_Val >> _Cx);
if (_Yx != 0) {
_Nx -= _Cx;
_Val = _Yx;
}
_Cx >>= 1;
} while (_Cx != 0);
return static_cast<int>(_Nx) - static_cast<int>(_Val);
}
#if !defined(_M_CEE_PURE) && !defined(__CUDACC__)
#define _HAS_COUNTL_ZERO_INTRINSICS 1
#else // ^^^ intrinsics available / intrinsics unavailable vvv
#define _HAS_COUNTL_ZERO_INTRINSICS 0
#endif // ^^^ intrinsics unavailable ^^^
#if _HAS_COUNTL_ZERO_INTRINSICS
#if (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC))
template <class _Ty>
_NODISCARD int _Countl_zero_lzcnt(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
if constexpr (_Digits <= 16) {
return static_cast<int>(__lzcnt16(_Val) - (16 - _Digits));
} else if constexpr (_Digits == 32) {
return static_cast<int>(__lzcnt(_Val));
} else {
#ifdef _M_IX86
const unsigned int _High = _Val >> 32;
const auto _Low = static_cast<unsigned int>(_Val);
if (_High == 0) {
return 32 + _Countl_zero_lzcnt(_Low);
} else {
return _Countl_zero_lzcnt(_High);
}
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
return static_cast<int>(__lzcnt64(_Val));
#endif // ^^^ !defined(_M_IX86) ^^^
}
}
template <class _Ty>
_NODISCARD int _Countl_zero_bsr(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
unsigned long _Result;
if constexpr (_Digits <= 32) {
if (!_BitScanReverse(&_Result, _Val)) {
return _Digits;
}
} else {
#ifdef _M_IX86
const unsigned int _High = _Val >> 32;
if (_BitScanReverse(&_Result, _High)) {
return static_cast<int>(31 - _Result);
}
const auto _Low = static_cast<unsigned int>(_Val);
if (!_BitScanReverse(&_Result, _Low)) {
return _Digits;
}
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
if (!_BitScanReverse64(&_Result, _Val)) {
return _Digits;
}
#endif // ^^^ !defined(_M_IX86) ^^^
}
return static_cast<int>(_Digits - 1 - _Result);
}
template <class _Ty>
_NODISCARD int _Checked_x86_x64_countl_zero(const _Ty _Val) noexcept {
#ifdef __AVX2__
return _Countl_zero_lzcnt(_Val);
#else // ^^^ defined(__AVX2__) / !defined(__AVX2__) vvv
const bool _Definitely_have_lzcnt = __isa_available >= _Stl_isa_available_avx2;
if (_Definitely_have_lzcnt) {
return _Countl_zero_lzcnt(_Val);
} else {
return _Countl_zero_bsr(_Val);
}
#endif // ^^^ !defined(__AVX2__) ^^^
}
#endif // (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC))
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64)
template <class _Ty>
_NODISCARD int _Checked_arm_arm64_countl_zero(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
if (_Val == 0) {
return _Digits;
}
if constexpr (_Digits <= 32) {
return static_cast<int>(_CountLeadingZeros(_Val)) - (_Unsigned_integer_digits<unsigned long> - _Digits);
} else {
return static_cast<int>(_CountLeadingZeros64(_Val));
}
}
#endif // defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64)
#endif // _HAS_COUNTL_ZERO_INTRINSICS
// Implementation of countr_zero without using specialized CPU instructions.
// Used at compile time and when said instructions are not supported.
// see "Hacker's Delight" section 5-4
template <class _Ty>
_NODISCARD constexpr int _Countr_zero_fallback(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
return _Digits - _Countl_zero_fallback(static_cast<_Ty>(static_cast<_Ty>(~_Val) & static_cast<_Ty>(_Val - 1)));
}
// Implementation of popcount without using specialized CPU instructions.
// Used at compile time and when said instructions are not supported.
template <class _Ty>
_NODISCARD constexpr int _Popcount_fallback(_Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
#if (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || defined(_M_ARM)
if constexpr (_Digits == 64) {
// 64-bit bit operations on architectures without 64-bit registers are less efficient,
// hence we split the value so that it fits in 32-bit registers
return _Popcount_fallback(static_cast<unsigned long>(_Val))
+ _Popcount_fallback(static_cast<unsigned long>(_Val >> 32));
} else
#endif // (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || defined(_M_ARM)
{
// we static_cast these bit patterns in order to truncate them to the correct size
_Val = static_cast<_Ty>(_Val - ((_Val >> 1) & static_cast<_Ty>(0x5555'5555'5555'5555ull)));
_Val = static_cast<_Ty>((_Val & static_cast<_Ty>(0x3333'3333'3333'3333ull))
+ ((_Val >> 2) & static_cast<_Ty>(0x3333'3333'3333'3333ull)));
_Val = static_cast<_Ty>((_Val + (_Val >> 4)) & static_cast<_Ty>(0x0F0F'0F0F'0F0F'0F0Full));
// Multiply by one in each byte, so that it will have the sum of all source bytes in the highest byte
_Val = static_cast<_Ty>(_Val * static_cast<_Ty>(0x0101'0101'0101'0101ull));
// Extract highest byte
return static_cast<int>(_Val >> (_Digits - 8));
}
}
#if ((defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC))) \
&& !defined(_M_CEE_PURE) && !defined(__CUDACC__)
#define _HAS_TZCNT_BSF_INTRINSICS 1
#else // ^^^ intrinsics available / intrinsics unavailable vvv
#define _HAS_TZCNT_BSF_INTRINSICS 0
#endif // ^^^ intrinsics unavailable ^^^
#if _HAS_TZCNT_BSF_INTRINSICS
#ifdef __clang__
#define _TZCNT_U32 __builtin_ia32_tzcnt_u32
#define _TZCNT_U64 __builtin_ia32_tzcnt_u64
#else // ^^^ __clang__ / !__clang__ vvv
#define _TZCNT_U32 _tzcnt_u32
#define _TZCNT_U64 _tzcnt_u64
#endif // __clang__
template <class _Ty>
_NODISCARD int _Countr_zero_tzcnt(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
constexpr _Ty _Max = static_cast<_Ty>(-1); // equal to (numeric_limits<_Ty>::max)()
if constexpr (_Digits <= 32) {
// Intended widening to int. This operation means that a narrow 0 will widen
// to 0xFFFF....FFFF0... instead of 0. We need this to avoid counting all the zeros
// of the wider type.
return static_cast<int>(_TZCNT_U32(static_cast<unsigned int>(~_Max | _Val)));
} else {
#ifdef _M_IX86
const auto _Low = static_cast<unsigned int>(_Val);
if (_Low == 0) {
const unsigned int _High = _Val >> 32;
return static_cast<int>(32 + _TZCNT_U32(_High));
} else {
return static_cast<int>(_TZCNT_U32(_Low));
}
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
return static_cast<int>(_TZCNT_U64(_Val));
#endif // ^^^ !defined(_M_IX86) ^^^
}
}
#undef _TZCNT_U32
#undef _TZCNT_U64
template <class _Ty>
_NODISCARD int _Countr_zero_bsf(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
constexpr _Ty _Max = static_cast<_Ty>(-1); // equal to (numeric_limits<_Ty>::max)()
unsigned long _Result;
if constexpr (_Digits <= 32) {
// Intended widening to int. This operation means that a narrow 0 will widen
// to 0xFFFF....FFFF0... instead of 0. We need this to avoid counting all the zeros
// of the wider type.
if (!_BitScanForward(&_Result, static_cast<unsigned int>(~_Max | _Val))) {
return _Digits;
}
} else {
#ifdef _M_IX86
const auto _Low = static_cast<unsigned int>(_Val);
if (_BitScanForward(&_Result, _Low)) {
return static_cast<int>(_Result);
}
const unsigned int _High = _Val >> 32;
if (!_BitScanForward(&_Result, _High)) {
return _Digits;
} else {
return static_cast<int>(_Result + 32);
}
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
if (!_BitScanForward64(&_Result, _Val)) {
return _Digits;
}
#endif // ^^^ !defined(_M_IX86) ^^^
}
return static_cast<int>(_Result);
}
template <class _Ty>
_NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept {
#ifdef __AVX2__
return _Countr_zero_tzcnt(_Val);
#else // ^^^ defined(__AVX2__) / !defined(__AVX2__) vvv
const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2;
if (_Definitely_have_tzcnt) {
return _Countr_zero_tzcnt(_Val);
} else {
return _Countr_zero_bsf(_Val);
}
#endif // ^^^ !defined(__AVX2__) ^^^
}
#endif // _HAS_TZCNT_BSF_INTRINSICS
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64)) && !defined(_M_CEE_PURE) && !defined(__CUDACC__)
#define _HAS_POPCNT_INTRINSICS 1
#if defined(__AVX__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#define _POPCNT_INTRINSICS_ALWAYS_AVAILABLE 1
#else // ^^^ intrinsics always available / intrinsics not always available vvv
#define _POPCNT_INTRINSICS_ALWAYS_AVAILABLE 0
#endif // ^^^ intrinsics not always available ^^^
#else // ^^^ intrinsics available / intrinsics unavailable vvv
#define _HAS_POPCNT_INTRINSICS 0
#endif // ^^^ intrinsics unavailable ^^^
#if _HAS_POPCNT_INTRINSICS
template <class _Ty>
_NODISCARD int _Unchecked_popcount(const _Ty _Val) noexcept {
constexpr int _Digits = _Unsigned_integer_digits<_Ty>;
if constexpr (_Digits <= 16) {
return static_cast<int>(__popcnt16(_Val));
} else if constexpr (_Digits == 32) {
return static_cast<int>(__popcnt(_Val));
} else {
#ifdef _M_IX86
return static_cast<int>(__popcnt(_Val >> 32) + __popcnt(static_cast<unsigned int>(_Val)));
#else // ^^^ defined(_M_IX86) / !defined(_M_IX86) vvv
return static_cast<int>(__popcnt64(_Val));
#endif // ^^^ !defined(_M_IX86) ^^^
}
}
template <class _Ty>
_NODISCARD int _Checked_popcount(const _Ty _Val) noexcept {
#if !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE
const bool _Definitely_have_popcnt = __isa_available >= _Stl_isa_available_sse42;
if (!_Definitely_have_popcnt) {
return _Popcount_fallback(_Val);
}
#endif // ^^^ !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE ^^^
return _Unchecked_popcount(_Val);
}
#endif // ^^^ _HAS_POPCNT_INTRINSICS ^^^
template <class _Ty>
constexpr bool _Is_standard_unsigned_integer =
_Is_any_of_v<remove_cv_t<_Ty>, unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long>;
template <class _Ty, enable_if_t<_Is_standard_unsigned_integer<_Ty>, int> = 0>
_NODISCARD _CONSTEXPR20 int _Countr_zero(const _Ty _Val) noexcept {
#if _HAS_TZCNT_BSF_INTRINSICS
#if _HAS_CXX20
if (!_STD is_constant_evaluated())
#endif // _HAS_CXX20
{
return _Checked_x86_x64_countr_zero(_Val);
}
#endif // _HAS_TZCNT_BSF_INTRINSICS
return _Countr_zero_fallback(_Val);
}
template <class _Ty, class _Fn>
constexpr decltype(auto) _Select_countr_zero_impl(_Fn _Callback) {
// TRANSITION, DevCom-1527995: Lambdas in this function ensure inlining
#if _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20
if (!_STD is_constant_evaluated()) {
#ifdef __AVX2__
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_tzcnt(_Val); });
#else // ^^^ AVX2 / not AVX2 vvv
const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2;
if (_Definitely_have_tzcnt) {
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_tzcnt(_Val); });
} else {
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_bsf(_Val); });
}
#endif // ^^^ not AVX2 ^^^
}
#endif // ^^^ _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20 ^^^
// C++17 constexpr gcd() calls this function, so it should be constexpr unless we detect runtime evaluation.
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Countr_zero_fallback(_Val); });
}
template <class _Ty, enable_if_t<_Is_standard_unsigned_integer<_Ty>, int> = 0>
_NODISCARD _CONSTEXPR20 int _Popcount(const _Ty _Val) noexcept {
#if _HAS_POPCNT_INTRINSICS
#if _HAS_CXX20
if (!_STD is_constant_evaluated())
#endif // _HAS_CXX20
{
return _Checked_popcount(_Val);
}
#endif // ^^^ _HAS_POPCNT_INTRINSICS ^^^
return _Popcount_fallback(_Val);
}
template <class _Ty, class _Fn>
_CONSTEXPR20 decltype(auto) _Select_popcount_impl(_Fn _Callback) {
// TRANSITION, DevCom-1527995: Lambdas in this function ensure inlining
#if _HAS_POPCNT_INTRINSICS
#if _HAS_CXX20
if (!_STD is_constant_evaluated())
#endif // _HAS_CXX20
{
#if !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE
const bool _Definitely_have_popcnt = __isa_available >= _Stl_isa_available_sse42;
if (!_Definitely_have_popcnt) {
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Popcount_fallback(_Val); });
}
#endif // ^^^ !_POPCNT_INTRINSICS_ALWAYS_AVAILABLE ^^^
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Unchecked_popcount(_Val); });
}
#endif // ^^^ _HAS_POPCNT_INTRINSICS ^^^
return _Callback([](_Ty _Val) _STATIC_LAMBDA { return _Popcount_fallback(_Val); });
}
#undef _HAS_POPCNT_INTRINSICS
#undef _HAS_TZCNT_BSF_INTRINSICS
#undef _POPCNT_INTRINSICS_ALWAYS_AVAILABLE
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_BIT_UTILS_HPP
@@ -0,0 +1,696 @@
// __msvc_chrono.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_CHRONO_HPP
#define __MSVC_CHRONO_HPP
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#include <ctime>
#include <limits>
#include <ratio>
#include <type_traits>
#include <utility>
#include <xtimec.h>
#if _HAS_CXX20
#include <compare>
#endif
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
namespace chrono {
_EXPORT_STD template <class _Rep>
struct treat_as_floating_point : is_floating_point<_Rep> {}; // tests for floating-point type
_EXPORT_STD template <class _Rep>
constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value;
_EXPORT_STD template <class _Rep>
struct duration_values { // gets arithmetic properties of a type
_NODISCARD static constexpr _Rep zero() noexcept {
// get zero value
return _Rep(0);
}
_NODISCARD static constexpr _Rep(min)() noexcept {
// get smallest value
return numeric_limits<_Rep>::lowest();
}
_NODISCARD static constexpr _Rep(max)() noexcept {
// get largest value
return (numeric_limits<_Rep>::max)();
}
};
#if _HAS_CXX20
_EXPORT_STD template <class _Clock>
constexpr bool is_clock_v = requires {
typename _Clock::rep;
typename _Clock::period;
typename _Clock::duration;
typename _Clock::time_point;
_Clock::is_steady;
_Clock::now();
};
_EXPORT_STD template <class _Clock>
struct is_clock : bool_constant<is_clock_v<_Clock>> {};
template <class _Clock>
constexpr bool _Is_clock_v = is_clock_v<_Clock>;
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
template <class _Clock, class = void>
constexpr bool _Is_clock_v = false;
template <class _Clock>
constexpr bool
_Is_clock_v<_Clock, void_t<typename _Clock::rep, typename _Clock::period, typename _Clock::duration,
typename _Clock::time_point, decltype(_Clock::is_steady), decltype(_Clock::now())>> =
true;
#endif // ^^^ !_HAS_CXX20 ^^^
_EXPORT_STD template <class _Rep, class _Period = ratio<1>>
class duration;
template <class _Ty>
constexpr bool _Is_duration_v = _Is_specialization_v<_Ty, duration>;
_EXPORT_STD template <class _To, class _Rep, class _Period, enable_if_t<_Is_duration_v<_To>, int> = 0>
constexpr _To duration_cast(const duration<_Rep, _Period>&)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<typename _To::rep>); // strengthened
_EXPORT_STD template <class _Rep, class _Period>
class duration { // represents a time duration
public:
using rep = _Rep;
using period = typename _Period::type;
static_assert(!_Is_duration_v<_Rep>, "duration can't have duration as first template argument");
static_assert(_Is_ratio_v<_Period>, "period not an instance of std::ratio");
static_assert(0 < _Period::num, "period negative or zero");
constexpr duration() = default;
template <class _Rep2,
enable_if_t<is_convertible_v<const _Rep2&, _Rep>
&& (treat_as_floating_point_v<_Rep> || !treat_as_floating_point_v<_Rep2>),
int> = 0>
constexpr explicit duration(const _Rep2& _Val)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<_Rep2>) // strengthened
: _MyRep(static_cast<_Rep>(_Val)) {}
template <class _Rep2, class _Period2,
enable_if_t<treat_as_floating_point_v<_Rep>
|| (_Ratio_divide_sfinae<_Period2, _Period>::den == 1 && !treat_as_floating_point_v<_Rep2>),
int> = 0>
constexpr duration(const duration<_Rep2, _Period2>& _Dur)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<_Rep2>) // strengthened
: _MyRep(_CHRONO duration_cast<duration>(_Dur).count()) {}
_NODISCARD constexpr _Rep count() const noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
return _MyRep;
}
_NODISCARD constexpr common_type_t<duration> operator+() const
noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
return common_type_t<duration>(*this);
}
_NODISCARD constexpr common_type_t<duration> operator-() const
noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
return common_type_t<duration>(-_MyRep);
}
_CONSTEXPR17 duration& operator++() noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
++_MyRep;
return *this;
}
_CONSTEXPR17 duration operator++(int) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
return duration(_MyRep++);
}
_CONSTEXPR17 duration& operator--() noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
--_MyRep;
return *this;
}
_CONSTEXPR17 duration operator--(int) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
return duration(_MyRep--);
}
_CONSTEXPR17 duration& operator+=(const duration& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
_MyRep += _Right._MyRep;
return *this;
}
_CONSTEXPR17 duration& operator-=(const duration& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
_MyRep -= _Right._MyRep;
return *this;
}
_CONSTEXPR17 duration& operator*=(const _Rep& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
_MyRep *= _Right;
return *this;
}
_CONSTEXPR17 duration& operator/=(const _Rep& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
_MyRep /= _Right;
return *this;
}
_CONSTEXPR17 duration& operator%=(const _Rep& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
_MyRep %= _Right;
return *this;
}
_CONSTEXPR17 duration& operator%=(const duration& _Right) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
_MyRep %= _Right.count();
return *this;
}
_NODISCARD static constexpr duration zero() noexcept {
// get zero value
return duration(duration_values<_Rep>::zero());
}
_NODISCARD static constexpr duration(min)() noexcept {
// get minimum value
return duration((duration_values<_Rep>::min)());
}
_NODISCARD static constexpr duration(max)() noexcept {
// get maximum value
return duration((duration_values<_Rep>::max)());
}
private:
_Rep _MyRep; // the stored rep
};
_EXPORT_STD template <class _Clock, class _Duration = typename _Clock::duration>
class time_point { // represents a point in time
public:
using clock = _Clock;
using duration = _Duration;
using rep = typename _Duration::rep;
using period = typename _Duration::period;
static_assert(_Is_duration_v<_Duration>,
"N4950 [time.point.general]/1 mandates Duration to be a specialization of chrono::duration.");
constexpr time_point() = default;
constexpr explicit time_point(const _Duration& _Other) noexcept(is_arithmetic_v<rep>) // strengthened
: _MyDur(_Other) {}
template <class _Duration2, enable_if_t<is_convertible_v<_Duration2, _Duration>, int> = 0>
constexpr time_point(const time_point<_Clock, _Duration2>& _Tp)
noexcept(is_arithmetic_v<rep> && is_arithmetic_v<typename _Duration2::rep>) // strengthened
: _MyDur(_Tp.time_since_epoch()) {}
_NODISCARD constexpr _Duration time_since_epoch() const noexcept(is_arithmetic_v<rep>) /* strengthened */ {
return _MyDur;
}
#if _HAS_CXX20
constexpr time_point& operator++() noexcept(is_arithmetic_v<rep>) /* strengthened */ {
++_MyDur;
return *this;
}
constexpr time_point operator++(int) noexcept(is_arithmetic_v<rep>) /* strengthened */ {
return time_point{_MyDur++};
}
constexpr time_point& operator--() noexcept(is_arithmetic_v<rep>) /* strengthened */ {
--_MyDur;
return *this;
}
constexpr time_point operator--(int) noexcept(is_arithmetic_v<rep>) /* strengthened */ {
return time_point{_MyDur--};
}
#endif // _HAS_CXX20
_CONSTEXPR17 time_point& operator+=(const _Duration& _Dur) noexcept(is_arithmetic_v<rep>) /* strengthened */ {
_MyDur += _Dur;
return *this;
}
_CONSTEXPR17 time_point& operator-=(const _Duration& _Dur) noexcept(is_arithmetic_v<rep>) /* strengthened */ {
_MyDur -= _Dur;
return *this;
}
_NODISCARD static constexpr time_point(min)() noexcept {
return time_point((_Duration::min)());
}
_NODISCARD static constexpr time_point(max)() noexcept {
return time_point((_Duration::max)());
}
private:
_Duration _MyDur{duration::zero()}; // duration since the epoch
};
} // namespace chrono
template <class _Rep, class _Period>
constexpr bool _Is_trivially_swappable_v<chrono::duration<_Rep, _Period>> = _Is_trivially_swappable_v<_Rep>;
template <class _Clock, class _Duration>
constexpr bool _Is_trivially_swappable_v<chrono::time_point<_Clock, _Duration>> = _Is_trivially_swappable_v<_Duration>;
_NODISCARD constexpr intmax_t _Lcm(const intmax_t _Ax, const intmax_t _Bx) noexcept {
return (_Ax / _Gcd(_Ax, _Bx)) * _Bx;
}
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
struct common_type<_CHRONO duration<_Rep1, _Period1>, _CHRONO duration<_Rep2, _Period2>> {
using type = _CHRONO duration<common_type_t<_Rep1, _Rep2>,
ratio<_Gcd(_Period1::num, _Period2::num), _Lcm(_Period1::den, _Period2::den)>>;
};
template <class _Clock, class _Duration1, class _Duration2>
struct common_type<_CHRONO time_point<_Clock, _Duration1>,
_CHRONO time_point<_Clock, _Duration2>> { // common type of two time points
using type = _CHRONO time_point<_Clock, common_type_t<_Duration1, _Duration2>>;
};
namespace chrono {
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>> operator+(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CD = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CD(_CD(_Left).count() + _CD(_Right).count());
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>> operator-(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CD = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CD(_CD(_Left).count() - _CD(_Right).count());
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2,
enable_if_t<is_convertible_v<const _Rep2&, common_type_t<_Rep1, _Rep2>>, int> = 0>
_NODISCARD constexpr duration<common_type_t<_Rep1, _Rep2>, _Period1> operator*(
const duration<_Rep1, _Period1>& _Left, const _Rep2& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CR = common_type_t<_Rep1, _Rep2>;
using _CD = duration<_CR, _Period1>;
return _CD(_CD(_Left).count() * _Right);
}
_EXPORT_STD template <class _Rep1, class _Rep2, class _Period2,
enable_if_t<is_convertible_v<const _Rep1&, common_type_t<_Rep1, _Rep2>>, int> = 0>
_NODISCARD constexpr duration<common_type_t<_Rep1, _Rep2>, _Period2> operator*(
const _Rep1& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
return _Right * _Left;
}
template <class _CR, class _Period1, class _Rep2, bool = is_convertible_v<const _Rep2&, _CR>>
struct _Duration_div_mod1 { // return type for duration / rep and duration % rep
using type = duration<_CR, _Period1>;
};
template <class _CR, class _Period1, class _Rep2>
struct _Duration_div_mod1<_CR, _Period1, _Rep2, false> {}; // no return type
template <class _CR, class _Period1, class _Rep2, bool = _Is_duration_v<_Rep2>>
struct _Duration_div_mod {}; // no return type
template <class _CR, class _Period1, class _Rep2>
struct _Duration_div_mod<_CR, _Period1, _Rep2, false> : _Duration_div_mod1<_CR, _Period1, _Rep2> {
// return type for duration / rep and duration % rep
};
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2>
_NODISCARD constexpr typename _Duration_div_mod<common_type_t<_Rep1, _Rep2>, _Period1, _Rep2>::type operator/(
const duration<_Rep1, _Period1>& _Left, const _Rep2& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CR = common_type_t<_Rep1, _Rep2>;
using _CD = duration<_CR, _Period1>;
return _CD(_CD(_Left).count() / _Right);
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr common_type_t<_Rep1, _Rep2> operator/(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CD = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CD(_Left).count() / _CD(_Right).count();
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2>
_NODISCARD constexpr typename _Duration_div_mod<common_type_t<_Rep1, _Rep2>, _Period1, _Rep2>::type operator%(
const duration<_Rep1, _Period1>& _Left, const _Rep2& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CR = common_type_t<_Rep1, _Rep2>;
using _CD = duration<_CR, _Period1>;
return _CD(_CD(_Left).count() % _Right);
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>> operator%(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CD = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CD(_CD(_Left).count() % _CD(_Right).count());
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr bool operator==(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CT = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CT(_Left).count() == _CT(_Right).count();
}
#if !_HAS_CXX20
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr bool operator!=(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr bool operator<(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CT = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CT(_Left).count() < _CT(_Right).count();
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr bool operator<=(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
return !(_Right < _Left);
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr bool operator>(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
return _Right < _Left;
}
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr bool operator>=(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
return !(_Left < _Right);
}
#if _HAS_CXX20
_EXPORT_STD template <class _Rep1, class _Period1, class _Rep2, class _Period2>
requires three_way_comparable<typename common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>::rep>
_NODISCARD constexpr auto operator<=>(
const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right)
noexcept(is_arithmetic_v<_Rep1> && is_arithmetic_v<_Rep2>) /* strengthened */ {
using _CT = common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>;
return _CT(_Left).count() <=> _CT(_Right).count();
}
#endif // _HAS_CXX20
_EXPORT_STD template <class _To, class _Rep, class _Period, enable_if_t<_Is_duration_v<_To>, int> /* = 0 */>
_NODISCARD constexpr _To duration_cast(const duration<_Rep, _Period>& _Dur)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// convert duration to another duration; truncate
using _CF = ratio_divide<_Period, typename _To::period>;
using _ToRep = typename _To::rep;
using _CR = common_type_t<_ToRep, _Rep, intmax_t>;
constexpr bool _Num_is_one = _CF::num == 1;
constexpr bool _Den_is_one = _CF::den == 1;
if constexpr (_Den_is_one) {
if constexpr (_Num_is_one) {
return static_cast<_To>(static_cast<_ToRep>(_Dur.count()));
} else {
return static_cast<_To>(
static_cast<_ToRep>(static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num)));
}
} else {
if constexpr (_Num_is_one) {
return static_cast<_To>(
static_cast<_ToRep>(static_cast<_CR>(_Dur.count()) / static_cast<_CR>(_CF::den)));
} else {
return static_cast<_To>(static_cast<_ToRep>(
static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num) / static_cast<_CR>(_CF::den)));
}
}
}
_EXPORT_STD template <class _To, class _Rep, class _Period, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr _To floor(const duration<_Rep, _Period>& _Dur)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// convert duration to another duration; round towards negative infinity
// i.e. the greatest integral result such that the result <= _Dur
const _To _Casted{_CHRONO duration_cast<_To>(_Dur)};
if (_Casted > _Dur) {
return _To{_Casted.count() - static_cast<typename _To::rep>(1)};
}
return _Casted;
}
_EXPORT_STD template <class _To, class _Rep, class _Period, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr _To ceil(const duration<_Rep, _Period>& _Dur)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// convert duration to another duration; round towards positive infinity
// i.e. the least integral result such that _Dur <= the result
const _To _Casted{_CHRONO duration_cast<_To>(_Dur)};
if (_Casted < _Dur) {
return _To{_Casted.count() + static_cast<typename _To::rep>(1)};
}
return _Casted;
}
template <class _Rep>
constexpr bool _Is_even(_Rep _Val) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
// Tests whether _Val is even
return _Val % 2 == 0;
}
_EXPORT_STD template <class _To, class _Rep, class _Period,
enable_if_t<_Is_duration_v<_To> && !treat_as_floating_point_v<typename _To::rep>, int> = 0>
_NODISCARD constexpr _To round(const duration<_Rep, _Period>& _Dur)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// convert duration to another duration, round to nearest, ties to even
const _To _Floored{_CHRONO floor<_To>(_Dur)};
const _To _Ceiled{_Floored + _To{1}};
const auto _Floor_adjustment = _Dur - _Floored;
const auto _Ceil_adjustment = _Ceiled - _Dur;
if (_Floor_adjustment < _Ceil_adjustment
|| (_Floor_adjustment == _Ceil_adjustment && _Is_even(_Floored.count()))) {
return _Floored;
}
return _Ceiled;
}
_EXPORT_STD template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>
_NODISCARD constexpr duration<_Rep, _Period> abs(const duration<_Rep, _Period> _Dur)
noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
// create a duration whose count() is the absolute value of _Dur.count()
if (_Dur < duration<_Rep, _Period>::zero()) {
return -_Dur;
} else {
return _Dur;
}
}
_EXPORT_STD using nanoseconds = duration<long long, nano>;
_EXPORT_STD using microseconds = duration<long long, micro>;
_EXPORT_STD using milliseconds = duration<long long, milli>;
_EXPORT_STD using seconds = duration<long long>;
_EXPORT_STD using minutes = duration<int, ratio<60>>;
_EXPORT_STD using hours = duration<int, ratio<3600>>;
#if _HAS_CXX20
_EXPORT_STD using days = duration<int, ratio_multiply<ratio<24>, hours::period>>;
_EXPORT_STD using weeks = duration<int, ratio_multiply<ratio<7>, days::period>>;
_EXPORT_STD using years = duration<int, ratio_multiply<ratio<146097, 400>, days::period>>;
_EXPORT_STD using months = duration<int, ratio_divide<years::period, ratio<12>>>;
#endif // _HAS_CXX20
_EXPORT_STD template <class _Clock, class _Duration, class _Rep, class _Period>
_NODISCARD constexpr time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>> operator+(
const time_point<_Clock, _Duration>& _Left, const duration<_Rep, _Period>& _Right)
noexcept(is_arithmetic_v<typename _Duration::rep> && is_arithmetic_v<_Rep>) /* strengthened */ {
using _RT = time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>>;
return _RT(_Left.time_since_epoch() + _Right);
}
_EXPORT_STD template <class _Rep, class _Period, class _Clock, class _Duration>
_NODISCARD constexpr time_point<_Clock, common_type_t<duration<_Rep, _Period>, _Duration>> operator+(
const duration<_Rep, _Period>& _Left, const time_point<_Clock, _Duration>& _Right)
noexcept(is_arithmetic_v<_Rep> && is_arithmetic_v<typename _Duration::rep>) /* strengthened */ {
return _Right + _Left;
}
_EXPORT_STD template <class _Clock, class _Duration, class _Rep, class _Period>
_NODISCARD constexpr time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>> operator-(
const time_point<_Clock, _Duration>& _Left, const duration<_Rep, _Period>& _Right)
noexcept(is_arithmetic_v<typename _Duration::rep> && is_arithmetic_v<_Rep>) /* strengthened */ {
using _RT = time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>>;
return _RT(_Left.time_since_epoch() - _Right);
}
_EXPORT_STD template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr common_type_t<_Duration1, _Duration2> operator-(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return _Left.time_since_epoch() - _Right.time_since_epoch();
}
_EXPORT_STD template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr bool operator==(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return _Left.time_since_epoch() == _Right.time_since_epoch();
}
#if !_HAS_CXX20
template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr bool operator!=(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
_EXPORT_STD template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr bool operator<(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return _Left.time_since_epoch() < _Right.time_since_epoch();
}
_EXPORT_STD template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr bool operator<=(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return !(_Right < _Left);
}
_EXPORT_STD template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr bool operator>(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return _Right < _Left;
}
_EXPORT_STD template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr bool operator>=(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return !(_Left < _Right);
}
#if _HAS_CXX20
_EXPORT_STD template <class _Clock, class _Duration1, three_way_comparable_with<_Duration1> _Duration2>
_NODISCARD constexpr auto operator<=>(
const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right)
noexcept(
is_arithmetic_v<typename _Duration1::rep> && is_arithmetic_v<typename _Duration2::rep>) /* strengthened */ {
return _Left.time_since_epoch() <=> _Right.time_since_epoch();
}
#endif // _HAS_CXX20
_EXPORT_STD template <class _To, class _Clock, class _Duration, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> time_point_cast(const time_point<_Clock, _Duration>& _Time)
noexcept(is_arithmetic_v<typename _Duration::rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// change the duration type of a time_point; truncate
return time_point<_Clock, _To>(_CHRONO duration_cast<_To>(_Time.time_since_epoch()));
}
_EXPORT_STD template <class _To, class _Clock, class _Duration, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> floor(const time_point<_Clock, _Duration>& _Time)
noexcept(is_arithmetic_v<typename _Duration::rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// change the duration type of a time_point; round towards negative infinity
return time_point<_Clock, _To>(_CHRONO floor<_To>(_Time.time_since_epoch()));
}
_EXPORT_STD template <class _To, class _Clock, class _Duration, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> ceil(const time_point<_Clock, _Duration>& _Time)
noexcept(is_arithmetic_v<typename _Duration::rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// change the duration type of a time_point; round towards positive infinity
return time_point<_Clock, _To>(_CHRONO ceil<_To>(_Time.time_since_epoch()));
}
_EXPORT_STD template <class _To, class _Clock, class _Duration,
enable_if_t<_Is_duration_v<_To> && !treat_as_floating_point_v<typename _To::rep>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> round(const time_point<_Clock, _Duration>& _Time)
noexcept(is_arithmetic_v<typename _Duration::rep> && is_arithmetic_v<typename _To::rep>) /* strengthened */ {
// change the duration type of a time_point; round to nearest, ties to even
return time_point<_Clock, _To>(_CHRONO round<_To>(_Time.time_since_epoch()));
}
_EXPORT_STD struct steady_clock { // wraps QueryPerformanceCounter
using rep = long long;
using period = nano;
using duration = nanoseconds;
using time_point = _CHRONO time_point<steady_clock>;
static constexpr bool is_steady = true;
_NODISCARD static time_point now() noexcept { // get current time
const long long _Freq = _Query_perf_frequency(); // doesn't change after system boot
const long long _Ctr = _Query_perf_counter();
static_assert(period::num == 1, "This assumes period::num == 1.");
// The compiler recognizes the constants for frequency and time period and uses shifts and
// multiplies instead of divides to calculate the nanosecond value.
constexpr long long _TenMHz = 10'000'000;
constexpr long long _TwentyFourMHz = 24'000'000;
if (_Freq == _TenMHz) {
// 10 MHz is a very common QPC frequency on modern x86/x64 PCs. Optimizing for
// this specific frequency can double the performance of this function by
// avoiding the expensive frequency conversion path.
static_assert(period::den % _TenMHz == 0, "It should never fail.");
constexpr long long _Multiplier = period::den / _TenMHz;
return time_point(duration(_Ctr * _Multiplier));
} else if (_Freq == _TwentyFourMHz) {
// 24 MHz is a common frequency on ARM/ARM64, including cases where it emulates x86/x64.
const long long _Whole = (_Ctr / _TwentyFourMHz) * period::den;
const long long _Part = (_Ctr % _TwentyFourMHz) * period::den / _TwentyFourMHz;
return time_point(duration(_Whole + _Part));
} else {
// Instead of just having "(_Ctr * period::den) / _Freq",
// the algorithm below prevents overflow when _Ctr is sufficiently large.
// It assumes that _Freq * period::den does not overflow, which is currently true for nano period.
// It is not realistic for _Ctr to accumulate to large values from zero with this assumption,
// but the initial value of _Ctr could be large.
const long long _Whole = (_Ctr / _Freq) * period::den;
const long long _Part = (_Ctr % _Freq) * period::den / _Freq;
return time_point(duration(_Whole + _Part));
}
}
};
} // namespace chrono
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_CHRONO_HPP
@@ -0,0 +1,138 @@
// __msvc_cxx_stdatomic.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_CXX_STDATOMIC_HPP
#define __MSVC_CXX_STDATOMIC_HPP
// see _STL_COMPILER_PREPROCESSOR in yvals_core.h
#if !defined(RC_INVOKED) && !defined(Q_MOC_RUN) && !defined(__midl)
// provide a specific error message for C compilers, before the general error message in yvals_core.h
#ifndef __cplusplus
#error <__msvc_cxx_stdatomic.hpp> is an internal header. It is incompatible with C and should not be directly included.
#endif // !defined(__cplusplus)
#include <yvals.h>
#ifdef _M_CEE_PURE
#error <stdatomic.h> is not supported when compiling with /clr:pure.
#endif // defined(_M_CEE_PURE)
#if !_HAS_CXX23
_EMIT_STL_WARNING(STL4038, "The contents of <stdatomic.h> are available only with C++23 or later.");
#else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv
#include <atomic>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
template <class _Ty>
using _Std_atomic = _STD atomic<_Ty>;
#define _Atomic(T) _Std_atomic<T>
using _STD memory_order;
using _STD memory_order_relaxed;
using _STD memory_order_consume;
using _STD memory_order_acquire;
using _STD memory_order_release;
using _STD memory_order_acq_rel;
using _STD memory_order_seq_cst;
using _STD atomic_flag;
using _STD atomic_bool;
using _STD atomic_char;
using _STD atomic_schar;
using _STD atomic_uchar;
using _STD atomic_short;
using _STD atomic_ushort;
using _STD atomic_int;
using _STD atomic_uint;
using _STD atomic_long;
using _STD atomic_ulong;
using _STD atomic_llong;
using _STD atomic_ullong;
#ifdef __cpp_lib_char8_t
using _STD atomic_char8_t;
#endif // defined(__cpp_lib_char8_t)
using _STD atomic_char16_t;
using _STD atomic_char32_t;
using _STD atomic_wchar_t;
using _STD atomic_int8_t;
using _STD atomic_uint8_t;
using _STD atomic_int16_t;
using _STD atomic_uint16_t;
using _STD atomic_int32_t;
using _STD atomic_uint32_t;
using _STD atomic_int64_t;
using _STD atomic_uint64_t;
using _STD atomic_int_least8_t;
using _STD atomic_uint_least8_t;
using _STD atomic_int_least16_t;
using _STD atomic_uint_least16_t;
using _STD atomic_int_least32_t;
using _STD atomic_uint_least32_t;
using _STD atomic_int_least64_t;
using _STD atomic_uint_least64_t;
using _STD atomic_int_fast8_t;
using _STD atomic_uint_fast8_t;
using _STD atomic_int_fast16_t;
using _STD atomic_uint_fast16_t;
using _STD atomic_int_fast32_t;
using _STD atomic_uint_fast32_t;
using _STD atomic_int_fast64_t;
using _STD atomic_uint_fast64_t;
using _STD atomic_intptr_t;
using _STD atomic_uintptr_t;
using _STD atomic_size_t;
using _STD atomic_ptrdiff_t;
using _STD atomic_intmax_t;
using _STD atomic_uintmax_t;
using _STD atomic_is_lock_free;
using _STD atomic_load;
using _STD atomic_load_explicit;
using _STD atomic_store;
using _STD atomic_store_explicit;
using _STD atomic_exchange;
using _STD atomic_exchange_explicit;
using _STD atomic_compare_exchange_strong;
using _STD atomic_compare_exchange_strong_explicit;
using _STD atomic_compare_exchange_weak;
using _STD atomic_compare_exchange_weak_explicit;
using _STD atomic_fetch_add;
using _STD atomic_fetch_add_explicit;
using _STD atomic_fetch_sub;
using _STD atomic_fetch_sub_explicit;
using _STD atomic_fetch_or;
using _STD atomic_fetch_or_explicit;
using _STD atomic_fetch_xor;
using _STD atomic_fetch_xor_explicit;
using _STD atomic_fetch_and;
using _STD atomic_fetch_and_explicit;
using _STD atomic_flag_test_and_set;
using _STD atomic_flag_test_and_set_explicit;
using _STD atomic_flag_clear;
using _STD atomic_flag_clear_explicit;
using _STD atomic_thread_fence;
using _STD atomic_signal_fence;
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // ^^^ _HAS_CXX23 ^^^
#endif // !defined(RC_INVOKED) && !defined(Q_MOC_RUN) && !defined(__midl)
#endif // __MSVC_CXX_STDATOMIC_HPP
@@ -0,0 +1,790 @@
// __msvc_filebuf.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_FILEBUF_HPP
#define __MSVC_FILEBUF_HPP
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstdio>
#include <streambuf>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
// TRANSITION, ABI: The _Path_ish functions accepting filesystem::path or experimental::filesystem::path are templates
// which always use the same types as a workaround for user code deriving from iostreams types and
// __declspec(dllexport)ing the derived types. Adding member functions to iostreams broke the ABI of such DLLs.
// Deriving and __declspec(dllexport)ing standard library types is not supported, but in this particular case
// the workaround was inexpensive. The workaround will be removed in the next ABI breaking release of the
// Visual C++ Libraries.
_STD_BEGIN
#if _HAS_CXX17
namespace filesystem {
_EXPORT_STD class path;
}
#endif // _HAS_CXX17
#ifndef _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
#ifdef _M_CEE
#define _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM 0
#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv
#define _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM 1
#endif // ^^^ !defined(_M_CEE) ^^^
#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
#if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
namespace experimental {
namespace filesystem {
inline namespace v1 {
class path;
}
} // namespace filesystem
} // namespace experimental
#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
// clang-format off
template <class _Ty>
constexpr bool _Is_any_path = _Is_any_of_v<_Ty
#if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
, experimental::filesystem::path
#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
#if _HAS_CXX17
, filesystem::path
#endif // _HAS_CXX17
>;
// clang-format on
extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const char*, ios_base::openmode, int);
extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_base::openmode, int);
template <class _Elem>
bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream
return _CSTD fread(&_Ch, sizeof(_Elem), 1, _File) == 1;
}
template <>
inline bool _Fgetc(char& _Byte, FILE* _File) { // get a char element from a C stream
int _Meta;
if ((_Meta = _CSTD fgetc(_File)) == EOF) {
return false;
} else { // got one, convert to char
_Byte = static_cast<char>(_Meta);
return true;
}
}
template <>
inline bool _Fgetc(wchar_t& _Wchar, FILE* _File) { // get a wchar_t element from a C stream
wint_t _Meta;
if ((_Meta = _CSTD fgetwc(_File)) == WEOF) {
return false;
} else { // got one, convert to wchar_t
_Wchar = static_cast<wchar_t>(_Meta);
return true;
}
}
#ifdef _CRTBLD
template <>
inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned short element from a C stream
wint_t _Meta;
if ((_Meta = _CSTD fgetwc(_File)) == WEOF) {
return false;
} else { // got one, convert to unsigned short
_Wchar = static_cast<unsigned short>(_Meta);
return true;
}
}
#endif // defined(_CRTBLD)
template <class _Elem>
bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream
return _CSTD fwrite(&_Ch, 1, sizeof(_Elem), _File) == sizeof(_Elem);
}
template <>
inline bool _Fputc(char _Byte, FILE* _File) { // put a char element to a C stream
return _CSTD fputc(_Byte, _File) != EOF;
}
template <>
inline bool _Fputc(wchar_t _Wchar, FILE* _File) { // put a wchar_t element to a C stream
return _CSTD fputwc(_Wchar, _File) != WEOF;
}
#ifdef _CRTBLD
template <>
inline bool _Fputc(unsigned short _Wchar, FILE* _File) { // put an unsigned short element to a C stream
return _CSTD fputwc(_Wchar, _File) != WEOF;
}
#endif // defined(_CRTBLD)
template <class _Elem>
bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail)
return false;
}
template <>
inline bool _Ungetc(const char& _Byte, FILE* _File) { // put back a char element to a C stream
return _CSTD ungetc(static_cast<unsigned char>(_Byte), _File) != EOF;
}
template <>
inline bool _Ungetc(const signed char& _Byte, FILE* _File) { // put back a signed char element to a C stream
return _CSTD ungetc(static_cast<unsigned char>(_Byte), _File) != EOF;
}
template <>
inline bool _Ungetc(const unsigned char& _Byte, FILE* _File) { // put back an unsigned char element to a C stream
return _CSTD ungetc(_Byte, _File) != EOF;
}
template <>
inline bool _Ungetc(const wchar_t& _Wchar, FILE* _File) { // put back a wchar_t element to a C stream
return _CSTD ungetwc(_Wchar, _File) != WEOF;
}
#ifdef _CRTBLD
template <>
inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an unsigned short element to a C stream
return _CSTD ungetwc(_Wchar, _File) != WEOF;
}
#endif // defined(_CRTBLD)
_EXPORT_STD template <class _Elem, class _Traits>
class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream
public:
using _Mysb = basic_streambuf<_Elem, _Traits>;
using _Cvt = codecvt<_Elem, char, typename _Traits::state_type>;
basic_filebuf() : _Mysb() {
_Init(nullptr, _Newfl);
}
explicit basic_filebuf(FILE* const _File) : _Mysb() { // extension
_Init(_File, _Newfl);
}
__CLR_OR_THIS_CALL ~basic_filebuf() noexcept override {
if (_Myfile) {
_Reset_back(); // revert from _Mychar buffer
}
if (_Closef) {
close();
}
}
using int_type = typename _Traits::int_type;
using pos_type = typename _Traits::pos_type;
using off_type = typename _Traits::off_type;
basic_filebuf(_Uninitialized) noexcept : _Mysb(_Noinit) {}
basic_filebuf(basic_filebuf&& _Right) {
_Init(_Right._Myfile, _Newfl); // match buffering styles
_Init(static_cast<FILE*>(nullptr), _Closefl); // then make *this look closed
_Assign_rv(_STD move(_Right));
}
basic_filebuf& operator=(basic_filebuf&& _Right) {
_Assign_rv(_STD move(_Right));
return *this;
}
void _Assign_rv(basic_filebuf&& _Right) {
if (this != _STD addressof(_Right)) {
close();
this->swap(_Right);
}
}
void swap(basic_filebuf& _Right) noexcept /* strengthened */ {
if (this != _STD addressof(_Right)) {
FILE* _Myfile_sav = _Myfile;
const _Cvt* _Pcvt_sav = _Pcvt;
typename _Traits::state_type _State_sav = _State;
bool _Wrotesome_sav = _Wrotesome;
bool _Closef_sav = _Closef;
bool _Set_eback_sav = _Mysb::eback() == &_Mychar;
bool _Set_eback_live = _Mysb::gptr() == &_Mychar;
_Elem* _Pfirst0 = _Mysb::pbase();
_Elem* _Pnext0 = _Mysb::pptr();
_Elem* _Pend = _Mysb::epptr();
_Elem* _Gfirst0 = _Mysb::eback();
_Elem* _Gnext0 = _Mysb::gptr();
_Elem* _Gend = _Mysb::egptr();
// reinitialize *this
_Init(_Right._Myfile, _Right._Myfile ? _Openfl : _Newfl);
_Mysb::setp(_Right.pbase(), _Right.pptr(), _Right.epptr());
if (_Right.eback() != &_Right._Mychar) {
_Mysb::setg(_Right.eback(), _Right.gptr(), _Right.egptr());
} else if (_Right.gptr() != &_Right._Mychar) {
_Mysb::setg(&_Mychar, &_Mychar + 1, &_Mychar + 1);
} else {
_Mysb::setg(&_Mychar, &_Mychar, &_Mychar + 1);
}
_Pcvt = _Right._Pcvt;
_State = _Right._State;
_Wrotesome = _Right._Wrotesome;
_Closef = _Right._Closef;
// reinitialize _Right
_Right._Init(_Myfile_sav, _Myfile_sav ? _Openfl : _Newfl);
_Right.setp(_Pfirst0, _Pnext0, _Pend);
if (!_Set_eback_sav) {
_Right.setg(_Gfirst0, _Gnext0, _Gend);
} else if (!_Set_eback_live) {
_Right.setg(&_Right._Mychar, &_Right._Mychar + 1, &_Right._Mychar + 1);
} else {
_Right.setg(&_Right._Mychar, &_Right._Mychar, &_Right._Mychar + 1);
}
_Right._Pcvt = _Pcvt_sav;
_Right._State = _State_sav;
_Right._Wrotesome = _Wrotesome_sav;
_Right._Closef = _Closef_sav;
// swap ancillary data
_STD swap(_Set_eback, _Right._Set_eback);
_STD swap(_Set_egptr, _Right._Set_egptr);
_STD swap(_Mychar, _Right._Mychar);
_STD swap(_Mysb::_Plocale, _Right._Plocale);
}
}
basic_filebuf(const basic_filebuf&) = delete;
basic_filebuf& operator=(const basic_filebuf&) = delete;
enum _Initfl { // reasons for a call to _Init
_Newfl,
_Openfl,
_Closefl
};
_NODISCARD bool is_open() const noexcept /* strengthened */ {
return static_cast<bool>(_Myfile);
}
basic_filebuf* open(const char* _Filename, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) {
// _Prot is an extension
if (_Myfile) {
return nullptr;
}
const auto _File = _Fiopen(_Filename, _Mode, _Prot);
if (!_File) {
return nullptr; // open failed
}
_Init(_File, _Openfl);
_Initcvt(_STD use_facet<_Cvt>(_Mysb::getloc()));
return this; // open succeeded
}
basic_filebuf* open(const string& _Str, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) {
// _Prot is an extension
return open(_Str.c_str(), _Mode, _Prot);
}
#if _HAS_OLD_IOSTREAMS_MEMBERS
basic_filebuf* open(const char* _Filename, ios_base::open_mode _Mode) {
return open(_Filename, static_cast<ios_base::openmode>(_Mode));
}
#endif // _HAS_OLD_IOSTREAMS_MEMBERS
basic_filebuf* open(const wchar_t* _Filename, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) {
// in standard as const std::filesystem::path::value_type *; _Prot is an extension
if (_Myfile) {
return nullptr;
}
const auto _File = _Fiopen(_Filename, _Mode, _Prot);
if (!_File) {
return nullptr; // open failed
}
_Init(_File, _Openfl);
_Initcvt(_STD use_facet<_Cvt>(_Mysb::getloc()));
return this; // open succeeded
}
basic_filebuf* open(const wstring& _Str, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) {
// extension
return open(_Str.c_str(), _Mode, _Prot);
}
#if _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
template <class _Path_ish = experimental::filesystem::path>
basic_filebuf* open(
const _Identity_t<_Path_ish>& _Path, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) {
// _Prot is an extension
return open(_Path.c_str(), _Mode, _Prot);
}
#endif // _FSTREAM_SUPPORTS_EXPERIMENTAL_FILESYSTEM
#if _HAS_CXX17
template <int = 0, class _Path_ish = filesystem::path>
basic_filebuf* open(
const _Identity_t<_Path_ish>& _Path, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) {
// _Prot is an extension
return open(_Path.c_str(), _Mode, _Prot);
}
#endif // _HAS_CXX17
#if _HAS_OLD_IOSTREAMS_MEMBERS
basic_filebuf* open(const wchar_t* _Filename, ios_base::open_mode _Mode) {
// in standard as const std::filesystem::path::value_type *
return open(_Filename, static_cast<ios_base::openmode>(_Mode));
}
#endif // _HAS_OLD_IOSTREAMS_MEMBERS
basic_filebuf* close() {
basic_filebuf* _Ans;
if (_Myfile) { // put any homing sequence and close file
_Reset_back(); // revert from _Mychar buffer
_Ans = this;
if (!_Endwrite()) {
_Ans = nullptr;
}
if (_CSTD fclose(_Myfile) != 0) {
_Ans = nullptr;
}
} else {
_Ans = nullptr;
}
_Init(nullptr, _Closefl);
return _Ans;
}
void __CLR_OR_THIS_CALL _Lock() override { // lock file instead of stream buffer
if (_Myfile) {
_CSTD _lock_file(_Myfile);
}
}
void __CLR_OR_THIS_CALL _Unlock() override { // unlock file instead of stream buffer
if (_Myfile) {
_CSTD _unlock_file(_Myfile);
}
}
#if _HAS_CXX23 && defined(_CPPRTTI)
template <class _UnicodeConsoleFn, class _FallbackFn, class _Filebuf_type>
friend ios_base::iostate _Do_on_maybe_unicode_console(ostream&, _UnicodeConsoleFn, _FallbackFn);
#endif // ^^^ _HAS_CXX23 && defined(_CPPRTTI) ^^^
protected:
int_type __CLR_OR_THIS_CALL overflow(int_type _Meta = _Traits::eof()) override { // put an element to stream
if (_Traits::eq_int_type(_Traits::eof(), _Meta)) {
return _Traits::not_eof(_Meta); // EOF, return success code
}
if (_Mysb::pptr() && _Mysb::pptr() < _Mysb::epptr()) { // room in buffer, store it
*_Mysb::_Pninc() = _Traits::to_char_type(_Meta);
return _Meta;
}
if (!_Myfile) {
return _Traits::eof(); // no open C stream, fail
}
_Reset_back(); // revert from _Mychar buffer
if (!_Pcvt) { // no codecvt facet, put as is
return _Fputc(_Traits::to_char_type(_Meta), _Myfile) ? _Meta : _Traits::eof();
}
// put using codecvt facet
constexpr size_t _Codecvt_temp_buf = 32;
char _Str[_Codecvt_temp_buf];
const _Elem _Ch = _Traits::to_char_type(_Meta);
const _Elem* _Src;
char* _Dest;
// test result of converting one element
switch (_Pcvt->out(_State, &_Ch, &_Ch + 1, _Src, _Str, _Str + _Codecvt_temp_buf, _Dest)) {
case codecvt_base::partial:
case codecvt_base::ok:
{ // converted something, try to put it out
const auto _Count = static_cast<size_t>(_Dest - _Str);
if (0 < _Count && _Count != static_cast<size_t>(_CSTD fwrite(_Str, 1, _Count, _Myfile))) {
return _Traits::eof(); // write failed
}
_Wrotesome = true; // write succeeded
if (_Src != &_Ch) {
return _Meta; // converted whole element
}
return _Traits::eof(); // conversion failed
}
case codecvt_base::noconv:
// no conversion, put as is
return _Fputc(_Ch, _Myfile) ? _Meta : _Traits::eof();
default:
return _Traits::eof(); // conversion failed
}
}
int_type __CLR_OR_THIS_CALL pbackfail(int_type _Meta = _Traits::eof()) override {
// put an element back to stream
if (_Mysb::gptr() && _Mysb::eback() < _Mysb::gptr()
&& (_Traits::eq_int_type(_Traits::eof(), _Meta)
|| _Traits::eq_int_type(_Traits::to_int_type(_Mysb::gptr()[-1]),
_Meta))) { // just back up position
_Mysb::_Gndec();
return _Traits::not_eof(_Meta);
} else if (!_Myfile || _Traits::eq_int_type(_Traits::eof(), _Meta)) {
return _Traits::eof(); // no open C stream or EOF, fail
} else if (!_Pcvt && _Ungetc(_Traits::to_char_type(_Meta), _Myfile)) {
return _Meta; // no facet and unget succeeded, return
} else if (_Mysb::gptr() != &_Mychar) { // putback to _Mychar
_Mychar = _Traits::to_char_type(_Meta);
_Set_back(); // switch to _Mychar buffer
return _Meta;
} else {
return _Traits::eof(); // nowhere to put back
}
}
int_type __CLR_OR_THIS_CALL underflow() override { // get an element from stream, but don't point past it
int_type _Meta;
if (_Mysb::gptr() && _Mysb::gptr() < _Mysb::egptr()) {
return _Traits::to_int_type(*_Mysb::gptr()); // return buffered
} else if (_Traits::eq_int_type(_Traits::eof(), _Meta = uflow())) {
return _Meta; // uflow failed, return EOF
} else { // get a char, don't point past it
pbackfail(_Meta);
return _Meta;
}
}
int_type __CLR_OR_THIS_CALL uflow() override { // get an element from stream, point past it
if (_Mysb::gptr() && _Mysb::gptr() < _Mysb::egptr()) {
return _Traits::to_int_type(*_Mysb::_Gninc()); // return buffered
}
if (!_Myfile) {
return _Traits::eof(); // no open C stream, fail
}
_Reset_back(); // revert from _Mychar buffer
if (!_Pcvt) { // no codecvt facet, just get it
_Elem _Ch;
return _Fgetc(_Ch, _Myfile) ? _Traits::to_int_type(_Ch) : _Traits::eof();
}
// build string until codecvt succeeds
string _Str;
for (;;) { // get using codecvt facet
const char* _Src;
int _Meta = _CSTD fgetc(_Myfile);
if (_Meta == EOF) {
return _Traits::eof(); // partial char?
}
_Str.push_back(static_cast<char>(_Meta)); // append byte and convert
_Elem _Ch;
_Elem* _Dest;
// test result of converting one element
switch (_Pcvt->in(_State, _Str.data(), _Str.data() + _Str.size(), _Src, &_Ch, &_Ch + 1, _Dest)) {
case codecvt_base::partial:
case codecvt_base::ok:
if (_Dest != &_Ch) { // got an element, put back excess and deliver it
auto _Nleft = _Str.data() + _Str.size() - _Src;
while (0 < _Nleft) {
_CSTD ungetc(_Src[--_Nleft], _Myfile);
}
return _Traits::to_int_type(_Ch);
}
_Str.erase(0, static_cast<size_t>(_Src - _Str.data())); // partial, discard used input
break;
case codecvt_base::noconv:
// noconv is only possible if _Elem is char, so we can use it directly
return static_cast<int_type>(_Str.front());
default:
return _Traits::eof(); // conversion failed
}
}
}
streamsize __CLR_OR_THIS_CALL xsgetn(_Elem* _Ptr, streamsize _Count) override {
// get _Count characters from stream
if constexpr (sizeof(_Elem) == 1) {
if (_Count <= 0) {
return 0;
}
if (_Pcvt) { // if we need a nontrivial codecvt transform, do the default expensive thing
return _Mysb::xsgetn(_Ptr, _Count);
}
// assuming this is OK because _Ptr + _Count must be valid
auto _Count_s = static_cast<size_t>(_Count);
const auto _Start_count = _Count;
const auto _Available = static_cast<size_t>(_Mysb::_Gnavail());
if (0 < _Available) { // copy from get area
const auto _Read_size = (_STD min)(_Count_s, _Available);
_Traits::copy(_Ptr, _Mysb::gptr(), _Read_size);
_Ptr += _Read_size;
_Count_s -= _Read_size;
_Mysb::gbump(static_cast<int>(_Read_size));
}
if (_Myfile) { // open C stream, attempt read
_Reset_back(); // revert from _Mychar buffer
// process in 4k - 1 chunks to avoid tripping over fread's clobber-the-end behavior when
// doing \r\n -> \n translation
constexpr size_t _Read_size = 4095; // _INTERNAL_BUFSIZ - 1
while (_Read_size < _Count_s) {
const auto _Actual_read = _CSTD fread(_Ptr, sizeof(_Elem), _Read_size, _Myfile);
_Ptr += _Actual_read;
_Count_s -= _Actual_read;
if (_Actual_read != _Read_size) {
return static_cast<streamsize>(_Start_count - _Count_s);
}
}
if (0 < _Count_s) {
_Count_s -= _CSTD fread(_Ptr, sizeof(_Elem), _Count_s, _Myfile);
}
}
return static_cast<streamsize>(_Start_count - _Count_s);
} else { // non-chars always get element-by-element processing
return _Mysb::xsgetn(_Ptr, _Count);
}
}
streamsize __CLR_OR_THIS_CALL xsputn(const _Elem* _Ptr, streamsize _Count) override {
// put _Count characters to stream
if constexpr (sizeof(_Elem) == 1) {
if (_Pcvt) { // if we need a nontrivial codecvt transform, do the default expensive thing
return _Mysb::xsputn(_Ptr, _Count);
}
const streamsize _Start_count = _Count;
streamsize _Size = _Mysb::_Pnavail();
if (0 < _Count && 0 < _Size) { // copy to write buffer
if (_Count < _Size) {
_Size = _Count;
}
_Traits::copy(_Mysb::pptr(), _Ptr, static_cast<size_t>(_Size));
_Ptr += _Size;
_Count -= _Size;
_Mysb::pbump(static_cast<int>(_Size));
}
if (0 < _Count && _Myfile) { // open C stream, attempt write
_Count -= _CSTD fwrite(_Ptr, sizeof(_Elem), static_cast<size_t>(_Count), _Myfile);
}
return _Start_count - _Count;
} else { // non-chars always get element-by-element processing
return _Mysb::xsputn(_Ptr, _Count);
}
}
pos_type __CLR_OR_THIS_CALL seekoff(off_type _Off, ios_base::seekdir _Way,
ios_base::openmode = ios_base::in | ios_base::out) override { // change position by _Off
fpos_t _Fileposition;
if (_Mysb::gptr() == &_Mychar // something putback
&& _Way == ios_base::cur // a relative seek
&& !_Pcvt) { // not converting
_Off -= static_cast<off_type>(sizeof(_Elem)); // back up over _Elem bytes
}
if (!_Myfile || !_Endwrite()
|| ((_Off != 0 || _Way != ios_base::cur) && _CSTD _fseeki64(_Myfile, _Off, _Way) != 0)
|| _CSTD fgetpos(_Myfile, &_Fileposition) != 0) {
return pos_type{off_type{-1}}; // report failure
}
_Reset_back(); // revert from _Mychar buffer, discarding any putback
return pos_type{_State, _Fileposition}; // return new position
}
pos_type __CLR_OR_THIS_CALL seekpos(pos_type _Pos, ios_base::openmode = ios_base::in | ios_base::out) override {
// change position to _Pos
off_type _Off = static_cast<off_type>(_Pos);
if (!_Myfile || !_Endwrite() || _CSTD fsetpos(_Myfile, &_Off) != 0) {
return pos_type{off_type{-1}}; // report failure
}
_State = _Pos.state();
_Reset_back(); // revert from _Mychar buffer, discarding any putback
return pos_type{_State, _Off}; // return new position
}
_Mysb* __CLR_OR_THIS_CALL setbuf(_Elem* _Buffer, streamsize _Count) override { // offer _Buffer to C stream
int _Mode;
if (!_Buffer && _Count == 0) {
_Mode = _IONBF;
} else {
_Mode = _IOFBF;
}
const size_t _Size = static_cast<size_t>(_Count) * sizeof(_Elem);
if (!_Myfile || _CSTD setvbuf(_Myfile, reinterpret_cast<char*>(_Buffer), _Mode, _Size) != 0) {
return nullptr; // failed
}
// new buffer, reinitialize pointers
_Init(_Myfile, _Openfl);
return this;
}
int __CLR_OR_THIS_CALL sync() override { // synchronize C stream with external file
if (!_Myfile || _Traits::eq_int_type(_Traits::eof(), overflow()) || 0 <= _CSTD fflush(_Myfile)) {
return 0;
}
return -1;
}
void __CLR_OR_THIS_CALL imbue(const locale& _Loc) override {
// set locale to argument (capture nontrivial codecvt facet)
_Initcvt(_STD use_facet<_Cvt>(_Loc));
}
void _Init(FILE* _File, _Initfl _Which) noexcept { // initialize to C stream _File after {new, open, close}
using _State_type = typename _Traits::state_type;
__PURE_APPDOMAIN_GLOBAL static _State_type _Stinit; // initial state
_Closef = _Which == _Openfl;
_Wrotesome = false;
_Mysb::_Init(); // initialize stream buffer base object
if (_File && sizeof(_Elem) == 1) { // point inside C stream with [first, first + count) buffer
_Elem** _Pb = nullptr;
_Elem** _Pn = nullptr;
int* _Nr = nullptr;
::_get_stream_buffer_pointers(
_File, reinterpret_cast<char***>(&_Pb), reinterpret_cast<char***>(&_Pn), &_Nr);
int* _Nw = _Nr;
_Mysb::_Init(_Pb, _Pn, _Nr, _Pb, _Pn, _Nw);
}
_Myfile = _File;
_State = _Stinit;
_Pcvt = nullptr; // pointer to codecvt facet
}
bool _Endwrite() { // put shift to initial conversion state, as needed
if (!_Pcvt || !_Wrotesome) {
return true;
}
// may have to put
if (_Traits::eq_int_type(_Traits::eof(), overflow())) {
return false;
}
constexpr size_t _Codecvt_temp_buf = 32;
char _Str[_Codecvt_temp_buf];
char* _Dest;
switch (_Pcvt->unshift(_State, _Str, _Str + _Codecvt_temp_buf, _Dest)) { // test result of homing conversion
case codecvt_base::ok:
_Wrotesome = false; // homed successfully
_FALLTHROUGH;
case codecvt_base::partial:
{ // put any generated bytes
const auto _Count = static_cast<size_t>(_Dest - _Str);
if (0 < _Count && _Count != static_cast<size_t>(_CSTD fwrite(_Str, 1, _Count, _Myfile))) {
return false; // write failed
}
return !_Wrotesome;
}
case codecvt_base::noconv:
_Wrotesome = false; // homed successfully
return true; // nothing else to do
default:
return false; // conversion failed
}
}
void _Initcvt(const _Cvt& _Newcvt) noexcept { // initialize codecvt pointer
if (_Newcvt.always_noconv()) {
_Pcvt = nullptr; // nothing to do
} else { // set up for nontrivial codecvt facet
_Pcvt = _STD addressof(_Newcvt);
_Mysb::_Init(); // reset any buffering
}
}
private:
const _Cvt* _Pcvt; // pointer to codecvt facet (may be null)
_Elem _Mychar; // putback character, when _Ungetc fails
bool _Wrotesome; // true if homing sequence may be needed
typename _Traits::state_type _State; // current conversion state
bool _Closef; // true if C stream must be closed
FILE* _Myfile; // pointer to C stream
void _Reset_back() noexcept { // restore buffer after putback
if (_Mysb::eback() == &_Mychar) {
_Mysb::setg(_Set_eback, _Set_eback, _Set_egptr);
}
}
void _Set_back() noexcept { // set up putback area
if (_Mysb::eback() != &_Mychar) { // save current get buffer
_Set_eback = _Mysb::eback();
_Set_egptr = _Mysb::egptr();
}
_Mysb::setg(&_Mychar, &_Mychar, &_Mychar + 1);
}
_Elem* _Set_eback; // saves eback() during one-element putback
_Elem* _Set_egptr; // saves egptr()
};
_EXPORT_STD template <class _Elem, class _Traits>
void swap(basic_filebuf<_Elem, _Traits>& _Left, basic_filebuf<_Elem, _Traits>& _Right) noexcept /* strengthened */ {
_Left.swap(_Right);
}
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_FILEBUF_HPP
@@ -0,0 +1,551 @@
// __msvc_format_ucd_tables.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// WARNING, this entire header is generated by
// tools/unicode_properties_parse/unicode_properties_data_gen.py
// DO NOT MODIFY!
// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
//
// See Terms of Use <https://www.unicode.org/copyright.html>
// for definitions of Unicode Inc.'s Data Files and Software.
//
// NOTICE TO USER: Carefully read the following legal agreement.
// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
// TERMS AND CONDITIONS OF THIS AGREEMENT.
// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
// THE DATA FILES OR SOFTWARE.
//
// COPYRIGHT AND PERMISSION NOTICE
//
// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.
// Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of the Unicode data files and any associated documentation
// (the "Data Files") or Unicode software and any associated documentation
// (the "Software") to deal in the Data Files or Software
// without restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, and/or sell copies of
// the Data Files or Software, and to permit persons to whom the Data Files
// or Software are furnished to do so, provided that either
// (a) this copyright and permission notice appear with all copies
// of the Data Files or Software, or
// (b) this copyright and permission notice appear in associated
// Documentation.
//
// THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT OF THIRD PARTY RIGHTS.
// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THE DATA FILES OR SOFTWARE.
//
// Except as contained in this notice, the name of a copyright holder
// shall not be used in advertising or otherwise to promote the sale,
// use or other dealings in these Data Files or Software without prior
// written authorization of the copyright holder.
#ifndef __MSVC_FORMAT_UCD_TABLES_HPP
#define __MSVC_FORMAT_UCD_TABLES_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstdint>
#include <xutility>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
template <class _ValueEnum, size_t _NumRanges, bool _Is_binary_property>
struct _Unicode_property_data {
uint32_t _Lower_bounds[_NumRanges];
uint16_t _Props_and_size[_NumRanges];
_NODISCARD constexpr _ValueEnum _Get_property_for_codepoint(const uint32_t _Code_point) const noexcept {
ptrdiff_t _Upper_idx = _STD upper_bound(_Lower_bounds, _STD end(_Lower_bounds), _Code_point) - _Lower_bounds;
constexpr auto _No_value_constant = static_cast<_ValueEnum>(UINT8_MAX);
if (_Upper_idx == 0) {
return _No_value_constant;
}
--_Upper_idx;
const uint32_t _Lower_bound = _Lower_bounds[_Upper_idx];
const uint16_t _Data = _Props_and_size[_Upper_idx];
_STL_INTERNAL_CHECK(_Code_point >= _Lower_bound);
if constexpr (_Is_binary_property) {
if (_Code_point < _Lower_bound + _Data) {
return static_cast<_ValueEnum>(0);
}
} else {
const uint16_t _Size = static_cast<uint16_t>(_Data & 0x0FFF);
const _ValueEnum _Prop = static_cast<_ValueEnum>((_Data & 0xF000) >> 12);
if (_Code_point < _Lower_bound + _Size) {
return _Prop;
}
}
return _No_value_constant;
}
};
// The following static data tables are generated from the Unicode character database.
// _Grapheme_Break_property_data comes from ucd/auxiliary/GraphemeBreakProperty.txt.
//
// _Extended_Pictographic_property_data comes from ucd/emoji/emoji-data.txt.
//
// __printable_property_data comes from ucd/extracted/DerivedGeneralCategory.txt.
//
// _Grapheme_Extend_property_data comes from ucd/DerivedCoreProperties.txt.
//
// The enums containing the values for the properties are also generated, in order to ensure they match
// up correctly with how we're parsing them.
//
// All sets of data tables are generated by tools/unicode_properties_parse/unicode_properties_data_gen.py in the
// https://github.com/microsoft/stl repository.
//
// The data format is a set of arrays for each character property. The first is an array of uint32_t encoding
// the lower bound of each range of codepoints that has the given property.
// The second is an array of uint16_t.
// - For enumerated properties, this array encodes both the range size and property value as follows:
// 16 12 0
// +-----------------------------------------------------+
// | property_value | range_size |
// +-----------------------------------------------------+
// that is: the size is stored in the least significant 12 bits
// (leading to a max size of 4095), and the property value is stored in the most significant 4 bits,
// leading to a maximum of 16 property values.
// - For binary properties, this array simply stores the range size.
//
// Codepoint ranges may not overlap, and, within one property, a codepoint may only appear once. Furthermore the
// codepoint lower bounds appear in sorted (ascending) order.
// GraphemeBreakProperty-15.0.0.txt
// Date: 2022-04-27, 17:07:38 GMT
enum class _Grapheme_Break_property_values : uint8_t {
_CR_value,
_Control_value,
_Extend_value,
_L_value,
_LF_value,
_LV_value,
_LVT_value,
_Prepend_value,
_Regional_Indicator_value,
_SpacingMark_value,
_T_value,
_V_value,
_ZWJ_value,
_No_value = 255
};
// GraphemeBreakProperty-15.0.0.txt
// Date: 2022-04-27, 17:07:38 GMT
inline constexpr _Unicode_property_data<_Grapheme_Break_property_values, 1371, false> _Grapheme_Break_property_data{
{0x0, 0xa, 0xb, 0xd, 0xe, 0x7f, 0xad, 0x300, 0x483, 0x591, 0x5bf, 0x5c1, 0x5c4, 0x5c7, 0x600, 0x610, 0x61c, 0x64b,
0x670, 0x6d6, 0x6dd, 0x6df, 0x6e7, 0x6ea, 0x70f, 0x711, 0x730, 0x7a6, 0x7eb, 0x7fd, 0x816, 0x81b, 0x825, 0x829,
0x859, 0x890, 0x898, 0x8ca, 0x8e2, 0x8e3, 0x903, 0x93a, 0x93b, 0x93c, 0x93e, 0x941, 0x949, 0x94d, 0x94e, 0x951,
0x962, 0x981, 0x982, 0x9bc, 0x9be, 0x9bf, 0x9c1, 0x9c7, 0x9cb, 0x9cd, 0x9d7, 0x9e2, 0x9fe, 0xa01, 0xa03, 0xa3c,
0xa3e, 0xa41, 0xa47, 0xa4b, 0xa51, 0xa70, 0xa75, 0xa81, 0xa83, 0xabc, 0xabe, 0xac1, 0xac7, 0xac9, 0xacb, 0xacd,
0xae2, 0xafa, 0xb01, 0xb02, 0xb3c, 0xb3e, 0xb40, 0xb41, 0xb47, 0xb4b, 0xb4d, 0xb55, 0xb62, 0xb82, 0xbbe, 0xbbf,
0xbc0, 0xbc1, 0xbc6, 0xbca, 0xbcd, 0xbd7, 0xc00, 0xc01, 0xc04, 0xc3c, 0xc3e, 0xc41, 0xc46, 0xc4a, 0xc55, 0xc62,
0xc81, 0xc82, 0xcbc, 0xcbe, 0xcbf, 0xcc0, 0xcc2, 0xcc3, 0xcc6, 0xcc7, 0xcca, 0xccc, 0xcd5, 0xce2, 0xcf3, 0xd00,
0xd02, 0xd3b, 0xd3e, 0xd3f, 0xd41, 0xd46, 0xd4a, 0xd4d, 0xd4e, 0xd57, 0xd62, 0xd81, 0xd82, 0xdca, 0xdcf, 0xdd0,
0xdd2, 0xdd6, 0xdd8, 0xddf, 0xdf2, 0xe31, 0xe33, 0xe34, 0xe47, 0xeb1, 0xeb3, 0xeb4, 0xec8, 0xf18, 0xf35, 0xf37,
0xf39, 0xf3e, 0xf71, 0xf7f, 0xf80, 0xf86, 0xf8d, 0xf99, 0xfc6, 0x102d, 0x1031, 0x1032, 0x1039, 0x103b, 0x103d,
0x1056, 0x1058, 0x105e, 0x1071, 0x1082, 0x1084, 0x1085, 0x108d, 0x109d, 0x1100, 0x1160, 0x11a8, 0x135d, 0x1712,
0x1715, 0x1732, 0x1734, 0x1752, 0x1772, 0x17b4, 0x17b6, 0x17b7, 0x17be, 0x17c6, 0x17c7, 0x17c9, 0x17dd, 0x180b,
0x180e, 0x180f, 0x1885, 0x18a9, 0x1920, 0x1923, 0x1927, 0x1929, 0x1930, 0x1932, 0x1933, 0x1939, 0x1a17, 0x1a19,
0x1a1b, 0x1a55, 0x1a56, 0x1a57, 0x1a58, 0x1a60, 0x1a62, 0x1a65, 0x1a6d, 0x1a73, 0x1a7f, 0x1ab0, 0x1b00, 0x1b04,
0x1b34, 0x1b3b, 0x1b3c, 0x1b3d, 0x1b42, 0x1b43, 0x1b6b, 0x1b80, 0x1b82, 0x1ba1, 0x1ba2, 0x1ba6, 0x1ba8, 0x1baa,
0x1bab, 0x1be6, 0x1be7, 0x1be8, 0x1bea, 0x1bed, 0x1bee, 0x1bef, 0x1bf2, 0x1c24, 0x1c2c, 0x1c34, 0x1c36, 0x1cd0,
0x1cd4, 0x1ce1, 0x1ce2, 0x1ced, 0x1cf4, 0x1cf7, 0x1cf8, 0x1dc0, 0x200b, 0x200c, 0x200d, 0x200e, 0x2028, 0x2060,
0x20d0, 0x2cef, 0x2d7f, 0x2de0, 0x302a, 0x3099, 0xa66f, 0xa674, 0xa69e, 0xa6f0, 0xa802, 0xa806, 0xa80b, 0xa823,
0xa825, 0xa827, 0xa82c, 0xa880, 0xa8b4, 0xa8c4, 0xa8e0, 0xa8ff, 0xa926, 0xa947, 0xa952, 0xa960, 0xa980, 0xa983,
0xa9b3, 0xa9b4, 0xa9b6, 0xa9ba, 0xa9bc, 0xa9be, 0xa9e5, 0xaa29, 0xaa2f, 0xaa31, 0xaa33, 0xaa35, 0xaa43, 0xaa4c,
0xaa4d, 0xaa7c, 0xaab0, 0xaab2, 0xaab7, 0xaabe, 0xaac1, 0xaaeb, 0xaaec, 0xaaee, 0xaaf5, 0xaaf6, 0xabe3, 0xabe5,
0xabe6, 0xabe8, 0xabe9, 0xabec, 0xabed, 0xac00, 0xac01, 0xac1c, 0xac1d, 0xac38, 0xac39, 0xac54, 0xac55, 0xac70,
0xac71, 0xac8c, 0xac8d, 0xaca8, 0xaca9, 0xacc4, 0xacc5, 0xace0, 0xace1, 0xacfc, 0xacfd, 0xad18, 0xad19, 0xad34,
0xad35, 0xad50, 0xad51, 0xad6c, 0xad6d, 0xad88, 0xad89, 0xada4, 0xada5, 0xadc0, 0xadc1, 0xaddc, 0xaddd, 0xadf8,
0xadf9, 0xae14, 0xae15, 0xae30, 0xae31, 0xae4c, 0xae4d, 0xae68, 0xae69, 0xae84, 0xae85, 0xaea0, 0xaea1, 0xaebc,
0xaebd, 0xaed8, 0xaed9, 0xaef4, 0xaef5, 0xaf10, 0xaf11, 0xaf2c, 0xaf2d, 0xaf48, 0xaf49, 0xaf64, 0xaf65, 0xaf80,
0xaf81, 0xaf9c, 0xaf9d, 0xafb8, 0xafb9, 0xafd4, 0xafd5, 0xaff0, 0xaff1, 0xb00c, 0xb00d, 0xb028, 0xb029, 0xb044,
0xb045, 0xb060, 0xb061, 0xb07c, 0xb07d, 0xb098, 0xb099, 0xb0b4, 0xb0b5, 0xb0d0, 0xb0d1, 0xb0ec, 0xb0ed, 0xb108,
0xb109, 0xb124, 0xb125, 0xb140, 0xb141, 0xb15c, 0xb15d, 0xb178, 0xb179, 0xb194, 0xb195, 0xb1b0, 0xb1b1, 0xb1cc,
0xb1cd, 0xb1e8, 0xb1e9, 0xb204, 0xb205, 0xb220, 0xb221, 0xb23c, 0xb23d, 0xb258, 0xb259, 0xb274, 0xb275, 0xb290,
0xb291, 0xb2ac, 0xb2ad, 0xb2c8, 0xb2c9, 0xb2e4, 0xb2e5, 0xb300, 0xb301, 0xb31c, 0xb31d, 0xb338, 0xb339, 0xb354,
0xb355, 0xb370, 0xb371, 0xb38c, 0xb38d, 0xb3a8, 0xb3a9, 0xb3c4, 0xb3c5, 0xb3e0, 0xb3e1, 0xb3fc, 0xb3fd, 0xb418,
0xb419, 0xb434, 0xb435, 0xb450, 0xb451, 0xb46c, 0xb46d, 0xb488, 0xb489, 0xb4a4, 0xb4a5, 0xb4c0, 0xb4c1, 0xb4dc,
0xb4dd, 0xb4f8, 0xb4f9, 0xb514, 0xb515, 0xb530, 0xb531, 0xb54c, 0xb54d, 0xb568, 0xb569, 0xb584, 0xb585, 0xb5a0,
0xb5a1, 0xb5bc, 0xb5bd, 0xb5d8, 0xb5d9, 0xb5f4, 0xb5f5, 0xb610, 0xb611, 0xb62c, 0xb62d, 0xb648, 0xb649, 0xb664,
0xb665, 0xb680, 0xb681, 0xb69c, 0xb69d, 0xb6b8, 0xb6b9, 0xb6d4, 0xb6d5, 0xb6f0, 0xb6f1, 0xb70c, 0xb70d, 0xb728,
0xb729, 0xb744, 0xb745, 0xb760, 0xb761, 0xb77c, 0xb77d, 0xb798, 0xb799, 0xb7b4, 0xb7b5, 0xb7d0, 0xb7d1, 0xb7ec,
0xb7ed, 0xb808, 0xb809, 0xb824, 0xb825, 0xb840, 0xb841, 0xb85c, 0xb85d, 0xb878, 0xb879, 0xb894, 0xb895, 0xb8b0,
0xb8b1, 0xb8cc, 0xb8cd, 0xb8e8, 0xb8e9, 0xb904, 0xb905, 0xb920, 0xb921, 0xb93c, 0xb93d, 0xb958, 0xb959, 0xb974,
0xb975, 0xb990, 0xb991, 0xb9ac, 0xb9ad, 0xb9c8, 0xb9c9, 0xb9e4, 0xb9e5, 0xba00, 0xba01, 0xba1c, 0xba1d, 0xba38,
0xba39, 0xba54, 0xba55, 0xba70, 0xba71, 0xba8c, 0xba8d, 0xbaa8, 0xbaa9, 0xbac4, 0xbac5, 0xbae0, 0xbae1, 0xbafc,
0xbafd, 0xbb18, 0xbb19, 0xbb34, 0xbb35, 0xbb50, 0xbb51, 0xbb6c, 0xbb6d, 0xbb88, 0xbb89, 0xbba4, 0xbba5, 0xbbc0,
0xbbc1, 0xbbdc, 0xbbdd, 0xbbf8, 0xbbf9, 0xbc14, 0xbc15, 0xbc30, 0xbc31, 0xbc4c, 0xbc4d, 0xbc68, 0xbc69, 0xbc84,
0xbc85, 0xbca0, 0xbca1, 0xbcbc, 0xbcbd, 0xbcd8, 0xbcd9, 0xbcf4, 0xbcf5, 0xbd10, 0xbd11, 0xbd2c, 0xbd2d, 0xbd48,
0xbd49, 0xbd64, 0xbd65, 0xbd80, 0xbd81, 0xbd9c, 0xbd9d, 0xbdb8, 0xbdb9, 0xbdd4, 0xbdd5, 0xbdf0, 0xbdf1, 0xbe0c,
0xbe0d, 0xbe28, 0xbe29, 0xbe44, 0xbe45, 0xbe60, 0xbe61, 0xbe7c, 0xbe7d, 0xbe98, 0xbe99, 0xbeb4, 0xbeb5, 0xbed0,
0xbed1, 0xbeec, 0xbeed, 0xbf08, 0xbf09, 0xbf24, 0xbf25, 0xbf40, 0xbf41, 0xbf5c, 0xbf5d, 0xbf78, 0xbf79, 0xbf94,
0xbf95, 0xbfb0, 0xbfb1, 0xbfcc, 0xbfcd, 0xbfe8, 0xbfe9, 0xc004, 0xc005, 0xc020, 0xc021, 0xc03c, 0xc03d, 0xc058,
0xc059, 0xc074, 0xc075, 0xc090, 0xc091, 0xc0ac, 0xc0ad, 0xc0c8, 0xc0c9, 0xc0e4, 0xc0e5, 0xc100, 0xc101, 0xc11c,
0xc11d, 0xc138, 0xc139, 0xc154, 0xc155, 0xc170, 0xc171, 0xc18c, 0xc18d, 0xc1a8, 0xc1a9, 0xc1c4, 0xc1c5, 0xc1e0,
0xc1e1, 0xc1fc, 0xc1fd, 0xc218, 0xc219, 0xc234, 0xc235, 0xc250, 0xc251, 0xc26c, 0xc26d, 0xc288, 0xc289, 0xc2a4,
0xc2a5, 0xc2c0, 0xc2c1, 0xc2dc, 0xc2dd, 0xc2f8, 0xc2f9, 0xc314, 0xc315, 0xc330, 0xc331, 0xc34c, 0xc34d, 0xc368,
0xc369, 0xc384, 0xc385, 0xc3a0, 0xc3a1, 0xc3bc, 0xc3bd, 0xc3d8, 0xc3d9, 0xc3f4, 0xc3f5, 0xc410, 0xc411, 0xc42c,
0xc42d, 0xc448, 0xc449, 0xc464, 0xc465, 0xc480, 0xc481, 0xc49c, 0xc49d, 0xc4b8, 0xc4b9, 0xc4d4, 0xc4d5, 0xc4f0,
0xc4f1, 0xc50c, 0xc50d, 0xc528, 0xc529, 0xc544, 0xc545, 0xc560, 0xc561, 0xc57c, 0xc57d, 0xc598, 0xc599, 0xc5b4,
0xc5b5, 0xc5d0, 0xc5d1, 0xc5ec, 0xc5ed, 0xc608, 0xc609, 0xc624, 0xc625, 0xc640, 0xc641, 0xc65c, 0xc65d, 0xc678,
0xc679, 0xc694, 0xc695, 0xc6b0, 0xc6b1, 0xc6cc, 0xc6cd, 0xc6e8, 0xc6e9, 0xc704, 0xc705, 0xc720, 0xc721, 0xc73c,
0xc73d, 0xc758, 0xc759, 0xc774, 0xc775, 0xc790, 0xc791, 0xc7ac, 0xc7ad, 0xc7c8, 0xc7c9, 0xc7e4, 0xc7e5, 0xc800,
0xc801, 0xc81c, 0xc81d, 0xc838, 0xc839, 0xc854, 0xc855, 0xc870, 0xc871, 0xc88c, 0xc88d, 0xc8a8, 0xc8a9, 0xc8c4,
0xc8c5, 0xc8e0, 0xc8e1, 0xc8fc, 0xc8fd, 0xc918, 0xc919, 0xc934, 0xc935, 0xc950, 0xc951, 0xc96c, 0xc96d, 0xc988,
0xc989, 0xc9a4, 0xc9a5, 0xc9c0, 0xc9c1, 0xc9dc, 0xc9dd, 0xc9f8, 0xc9f9, 0xca14, 0xca15, 0xca30, 0xca31, 0xca4c,
0xca4d, 0xca68, 0xca69, 0xca84, 0xca85, 0xcaa0, 0xcaa1, 0xcabc, 0xcabd, 0xcad8, 0xcad9, 0xcaf4, 0xcaf5, 0xcb10,
0xcb11, 0xcb2c, 0xcb2d, 0xcb48, 0xcb49, 0xcb64, 0xcb65, 0xcb80, 0xcb81, 0xcb9c, 0xcb9d, 0xcbb8, 0xcbb9, 0xcbd4,
0xcbd5, 0xcbf0, 0xcbf1, 0xcc0c, 0xcc0d, 0xcc28, 0xcc29, 0xcc44, 0xcc45, 0xcc60, 0xcc61, 0xcc7c, 0xcc7d, 0xcc98,
0xcc99, 0xccb4, 0xccb5, 0xccd0, 0xccd1, 0xccec, 0xcced, 0xcd08, 0xcd09, 0xcd24, 0xcd25, 0xcd40, 0xcd41, 0xcd5c,
0xcd5d, 0xcd78, 0xcd79, 0xcd94, 0xcd95, 0xcdb0, 0xcdb1, 0xcdcc, 0xcdcd, 0xcde8, 0xcde9, 0xce04, 0xce05, 0xce20,
0xce21, 0xce3c, 0xce3d, 0xce58, 0xce59, 0xce74, 0xce75, 0xce90, 0xce91, 0xceac, 0xcead, 0xcec8, 0xcec9, 0xcee4,
0xcee5, 0xcf00, 0xcf01, 0xcf1c, 0xcf1d, 0xcf38, 0xcf39, 0xcf54, 0xcf55, 0xcf70, 0xcf71, 0xcf8c, 0xcf8d, 0xcfa8,
0xcfa9, 0xcfc4, 0xcfc5, 0xcfe0, 0xcfe1, 0xcffc, 0xcffd, 0xd018, 0xd019, 0xd034, 0xd035, 0xd050, 0xd051, 0xd06c,
0xd06d, 0xd088, 0xd089, 0xd0a4, 0xd0a5, 0xd0c0, 0xd0c1, 0xd0dc, 0xd0dd, 0xd0f8, 0xd0f9, 0xd114, 0xd115, 0xd130,
0xd131, 0xd14c, 0xd14d, 0xd168, 0xd169, 0xd184, 0xd185, 0xd1a0, 0xd1a1, 0xd1bc, 0xd1bd, 0xd1d8, 0xd1d9, 0xd1f4,
0xd1f5, 0xd210, 0xd211, 0xd22c, 0xd22d, 0xd248, 0xd249, 0xd264, 0xd265, 0xd280, 0xd281, 0xd29c, 0xd29d, 0xd2b8,
0xd2b9, 0xd2d4, 0xd2d5, 0xd2f0, 0xd2f1, 0xd30c, 0xd30d, 0xd328, 0xd329, 0xd344, 0xd345, 0xd360, 0xd361, 0xd37c,
0xd37d, 0xd398, 0xd399, 0xd3b4, 0xd3b5, 0xd3d0, 0xd3d1, 0xd3ec, 0xd3ed, 0xd408, 0xd409, 0xd424, 0xd425, 0xd440,
0xd441, 0xd45c, 0xd45d, 0xd478, 0xd479, 0xd494, 0xd495, 0xd4b0, 0xd4b1, 0xd4cc, 0xd4cd, 0xd4e8, 0xd4e9, 0xd504,
0xd505, 0xd520, 0xd521, 0xd53c, 0xd53d, 0xd558, 0xd559, 0xd574, 0xd575, 0xd590, 0xd591, 0xd5ac, 0xd5ad, 0xd5c8,
0xd5c9, 0xd5e4, 0xd5e5, 0xd600, 0xd601, 0xd61c, 0xd61d, 0xd638, 0xd639, 0xd654, 0xd655, 0xd670, 0xd671, 0xd68c,
0xd68d, 0xd6a8, 0xd6a9, 0xd6c4, 0xd6c5, 0xd6e0, 0xd6e1, 0xd6fc, 0xd6fd, 0xd718, 0xd719, 0xd734, 0xd735, 0xd750,
0xd751, 0xd76c, 0xd76d, 0xd788, 0xd789, 0xd7b0, 0xd7cb, 0xfb1e, 0xfe00, 0xfe20, 0xfeff, 0xff9e, 0xfff0, 0x101fd,
0x102e0, 0x10376, 0x10a01, 0x10a05, 0x10a0c, 0x10a38, 0x10a3f, 0x10ae5, 0x10d24, 0x10eab, 0x10efd, 0x10f46,
0x10f82, 0x11000, 0x11001, 0x11002, 0x11038, 0x11070, 0x11073, 0x1107f, 0x11082, 0x110b0, 0x110b3, 0x110b7,
0x110b9, 0x110bd, 0x110c2, 0x110cd, 0x11100, 0x11127, 0x1112c, 0x1112d, 0x11145, 0x11173, 0x11180, 0x11182,
0x111b3, 0x111b6, 0x111bf, 0x111c2, 0x111c9, 0x111ce, 0x111cf, 0x1122c, 0x1122f, 0x11232, 0x11234, 0x11235,
0x11236, 0x1123e, 0x11241, 0x112df, 0x112e0, 0x112e3, 0x11300, 0x11302, 0x1133b, 0x1133e, 0x1133f, 0x11340,
0x11341, 0x11347, 0x1134b, 0x11357, 0x11362, 0x11366, 0x11370, 0x11435, 0x11438, 0x11440, 0x11442, 0x11445,
0x11446, 0x1145e, 0x114b0, 0x114b1, 0x114b3, 0x114b9, 0x114ba, 0x114bb, 0x114bd, 0x114be, 0x114bf, 0x114c1,
0x114c2, 0x115af, 0x115b0, 0x115b2, 0x115b8, 0x115bc, 0x115be, 0x115bf, 0x115dc, 0x11630, 0x11633, 0x1163b,
0x1163d, 0x1163e, 0x1163f, 0x116ab, 0x116ac, 0x116ad, 0x116ae, 0x116b0, 0x116b6, 0x116b7, 0x1171d, 0x11722,
0x11726, 0x11727, 0x1182c, 0x1182f, 0x11838, 0x11839, 0x11930, 0x11931, 0x11937, 0x1193b, 0x1193d, 0x1193e,
0x1193f, 0x11940, 0x11941, 0x11942, 0x11943, 0x119d1, 0x119d4, 0x119da, 0x119dc, 0x119e0, 0x119e4, 0x11a01,
0x11a33, 0x11a39, 0x11a3a, 0x11a3b, 0x11a47, 0x11a51, 0x11a57, 0x11a59, 0x11a84, 0x11a8a, 0x11a97, 0x11a98,
0x11c2f, 0x11c30, 0x11c38, 0x11c3e, 0x11c3f, 0x11c92, 0x11ca9, 0x11caa, 0x11cb1, 0x11cb2, 0x11cb4, 0x11cb5,
0x11d31, 0x11d3a, 0x11d3c, 0x11d3f, 0x11d46, 0x11d47, 0x11d8a, 0x11d90, 0x11d93, 0x11d95, 0x11d96, 0x11d97,
0x11ef3, 0x11ef5, 0x11f00, 0x11f02, 0x11f03, 0x11f34, 0x11f36, 0x11f3e, 0x11f40, 0x11f41, 0x11f42, 0x13430,
0x13440, 0x13447, 0x16af0, 0x16b30, 0x16f4f, 0x16f51, 0x16f8f, 0x16fe4, 0x16ff0, 0x1bc9d, 0x1bca0, 0x1cf00,
0x1cf30, 0x1d165, 0x1d166, 0x1d167, 0x1d16d, 0x1d16e, 0x1d173, 0x1d17b, 0x1d185, 0x1d1aa, 0x1d242, 0x1da00,
0x1da3b, 0x1da75, 0x1da84, 0x1da9b, 0x1daa1, 0x1e000, 0x1e008, 0x1e01b, 0x1e023, 0x1e026, 0x1e08f, 0x1e130,
0x1e2ae, 0x1e2ec, 0x1e4ec, 0x1e8d0, 0x1e944, 0x1f1e6, 0x1f3fb, 0xe0000, 0xe0020, 0xe0080, 0xe0100, 0xe01f0},
{0x100a, 0x4001, 0x1002, 0x1, 0x1012, 0x1021, 0x1001, 0x2070, 0x2007, 0x202d, 0x2001, 0x2002, 0x2002, 0x2001,
0x7006, 0x200b, 0x1001, 0x2015, 0x2001, 0x2007, 0x7001, 0x2006, 0x2002, 0x2004, 0x7001, 0x2001, 0x201b, 0x200b,
0x2009, 0x2001, 0x2004, 0x2009, 0x2003, 0x2005, 0x2003, 0x7002, 0x2008, 0x2018, 0x7001, 0x2020, 0x9001, 0x2001,
0x9001, 0x2001, 0x9003, 0x2008, 0x9004, 0x2001, 0x9002, 0x2007, 0x2002, 0x2001, 0x9002, 0x2001, 0x2001, 0x9002,
0x2004, 0x9002, 0x9002, 0x2001, 0x2001, 0x2002, 0x2001, 0x2002, 0x9001, 0x2001, 0x9003, 0x2002, 0x2002, 0x2003,
0x2001, 0x2002, 0x2001, 0x2002, 0x9001, 0x2001, 0x9003, 0x2005, 0x2002, 0x9001, 0x9002, 0x2001, 0x2002, 0x2006,
0x2001, 0x9002, 0x2001, 0x2002, 0x9001, 0x2004, 0x9002, 0x9002, 0x2001, 0x2003, 0x2002, 0x2001, 0x2001, 0x9001,
0x2001, 0x9002, 0x9003, 0x9003, 0x2001, 0x2001, 0x2001, 0x9003, 0x2001, 0x2001, 0x2003, 0x9004, 0x2003, 0x2004,
0x2002, 0x2002, 0x2001, 0x9002, 0x2001, 0x9001, 0x2001, 0x9002, 0x2001, 0x9002, 0x2001, 0x9002, 0x9002, 0x2002,
0x2002, 0x2002, 0x9001, 0x2002, 0x9002, 0x2002, 0x2001, 0x9002, 0x2004, 0x9003, 0x9003, 0x2001, 0x7001, 0x2001,
0x2002, 0x2001, 0x9002, 0x2001, 0x2001, 0x9002, 0x2003, 0x2001, 0x9007, 0x2001, 0x9002, 0x2001, 0x9001, 0x2007,
0x2008, 0x2001, 0x9001, 0x2009, 0x2007, 0x2002, 0x2001, 0x2001, 0x2001, 0x9002, 0x200e, 0x9001, 0x2005, 0x2002,
0x200b, 0x2024, 0x2001, 0x2004, 0x9001, 0x2006, 0x2002, 0x9002, 0x2002, 0x9002, 0x2002, 0x2003, 0x2004, 0x2001,
0x9001, 0x2002, 0x2001, 0x2001, 0x3060, 0xb048, 0xa058, 0x2003, 0x2003, 0x9001, 0x2002, 0x9001, 0x2002, 0x2002,
0x2002, 0x9001, 0x2007, 0x9008, 0x2001, 0x9002, 0x200b, 0x2001, 0x2003, 0x1001, 0x2001, 0x2002, 0x2001, 0x2003,
0x9004, 0x2002, 0x9003, 0x9002, 0x2001, 0x9006, 0x2003, 0x2002, 0x9002, 0x2001, 0x9001, 0x2001, 0x9001, 0x2007,
0x2001, 0x2001, 0x2008, 0x9006, 0x200a, 0x2001, 0x201f, 0x2004, 0x9001, 0x2007, 0x9001, 0x2001, 0x9005, 0x2001,
0x9002, 0x2009, 0x2002, 0x9001, 0x9001, 0x2004, 0x9002, 0x2002, 0x9001, 0x2003, 0x2001, 0x9001, 0x2002, 0x9003,
0x2001, 0x9001, 0x2003, 0x9002, 0x9008, 0x2008, 0x9002, 0x2002, 0x2003, 0x200d, 0x9001, 0x2007, 0x2001, 0x2001,
0x9001, 0x2002, 0x2040, 0x1001, 0x2001, 0xc001, 0x1002, 0x1007, 0x1010, 0x2021, 0x2003, 0x2001, 0x2020, 0x2006,
0x2002, 0x2004, 0x200a, 0x2002, 0x2002, 0x2001, 0x2001, 0x2001, 0x9002, 0x2002, 0x9001, 0x2001, 0x9002, 0x9010,
0x2002, 0x2012, 0x2001, 0x2008, 0x200b, 0x9002, 0x301d, 0x2003, 0x9001, 0x2001, 0x9002, 0x2004, 0x9002, 0x2002,
0x9003, 0x2001, 0x2006, 0x9002, 0x2002, 0x9002, 0x2002, 0x2001, 0x2001, 0x9001, 0x2001, 0x2001, 0x2003, 0x2002,
0x2002, 0x2001, 0x9001, 0x2002, 0x9002, 0x9001, 0x2001, 0x9002, 0x2001, 0x9002, 0x2001, 0x9002, 0x9001, 0x2001,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b, 0x5001, 0x601b,
0xb017, 0xa031, 0x2001, 0x2010, 0x2010, 0x1001, 0x2002, 0x100c, 0x2001, 0x2001, 0x2005, 0x2003, 0x2002, 0x2004,
0x2003, 0x2001, 0x2002, 0x2004, 0x2002, 0x2003, 0x200b, 0x2004, 0x9001, 0x2001, 0x9001, 0x200f, 0x2001, 0x2002,
0x2003, 0x9001, 0x9003, 0x2004, 0x9002, 0x2002, 0x7001, 0x2001, 0x7001, 0x2003, 0x2005, 0x9001, 0x2008, 0x9002,
0x2001, 0x2002, 0x9001, 0x9003, 0x2009, 0x9002, 0x7002, 0x2004, 0x9001, 0x2001, 0x9003, 0x2003, 0x9002, 0x2001,
0x9001, 0x2002, 0x2001, 0x2001, 0x2001, 0x9003, 0x2008, 0x2002, 0x9002, 0x2002, 0x2001, 0x9001, 0x2001, 0x9004,
0x9002, 0x9003, 0x2001, 0x9002, 0x2007, 0x2005, 0x9003, 0x2008, 0x9002, 0x2003, 0x9001, 0x2001, 0x2001, 0x2001,
0x9002, 0x2006, 0x9001, 0x2001, 0x9002, 0x2001, 0x9001, 0x2002, 0x9001, 0x2002, 0x2001, 0x9002, 0x2004, 0x9004,
0x2002, 0x9001, 0x2002, 0x2002, 0x9003, 0x2008, 0x9002, 0x2001, 0x9001, 0x2002, 0x2001, 0x9001, 0x2001, 0x9002,
0x2006, 0x9001, 0x2001, 0x2003, 0x2004, 0x9001, 0x2005, 0x9003, 0x2009, 0x9001, 0x2002, 0x2001, 0x9005, 0x9002,
0x2002, 0x9001, 0x2001, 0x7001, 0x9001, 0x7001, 0x9001, 0x2001, 0x9003, 0x2004, 0x2002, 0x9004, 0x2001, 0x9001,
0x200a, 0x2006, 0x9001, 0x7001, 0x2004, 0x2001, 0x2006, 0x9002, 0x2003, 0x7006, 0x200d, 0x9001, 0x2002, 0x9001,
0x2007, 0x2006, 0x9001, 0x2001, 0x2016, 0x9001, 0x2007, 0x9001, 0x2002, 0x9001, 0x2002, 0x2006, 0x2001, 0x2002,
0x2007, 0x7001, 0x2001, 0x9005, 0x2002, 0x9002, 0x2001, 0x9001, 0x2001, 0x2002, 0x9002, 0x2002, 0x7001, 0x9001,
0x9002, 0x2005, 0x9002, 0x2001, 0x9001, 0x2001, 0x1010, 0x2001, 0x200f, 0x2005, 0x2007, 0x2001, 0x9037, 0x2004,
0x2001, 0x9002, 0x2002, 0x1004, 0x202e, 0x2017, 0x2001, 0x9001, 0x2003, 0x9001, 0x2005, 0x1008, 0x2008, 0x2007,
0x2004, 0x2003, 0x2037, 0x2032, 0x2001, 0x2001, 0x2005, 0x200f, 0x2007, 0x2011, 0x2007, 0x2002, 0x2005, 0x2001,
0x2007, 0x2001, 0x2004, 0x2004, 0x2007, 0x2007, 0x801a, 0x2005, 0x1020, 0x2060, 0x1080, 0x20f0, 0x1e10}};
// emoji-data.txt
// Date: 2022-08-02, 00:26:10 GMT
enum class _Extended_Pictographic_property_values : uint8_t { _Extended_Pictographic_value, _No_value = 255 };
// emoji-data.txt
// Date: 2022-08-02, 00:26:10 GMT
inline constexpr _Unicode_property_data<_Extended_Pictographic_property_values, 78, true>
_Extended_Pictographic_property_data{
{0xa9, 0xae, 0x203c, 0x2049, 0x2122, 0x2139, 0x2194, 0x21a9, 0x231a, 0x2328, 0x2388, 0x23cf, 0x23e9, 0x23f8,
0x24c2, 0x25aa, 0x25b6, 0x25c0, 0x25fb, 0x2600, 0x2607, 0x2614, 0x2690, 0x2708, 0x2714, 0x2716, 0x271d,
0x2721, 0x2728, 0x2733, 0x2744, 0x2747, 0x274c, 0x274e, 0x2753, 0x2757, 0x2763, 0x2795, 0x27a1, 0x27b0,
0x27bf, 0x2934, 0x2b05, 0x2b1b, 0x2b50, 0x2b55, 0x3030, 0x303d, 0x3297, 0x3299, 0x1f000, 0x1f10d, 0x1f12f,
0x1f16c, 0x1f17e, 0x1f18e, 0x1f191, 0x1f1ad, 0x1f201, 0x1f21a, 0x1f22f, 0x1f232, 0x1f23c, 0x1f249, 0x1f400,
0x1f546, 0x1f680, 0x1f774, 0x1f7d5, 0x1f80c, 0x1f848, 0x1f85a, 0x1f888, 0x1f8ae, 0x1f90c, 0x1f93c, 0x1f947,
0x1fc00},
{0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x6, 0x2, 0x2, 0x1, 0x1, 0x1, 0xb, 0x3, 0x1, 0x2, 0x1, 0x1, 0x4, 0x6, 0xc, 0x72,
0x76, 0xb, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x1, 0x1, 0x1, 0x1, 0x3, 0x1, 0x5, 0x3, 0x1, 0x1, 0x1, 0x2, 0x3,
0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x100, 0x3, 0x1, 0x6, 0x2, 0x1, 0xa, 0x39, 0xf, 0x1, 0x1, 0x9, 0x4,
0x1b2, 0x13e, 0x10a, 0x80, 0xc, 0x2b, 0x4, 0x8, 0x6, 0x8, 0x52, 0x2f, 0xa, 0x1b9, 0x3fe}};
// DerivedGeneralCategory-15.0.0.txt
// Date: 2022-04-26, 23:14:35 GMT
enum class __printable_property_values : uint8_t { _Yes_value, _No_value = 255 };
// DerivedGeneralCategory-15.0.0.txt
// Date: 2022-04-26, 23:14:35 GMT
inline constexpr _Unicode_property_data<__printable_property_values, 711, true> __printable_property_data{
{0x20, 0xa1, 0xae, 0x37a, 0x384, 0x38c, 0x38e, 0x3a3, 0x531, 0x559, 0x58d, 0x591, 0x5d0, 0x5ef, 0x606, 0x61d, 0x6de,
0x710, 0x74d, 0x7c0, 0x7fd, 0x830, 0x840, 0x85e, 0x860, 0x870, 0x898, 0x8e3, 0x985, 0x98f, 0x993, 0x9aa, 0x9b2,
0x9b6, 0x9bc, 0x9c7, 0x9cb, 0x9d7, 0x9dc, 0x9df, 0x9e6, 0xa01, 0xa05, 0xa0f, 0xa13, 0xa2a, 0xa32, 0xa35, 0xa38,
0xa3c, 0xa3e, 0xa47, 0xa4b, 0xa51, 0xa59, 0xa5e, 0xa66, 0xa81, 0xa85, 0xa8f, 0xa93, 0xaaa, 0xab2, 0xab5, 0xabc,
0xac7, 0xacb, 0xad0, 0xae0, 0xae6, 0xaf9, 0xb01, 0xb05, 0xb0f, 0xb13, 0xb2a, 0xb32, 0xb35, 0xb3c, 0xb47, 0xb4b,
0xb55, 0xb5c, 0xb5f, 0xb66, 0xb82, 0xb85, 0xb8e, 0xb92, 0xb99, 0xb9c, 0xb9e, 0xba3, 0xba8, 0xbae, 0xbbe, 0xbc6,
0xbca, 0xbd0, 0xbd7, 0xbe6, 0xc00, 0xc0e, 0xc12, 0xc2a, 0xc3c, 0xc46, 0xc4a, 0xc55, 0xc58, 0xc5d, 0xc60, 0xc66,
0xc77, 0xc8e, 0xc92, 0xcaa, 0xcb5, 0xcbc, 0xcc6, 0xcca, 0xcd5, 0xcdd, 0xce0, 0xce6, 0xcf1, 0xd00, 0xd0e, 0xd12,
0xd46, 0xd4a, 0xd54, 0xd66, 0xd81, 0xd85, 0xd9a, 0xdb3, 0xdbd, 0xdc0, 0xdca, 0xdcf, 0xdd6, 0xdd8, 0xde6, 0xdf2,
0xe01, 0xe3f, 0xe81, 0xe84, 0xe86, 0xe8c, 0xea5, 0xea7, 0xec0, 0xec6, 0xec8, 0xed0, 0xedc, 0xf00, 0xf49, 0xf71,
0xf99, 0xfbe, 0xfce, 0x1000, 0x10c7, 0x10cd, 0x10d0, 0x124a, 0x1250, 0x1258, 0x125a, 0x1260, 0x128a, 0x1290,
0x12b2, 0x12b8, 0x12c0, 0x12c2, 0x12c8, 0x12d8, 0x1312, 0x1318, 0x135d, 0x1380, 0x13a0, 0x13f8, 0x1400, 0x1681,
0x16a0, 0x1700, 0x171f, 0x1740, 0x1760, 0x176e, 0x1772, 0x1780, 0x17e0, 0x17f0, 0x1800, 0x180f, 0x1820, 0x1880,
0x18b0, 0x1900, 0x1920, 0x1930, 0x1940, 0x1944, 0x1970, 0x1980, 0x19b0, 0x19d0, 0x19de, 0x1a1e, 0x1a60, 0x1a7f,
0x1a90, 0x1aa0, 0x1ab0, 0x1b00, 0x1b50, 0x1b80, 0x1bfc, 0x1c3b, 0x1c4d, 0x1c90, 0x1cbd, 0x1cd0, 0x1d00, 0x1f18,
0x1f20, 0x1f48, 0x1f50, 0x1f59, 0x1f5b, 0x1f5d, 0x1f5f, 0x1f80, 0x1fb6, 0x1fc6, 0x1fd6, 0x1fdd, 0x1ff2, 0x1ff6,
0x2010, 0x2030, 0x2070, 0x2074, 0x2090, 0x20a0, 0x20d0, 0x2100, 0x2190, 0x2440, 0x2460, 0x2b76, 0x2b97, 0x2cf9,
0x2d27, 0x2d2d, 0x2d30, 0x2d6f, 0x2d7f, 0x2da0, 0x2da8, 0x2db0, 0x2db8, 0x2dc0, 0x2dc8, 0x2dd0, 0x2dd8, 0x2de0,
0x2e80, 0x2e9b, 0x2f00, 0x2ff0, 0x3001, 0x3041, 0x3099, 0x3105, 0x3131, 0x3190, 0x31f0, 0x3220, 0xa490, 0xa4d0,
0xa640, 0xa700, 0xa7d0, 0xa7d3, 0xa7d5, 0xa7f2, 0xa830, 0xa840, 0xa880, 0xa8ce, 0xa8e0, 0xa95f, 0xa980, 0xa9cf,
0xa9de, 0xaa00, 0xaa40, 0xaa50, 0xaa5c, 0xaadb, 0xab01, 0xab09, 0xab11, 0xab20, 0xab28, 0xab30, 0xab70, 0xabf0,
0xac00, 0xd7b0, 0xd7cb, 0xf900, 0xfa70, 0xfb00, 0xfb13, 0xfb1d, 0xfb38, 0xfb3e, 0xfb40, 0xfb43, 0xfb46, 0xfbd3,
0xfd92, 0xfdcf, 0xfdf0, 0xfe20, 0xfe54, 0xfe68, 0xfe70, 0xfe76, 0xff01, 0xffc2, 0xffca, 0xffd2, 0xffda, 0xffe0,
0xffe8, 0xfffc, 0x10000, 0x1000d, 0x10028, 0x1003c, 0x1003f, 0x10050, 0x10080, 0x10100, 0x10107, 0x10137,
0x10190, 0x101a0, 0x101d0, 0x10280, 0x102a0, 0x102e0, 0x10300, 0x1032d, 0x10350, 0x10380, 0x1039f, 0x103c8,
0x10400, 0x104a0, 0x104b0, 0x104d8, 0x10500, 0x10530, 0x1056f, 0x1057c, 0x1058c, 0x10594, 0x10597, 0x105a3,
0x105b3, 0x105bb, 0x10600, 0x10740, 0x10760, 0x10780, 0x10787, 0x107b2, 0x10800, 0x10808, 0x1080a, 0x10837,
0x1083c, 0x1083f, 0x10857, 0x108a7, 0x108e0, 0x108f4, 0x108fb, 0x1091f, 0x1093f, 0x10980, 0x109bc, 0x109d2,
0x10a05, 0x10a0c, 0x10a15, 0x10a19, 0x10a38, 0x10a3f, 0x10a50, 0x10a60, 0x10ac0, 0x10aeb, 0x10b00, 0x10b39,
0x10b58, 0x10b78, 0x10b99, 0x10ba9, 0x10c00, 0x10c80, 0x10cc0, 0x10cfa, 0x10d30, 0x10e60, 0x10e80, 0x10eab,
0x10eb0, 0x10efd, 0x10f30, 0x10f70, 0x10fb0, 0x10fe0, 0x11000, 0x11052, 0x1107f, 0x110be, 0x110d0, 0x110f0,
0x11100, 0x11136, 0x11150, 0x11180, 0x111e1, 0x11200, 0x11213, 0x11280, 0x11288, 0x1128a, 0x1128f, 0x1129f,
0x112b0, 0x112f0, 0x11300, 0x11305, 0x1130f, 0x11313, 0x1132a, 0x11332, 0x11335, 0x1133b, 0x11347, 0x1134b,
0x11350, 0x11357, 0x1135d, 0x11366, 0x11370, 0x11400, 0x1145d, 0x11480, 0x114d0, 0x11580, 0x115b8, 0x11600,
0x11650, 0x11660, 0x11680, 0x116c0, 0x11700, 0x1171d, 0x11730, 0x11800, 0x118a0, 0x118ff, 0x11909, 0x1190c,
0x11915, 0x11918, 0x11937, 0x1193b, 0x11950, 0x119a0, 0x119aa, 0x119da, 0x11a00, 0x11a50, 0x11ab0, 0x11b00,
0x11c00, 0x11c0a, 0x11c38, 0x11c50, 0x11c70, 0x11c92, 0x11ca9, 0x11d00, 0x11d08, 0x11d0b, 0x11d3a, 0x11d3c,
0x11d3f, 0x11d50, 0x11d60, 0x11d67, 0x11d6a, 0x11d90, 0x11d93, 0x11da0, 0x11ee0, 0x11f00, 0x11f12, 0x11f3e,
0x11fb0, 0x11fc0, 0x11fff, 0x12400, 0x12470, 0x12480, 0x12f90, 0x13000, 0x13440, 0x14400, 0x16800, 0x16a40,
0x16a60, 0x16a6e, 0x16ac0, 0x16ad0, 0x16af0, 0x16b00, 0x16b50, 0x16b5b, 0x16b63, 0x16b7d, 0x16e40, 0x16f00,
0x16f4f, 0x16f8f, 0x16fe0, 0x16ff0, 0x17000, 0x18800, 0x18d00, 0x1aff0, 0x1aff5, 0x1affd, 0x1b000, 0x1b132,
0x1b150, 0x1b155, 0x1b164, 0x1b170, 0x1bc00, 0x1bc70, 0x1bc80, 0x1bc90, 0x1bc9c, 0x1cf00, 0x1cf30, 0x1cf50,
0x1d000, 0x1d100, 0x1d129, 0x1d17b, 0x1d200, 0x1d2c0, 0x1d2e0, 0x1d300, 0x1d360, 0x1d400, 0x1d456, 0x1d49e,
0x1d4a2, 0x1d4a5, 0x1d4a9, 0x1d4ae, 0x1d4bb, 0x1d4bd, 0x1d4c5, 0x1d507, 0x1d50d, 0x1d516, 0x1d51e, 0x1d53b,
0x1d540, 0x1d546, 0x1d54a, 0x1d552, 0x1d6a8, 0x1d7ce, 0x1da9b, 0x1daa1, 0x1df00, 0x1df25, 0x1e000, 0x1e008,
0x1e01b, 0x1e023, 0x1e026, 0x1e030, 0x1e08f, 0x1e100, 0x1e130, 0x1e140, 0x1e14e, 0x1e290, 0x1e2c0, 0x1e2ff,
0x1e4d0, 0x1e7e0, 0x1e7e8, 0x1e7ed, 0x1e7f0, 0x1e800, 0x1e8c7, 0x1e900, 0x1e950, 0x1e95e, 0x1ec71, 0x1ed01,
0x1ee00, 0x1ee05, 0x1ee21, 0x1ee24, 0x1ee27, 0x1ee29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9, 0x2, 0x6, 0x3d8, 0x11, 0xd, 0x77, 0x5f, 0xc, 0x1, 0xc, 0x38, 0xa, 0x28, 0x1e, 0x2, 0x154, 0xe,
0xd, 0x9, 0x2e, 0x7, 0xe, 0x9, 0x9, 0x93, 0x37, 0xa, 0xa6e0, 0x103a, 0xde, 0x1682, 0x1d31, 0x21e, 0x134b,
0x1060, 0xf0}};
// DerivedCoreProperties-15.0.0.txt
// Date: 2022-08-05, 22:17:05 GMT
enum class _Grapheme_Extend_property_values : uint8_t { _Grapheme_Extend_value, _No_value = 255 };
// DerivedCoreProperties-15.0.0.txt
// Date: 2022-08-05, 22:17:05 GMT
inline constexpr _Unicode_property_data<_Grapheme_Extend_property_values, 363, true> _Grapheme_Extend_property_data{
{0x300, 0x483, 0x591, 0x5bf, 0x5c1, 0x5c4, 0x5c7, 0x610, 0x64b, 0x670, 0x6d6, 0x6df, 0x6e7, 0x6ea, 0x711, 0x730,
0x7a6, 0x7eb, 0x7fd, 0x816, 0x81b, 0x825, 0x829, 0x859, 0x898, 0x8ca, 0x8e3, 0x93a, 0x93c, 0x941, 0x94d, 0x951,
0x962, 0x981, 0x9bc, 0x9be, 0x9c1, 0x9cd, 0x9d7, 0x9e2, 0x9fe, 0xa01, 0xa3c, 0xa41, 0xa47, 0xa4b, 0xa51, 0xa70,
0xa75, 0xa81, 0xabc, 0xac1, 0xac7, 0xacd, 0xae2, 0xafa, 0xb01, 0xb3c, 0xb3e, 0xb41, 0xb4d, 0xb55, 0xb62, 0xb82,
0xbbe, 0xbc0, 0xbcd, 0xbd7, 0xc00, 0xc04, 0xc3c, 0xc3e, 0xc46, 0xc4a, 0xc55, 0xc62, 0xc81, 0xcbc, 0xcbf, 0xcc2,
0xcc6, 0xccc, 0xcd5, 0xce2, 0xd00, 0xd3b, 0xd3e, 0xd41, 0xd4d, 0xd57, 0xd62, 0xd81, 0xdca, 0xdcf, 0xdd2, 0xdd6,
0xddf, 0xe31, 0xe34, 0xe47, 0xeb1, 0xeb4, 0xec8, 0xf18, 0xf35, 0xf37, 0xf39, 0xf71, 0xf80, 0xf86, 0xf8d, 0xf99,
0xfc6, 0x102d, 0x1032, 0x1039, 0x103d, 0x1058, 0x105e, 0x1071, 0x1082, 0x1085, 0x108d, 0x109d, 0x135d, 0x1712,
0x1732, 0x1752, 0x1772, 0x17b4, 0x17b7, 0x17c6, 0x17c9, 0x17dd, 0x180b, 0x180f, 0x1885, 0x18a9, 0x1920, 0x1927,
0x1932, 0x1939, 0x1a17, 0x1a1b, 0x1a56, 0x1a58, 0x1a60, 0x1a62, 0x1a65, 0x1a73, 0x1a7f, 0x1ab0, 0x1b00, 0x1b34,
0x1b3c, 0x1b42, 0x1b6b, 0x1b80, 0x1ba2, 0x1ba8, 0x1bab, 0x1be6, 0x1be8, 0x1bed, 0x1bef, 0x1c2c, 0x1c36, 0x1cd0,
0x1cd4, 0x1ce2, 0x1ced, 0x1cf4, 0x1cf8, 0x1dc0, 0x200c, 0x20d0, 0x2cef, 0x2d7f, 0x2de0, 0x302a, 0x3099, 0xa66f,
0xa674, 0xa69e, 0xa6f0, 0xa802, 0xa806, 0xa80b, 0xa825, 0xa82c, 0xa8c4, 0xa8e0, 0xa8ff, 0xa926, 0xa947, 0xa980,
0xa9b3, 0xa9b6, 0xa9bc, 0xa9e5, 0xaa29, 0xaa31, 0xaa35, 0xaa43, 0xaa4c, 0xaa7c, 0xaab0, 0xaab2, 0xaab7, 0xaabe,
0xaac1, 0xaaec, 0xaaf6, 0xabe5, 0xabe8, 0xabed, 0xfb1e, 0xfe00, 0xfe20, 0xff9e, 0x101fd, 0x102e0, 0x10376,
0x10a01, 0x10a05, 0x10a0c, 0x10a38, 0x10a3f, 0x10ae5, 0x10d24, 0x10eab, 0x10efd, 0x10f46, 0x10f82, 0x11001,
0x11038, 0x11070, 0x11073, 0x1107f, 0x110b3, 0x110b9, 0x110c2, 0x11100, 0x11127, 0x1112d, 0x11173, 0x11180,
0x111b6, 0x111c9, 0x111cf, 0x1122f, 0x11234, 0x11236, 0x1123e, 0x11241, 0x112df, 0x112e3, 0x11300, 0x1133b,
0x1133e, 0x11340, 0x11357, 0x11366, 0x11370, 0x11438, 0x11442, 0x11446, 0x1145e, 0x114b0, 0x114b3, 0x114ba,
0x114bd, 0x114bf, 0x114c2, 0x115af, 0x115b2, 0x115bc, 0x115bf, 0x115dc, 0x11633, 0x1163d, 0x1163f, 0x116ab,
0x116ad, 0x116b0, 0x116b7, 0x1171d, 0x11722, 0x11727, 0x1182f, 0x11839, 0x11930, 0x1193b, 0x1193e, 0x11943,
0x119d4, 0x119da, 0x119e0, 0x11a01, 0x11a33, 0x11a3b, 0x11a47, 0x11a51, 0x11a59, 0x11a8a, 0x11a98, 0x11c30,
0x11c38, 0x11c3f, 0x11c92, 0x11caa, 0x11cb2, 0x11cb5, 0x11d31, 0x11d3a, 0x11d3c, 0x11d3f, 0x11d47, 0x11d90,
0x11d95, 0x11d97, 0x11ef3, 0x11f00, 0x11f36, 0x11f40, 0x11f42, 0x13440, 0x13447, 0x16af0, 0x16b30, 0x16f4f,
0x16f8f, 0x16fe4, 0x1bc9d, 0x1cf00, 0x1cf30, 0x1d165, 0x1d167, 0x1d16e, 0x1d17b, 0x1d185, 0x1d1aa, 0x1d242,
0x1da00, 0x1da3b, 0x1da75, 0x1da84, 0x1da9b, 0x1daa1, 0x1e000, 0x1e008, 0x1e01b, 0x1e023, 0x1e026, 0x1e08f,
0x1e130, 0x1e2ae, 0x1e2ec, 0x1e4ec, 0x1e8d0, 0x1e944, 0xe0020, 0xe0100},
{0x70, 0x7, 0x2d, 0x1, 0x2, 0x2, 0x1, 0xb, 0x15, 0x1, 0x7, 0x6, 0x2, 0x4, 0x1, 0x1b, 0xb, 0x9, 0x1, 0x4, 0x9, 0x3,
0x5, 0x3, 0x8, 0x18, 0x20, 0x1, 0x1, 0x8, 0x1, 0x7, 0x2, 0x1, 0x1, 0x1, 0x4, 0x1, 0x1, 0x2, 0x1, 0x2, 0x1, 0x2,
0x2, 0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 0x3, 0x1, 0x2, 0x1, 0x1, 0x1, 0x8, 0x2, 0x2, 0x1, 0x1, 0x1, 0x7, 0x5,
0x8, 0x3, 0x1, 0x1, 0x1, 0x6, 0x1, 0x1, 0x2, 0x2, 0x1, 0x4, 0x2, 0x2, 0x2, 0x8, 0x1, 0x2, 0x1, 0x1, 0x6, 0x1,
0x3, 0x4, 0x5, 0x9, 0x2, 0x1, 0x2, 0x1, 0x1, 0x4, 0x2, 0x1, 0xa, 0x6, 0x4, 0x1, 0x6, 0x3, 0xd, 0x2, 0x7, 0x6,
0x1, 0x16, 0x7, 0x2, 0x2, 0x6, 0x1, 0x2, 0x7, 0x1, 0x2, 0x1, 0x1, 0x2, 0x2, 0x5, 0x1, 0x1, 0x1, 0xf, 0x5, 0x7,
0x1, 0x4, 0x1, 0x2, 0x2e, 0x17, 0x1, 0x3, 0x5, 0x8, 0x7, 0x4, 0x3, 0x37, 0x32, 0x1, 0x1, 0x5, 0xf, 0x7, 0x11,
0x7, 0x2, 0x5, 0x1, 0x7, 0x1, 0x4, 0x4, 0x7, 0x7, 0x60, 0xf0}};
// EastAsianWidth-15.0.0.txt
// Date: 2022-05-24, 17:40:20 GMT [KW, LI]
inline constexpr char32_t _Width_estimate_intervals_v2[] = {0x1100, 0x1160, 0x231a, 0x231c, 0x2329, 0x232b, 0x23e9,
0x23ed, 0x23f0, 0x23f1, 0x23f3, 0x23f4, 0x25fd, 0x25ff, 0x2614, 0x2616, 0x2648, 0x2654, 0x267f, 0x2680, 0x2693,
0x2694, 0x26a1, 0x26a2, 0x26aa, 0x26ac, 0x26bd, 0x26bf, 0x26c4, 0x26c6, 0x26ce, 0x26cf, 0x26d4, 0x26d5, 0x26ea,
0x26eb, 0x26f2, 0x26f4, 0x26f5, 0x26f6, 0x26fa, 0x26fb, 0x26fd, 0x26fe, 0x2705, 0x2706, 0x270a, 0x270c, 0x2728,
0x2729, 0x274c, 0x274d, 0x274e, 0x274f, 0x2753, 0x2756, 0x2757, 0x2758, 0x2795, 0x2798, 0x27b0, 0x27b1, 0x27bf,
0x27c0, 0x2b1b, 0x2b1d, 0x2b50, 0x2b51, 0x2b55, 0x2b56, 0x2e80, 0x2e9a, 0x2e9b, 0x2ef4, 0x2f00, 0x2fd6, 0x2ff0,
0x2ffc, 0x3000, 0x303f, 0x3041, 0x3097, 0x3099, 0x3100, 0x3105, 0x3130, 0x3131, 0x318f, 0x3190, 0x31e4, 0x31f0,
0x321f, 0x3220, 0x3248, 0x3250, 0xa48d, 0xa490, 0xa4c7, 0xa960, 0xa97d, 0xac00, 0xd7a4, 0xf900, 0xfb00, 0xfe10,
0xfe1a, 0xfe30, 0xfe53, 0xfe54, 0xfe67, 0xfe68, 0xfe6c, 0xff01, 0xff61, 0xffe0, 0xffe7, 0x16fe0, 0x16fe5, 0x16ff0,
0x16ff2, 0x17000, 0x187f8, 0x18800, 0x18cd6, 0x18d00, 0x18d09, 0x1aff0, 0x1aff4, 0x1aff5, 0x1affc, 0x1affd, 0x1afff,
0x1b000, 0x1b123, 0x1b132, 0x1b133, 0x1b150, 0x1b153, 0x1b155, 0x1b156, 0x1b164, 0x1b168, 0x1b170, 0x1b2fc, 0x1f004,
0x1f005, 0x1f0cf, 0x1f0d0, 0x1f18e, 0x1f18f, 0x1f191, 0x1f19b, 0x1f200, 0x1f203, 0x1f210, 0x1f23c, 0x1f240, 0x1f249,
0x1f250, 0x1f252, 0x1f260, 0x1f266, 0x1f300, 0x1f650, 0x1f680, 0x1f6c6, 0x1f6cc, 0x1f6cd, 0x1f6d0, 0x1f6d3, 0x1f6d5,
0x1f6d8, 0x1f6dc, 0x1f6e0, 0x1f6eb, 0x1f6ed, 0x1f6f4, 0x1f6fd, 0x1f7e0, 0x1f7ec, 0x1f7f0, 0x1f7f1, 0x1f900, 0x1fa00,
0x1fa70, 0x1fa7d, 0x1fa80, 0x1fa89, 0x1fa90, 0x1fabe, 0x1fabf, 0x1fac6, 0x1face, 0x1fadc, 0x1fae0, 0x1fae9, 0x1faf0,
0x1faf9, 0x20000, 0x2fffe, 0x30000, 0x3fffe};
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_FORMAT_UCD_TABLES_HPP
@@ -0,0 +1,451 @@
// __msvc_formatter.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// NOTE:
// The contents of this header are derived in part from libfmt under the following license:
// Copyright (c) 2012 - present, Victor Zverovich
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// --- Optional exception to the license ---
//
// As an exception, if, as a result of your compiling your source code, portions
// of this Software are embedded into a machine-executable object form of such
// source code, you may redistribute such embedded portions in such object form
// without including the above copyright and permission notices.
#ifndef __MSVC_FORMATTER_HPP
#define __MSVC_FORMATTER_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
#error The contents of <format> are only available with C++20. (Also, you should not include this internal header.)
#endif // !_HAS_CXX20
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <type_traits>
#if _HAS_CXX23
#include <xutility>
#endif // _HAS_CXX23
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
#if _HAS_CXX23
#define _FMT_P2286_BEGIN inline namespace __p2286 {
#define _FMT_P2286_END }
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
#define _FMT_P2286_BEGIN
#define _FMT_P2286_END
#endif // ^^^ !_HAS_CXX23 ^^^
enum class _Fmt_align : uint8_t { _None, _Left, _Right, _Center };
enum class _Fmt_sign : uint8_t { _None, _Plus, _Minus, _Space };
enum class _Basic_format_arg_type : uint8_t {
_None,
_Int_type,
_UInt_type,
_Long_long_type,
_ULong_long_type,
_Bool_type,
_Char_type,
_Float_type,
_Double_type,
_Long_double_type,
_Pointer_type,
_CString_type,
_String_type,
_Custom_type,
};
static_assert(static_cast<int>(_Basic_format_arg_type::_Custom_type) < 16, "must fit in 4-bit bitfield");
#if _HAS_CXX23
_EXPORT_STD template <class _Ty>
constexpr bool enable_nonlocking_formatter_optimization = false;
_NODISCARD consteval bool _Is_debug_enabled_fmt_type(_Basic_format_arg_type _Ty) {
return _Ty == _Basic_format_arg_type::_Char_type || _Ty == _Basic_format_arg_type::_CString_type
|| _Ty == _Basic_format_arg_type::_String_type;
}
#endif // _HAS_CXX23
template <class _CharT>
struct _Basic_format_specs {
int _Width = 0;
int _Precision = -1;
char _Type = '\0';
_Fmt_align _Alignment = _Fmt_align::_None;
_Fmt_sign _Sgn = _Fmt_sign::_None;
bool _Alt = false;
bool _Localized = false;
bool _Leading_zero = false;
uint8_t _Fill_length = 1;
// At most one codepoint (so one char32_t or four utf-8 char8_t).
_CharT _Fill[4 / sizeof(_CharT)] = {_CharT{' '}};
};
// Adds width and precision references to _Basic_format_specs.
// This is required for std::formatter implementations because we must
// parse the format specs without having access to the format args (via a format context).
template <class _CharT>
struct _Dynamic_format_specs : _Basic_format_specs<_CharT> {
int _Dynamic_width_index = -1;
int _Dynamic_precision_index = -1;
};
[[noreturn]] inline void _Throw_format_error(const char* _Message);
_EXPORT_STD template <class _CharT>
class basic_format_parse_context;
template <class _CharT>
concept _Format_supported_charT = _Is_any_of_v<_CharT, char, wchar_t>;
_EXPORT_STD template <class _Ty, class _CharT = char>
struct formatter {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
_FMT_P2286_BEGIN
// TRANSITION, VSO-1236041: Avoid declaring and defining member functions in different headers.
template <_Basic_format_arg_type _ArgType, class _CharT, class _Pc>
constexpr _Pc::iterator _Formatter_base_parse(_Dynamic_format_specs<_CharT>& _Specs, _Pc& _ParseCtx);
template <class _Ty, class _CharT, class _FormatContext>
_FormatContext::iterator _Formatter_base_format(
const _Dynamic_format_specs<_CharT>& _Specs, const _Ty& _Val, _FormatContext& _FormatCtx);
template <class _Ty, class _CharT, _Basic_format_arg_type _ArgType>
struct _Formatter_base {
public:
#if _HAS_CXX23
constexpr void _Set_debug_format() noexcept
requires (_Is_debug_enabled_fmt_type(_ArgType))
{
_Specs._Type = '?';
}
#endif // _HAS_CXX23
template <class _Pc = basic_format_parse_context<_CharT>>
constexpr _Pc::iterator parse(type_identity_t<_Pc&> _ParseCtx) {
return _Formatter_base_parse<_ArgType>(_Specs, _ParseCtx);
}
template <class _FormatContext>
_FormatContext::iterator format(const _Ty& _Val, _FormatContext& _FormatCtx) const {
return _Formatter_base_format(_Specs, _Val, _FormatCtx);
}
private:
_Dynamic_format_specs<_CharT> _Specs;
};
_FMT_P2286_END
#if _HAS_CXX23
#define _FORMAT_SPECIALIZE_NONLOCKING_FOR(_Type) \
template <> \
inline constexpr bool enable_nonlocking_formatter_optimization<_Type> = true;
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
#define _FORMAT_SPECIALIZE_NONLOCKING_FOR(_Type)
#endif // ^^^ !_HAS_CXX23 ^^^
#define _FORMAT_SPECIALIZE_FOR(_Type, _ArgType) \
_FORMAT_SPECIALIZE_NONLOCKING_FOR(_Type) \
template <_Format_supported_charT _CharT> \
struct formatter<_Type, _CharT> : _Formatter_base<_Type, _CharT, _ArgType> {}
_FORMAT_SPECIALIZE_FOR(int, _Basic_format_arg_type::_Int_type);
_FORMAT_SPECIALIZE_FOR(unsigned int, _Basic_format_arg_type::_UInt_type);
_FORMAT_SPECIALIZE_FOR(long long, _Basic_format_arg_type::_Long_long_type);
_FORMAT_SPECIALIZE_FOR(unsigned long long, _Basic_format_arg_type::_ULong_long_type);
_FORMAT_SPECIALIZE_FOR(bool, _Basic_format_arg_type::_Bool_type);
_FORMAT_SPECIALIZE_FOR(float, _Basic_format_arg_type::_Float_type);
_FORMAT_SPECIALIZE_FOR(double, _Basic_format_arg_type::_Double_type);
_FORMAT_SPECIALIZE_FOR(long double, _Basic_format_arg_type::_Long_double_type);
_FORMAT_SPECIALIZE_FOR(nullptr_t, _Basic_format_arg_type::_Pointer_type);
_FORMAT_SPECIALIZE_FOR(void*, _Basic_format_arg_type::_Pointer_type);
_FORMAT_SPECIALIZE_FOR(const void*, _Basic_format_arg_type::_Pointer_type);
_FORMAT_SPECIALIZE_FOR(short, _Basic_format_arg_type::_Int_type);
_FORMAT_SPECIALIZE_FOR(unsigned short, _Basic_format_arg_type::_UInt_type);
_FORMAT_SPECIALIZE_FOR(long, _Basic_format_arg_type::_Int_type);
_FORMAT_SPECIALIZE_FOR(unsigned long, _Basic_format_arg_type::_UInt_type);
_FORMAT_SPECIALIZE_FOR(signed char, _Basic_format_arg_type::_Int_type);
_FORMAT_SPECIALIZE_FOR(unsigned char, _Basic_format_arg_type::_UInt_type);
#undef _FORMAT_SPECIALIZE_FOR
#undef _FORMAT_SPECIALIZE_NONLOCKING_FOR
// not using the macro because we'd like to add 'set_debug_format' member function in C++23 mode
template <_Format_supported_charT _CharT>
struct formatter<char, _CharT> : _Formatter_base<char, _CharT, _Basic_format_arg_type::_Char_type> {
#if _HAS_CXX23
constexpr void set_debug_format() noexcept {
this->_Set_debug_format();
}
#endif // _HAS_CXX23
};
// not using the macro because we'd like to avoid the formatter<wchar_t, char> specialization
template <>
struct formatter<wchar_t, wchar_t> : _Formatter_base<wchar_t, wchar_t, _Basic_format_arg_type::_Char_type> {
#if _HAS_CXX23
constexpr void set_debug_format() noexcept {
_Set_debug_format();
}
#endif // _HAS_CXX23
};
// We could use the macro for these specializations, but it's confusing to refer to symbols that are defined
// inside the macro in the macro's "call".
template <_Format_supported_charT _CharT>
struct formatter<_CharT*, _CharT> : _Formatter_base<_CharT*, _CharT, _Basic_format_arg_type::_CString_type> {
#if _HAS_CXX23
constexpr void set_debug_format() noexcept {
this->_Set_debug_format();
}
#endif // _HAS_CXX23
};
template <_Format_supported_charT _CharT>
struct formatter<const _CharT*, _CharT>
: _Formatter_base<const _CharT*, _CharT, _Basic_format_arg_type::_CString_type> {
#if _HAS_CXX23
constexpr void set_debug_format() noexcept {
this->_Set_debug_format();
}
#endif // _HAS_CXX23
};
template <_Format_supported_charT _CharT, size_t _Nx>
struct formatter<_CharT[_Nx], _CharT> : _Formatter_base<_CharT[_Nx], _CharT, _Basic_format_arg_type::_CString_type> {
#if _HAS_CXX23
constexpr void set_debug_format() noexcept {
this->_Set_debug_format();
}
#endif // _HAS_CXX23
};
_EXPORT_STD template <class _Elem, class _Traits, class _Alloc>
class basic_string;
_EXPORT_STD template <class _Elem, class _Traits>
class basic_string_view;
template <_Format_supported_charT _CharT, class _Traits, class _Allocator>
struct formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT>
: _Formatter_base<basic_string<_CharT, _Traits, _Allocator>, _CharT, _Basic_format_arg_type::_String_type> {
#if _HAS_CXX23
constexpr void set_debug_format() noexcept {
this->_Set_debug_format();
}
#endif // _HAS_CXX23
};
template <_Format_supported_charT _CharT, class _Traits>
struct formatter<basic_string_view<_CharT, _Traits>, _CharT>
: _Formatter_base<basic_string_view<_CharT, _Traits>, _CharT, _Basic_format_arg_type::_String_type> {
#if _HAS_CXX23
constexpr void set_debug_format() noexcept {
this->_Set_debug_format();
}
#endif // _HAS_CXX23
};
#if _HAS_CXX23
template <>
struct formatter<char*, wchar_t> {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
template <>
struct formatter<const char*, wchar_t> {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
template <size_t _Size>
struct formatter<char[_Size], wchar_t> {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
template <class _Traits, class _Allocator>
struct formatter<basic_string<char, _Traits, _Allocator>, wchar_t> {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
template <class _Traits>
struct formatter<basic_string_view<char, _Traits>, wchar_t> {
formatter() = delete;
formatter(const formatter&) = delete;
formatter& operator=(const formatter&) = delete;
};
_EXPORT_STD enum class range_format { disabled, map, set, sequence, string, debug_string };
template <class _Ty>
struct _Invalid_format_kind {
static_assert(_Always_false<_Ty>, "A program that instantiates the primary template of format_kind is ill-formed. "
"(N4981 [format.range.fmtkind]/1)");
};
_EXPORT_STD template <class _Ty>
constexpr _Invalid_format_kind<_Ty> format_kind;
template <class _Ty>
constexpr bool _Is_two_tuple = false;
template <class _Ty, class _Uty>
constexpr bool _Is_two_tuple<pair<_Ty, _Uty>> = true;
template <class _Ty, class _Uty>
constexpr bool _Is_two_tuple<tuple<_Ty, _Uty>> = true;
template <_RANGES input_range _Rng>
requires same_as<_Rng, remove_cvref_t<_Rng>>
constexpr range_format format_kind<_Rng> = []() consteval {
using _Ref_value_t = remove_cvref_t<_RANGES range_reference_t<_Rng>>;
if constexpr (same_as<_Ref_value_t, _Rng>) {
return range_format::disabled;
} else if constexpr (requires { typename _Rng::key_type; }) {
if constexpr (requires { typename _Rng::mapped_type; } && _Is_two_tuple<_Ref_value_t>) {
return range_format::map;
} else {
return range_format::set;
}
} else {
return range_format::sequence;
}
}();
// Specializations for pairs, tuples, and ranges are forward-declared to avoid any risk of using the disabled primary
// template.
// Per LWG-3997, `_CharT` in library-provided `formatter` specializations is
// constrained to character types supported by `format`.
template <class _Rng>
concept _Formatting_enabled_range = format_kind<_Rng> != range_format::disabled;
template <_RANGES input_range _Rng, _Format_supported_charT _CharT>
requires _Formatting_enabled_range<_Rng>
struct formatter<_Rng, _CharT>;
template <_Format_supported_charT _CharT, class _Ty1, class _Ty2>
struct formatter<pair<_Ty1, _Ty2>, _CharT>;
template <_Format_supported_charT _CharT, class... _Types>
struct formatter<tuple<_Types...>, _CharT>;
template <_Format_supported_charT _CharT>
constexpr bool enable_nonlocking_formatter_optimization<_CharT> = true;
template <_Format_supported_charT _CharT>
constexpr bool enable_nonlocking_formatter_optimization<_CharT*> = true;
template <_Format_supported_charT _CharT>
constexpr bool enable_nonlocking_formatter_optimization<const _CharT*> = true;
template <_Format_supported_charT _CharT, size_t _Nx>
constexpr bool enable_nonlocking_formatter_optimization<_CharT[_Nx]> = true;
template <_Format_supported_charT _CharT, class _Traits, class _Allocator>
constexpr bool enable_nonlocking_formatter_optimization<basic_string<_CharT, _Traits, _Allocator>> = true;
template <_Format_supported_charT _CharT, class _Traits>
constexpr bool enable_nonlocking_formatter_optimization<basic_string_view<_CharT, _Traits>> = true;
template <class _Ty1, class _Ty2>
constexpr bool enable_nonlocking_formatter_optimization<pair<_Ty1, _Ty2>> =
enable_nonlocking_formatter_optimization<_Ty1> && enable_nonlocking_formatter_optimization<_Ty2>;
template <class... _Ts>
constexpr bool enable_nonlocking_formatter_optimization<tuple<_Ts...>> =
(enable_nonlocking_formatter_optimization<_Ts> && ...);
template <class _CharT>
struct _Fill_align_and_width_specs {
int _Width = -1;
int _Dynamic_width_index = -1;
_Fmt_align _Alignment = _Fmt_align::_None;
uint8_t _Fill_length = 1;
// At most one codepoint (so one char32_t or four utf-8 char8_t).
_CharT _Fill[4 / sizeof(_CharT)]{' '};
};
// TRANSITION, VSO-1236041: Avoid declaring and defining member functions in different headers.
template <class _CharT, class _Pc>
_NODISCARD constexpr _Pc::iterator _Fill_align_and_width_formatter_parse(
_Fill_align_and_width_specs<_CharT>& _Specs, _Pc& _Parse_ctx);
template <class _CharT, class _FormatContext, class _Func>
_NODISCARD _FormatContext::iterator _Fill_align_and_width_formatter_format(
const _Fill_align_and_width_specs<_CharT>& _Specs, _FormatContext& _Format_ctx, int _Width,
_Fmt_align _Default_align, _Func&& _Fn);
template <class _CharT>
struct _Fill_align_and_width_formatter {
public:
template <class _ParseContext = basic_format_parse_context<_CharT>> // improves throughput, see GH-5003
_NODISCARD constexpr _ParseContext::iterator _Parse(type_identity_t<_ParseContext&> _Parse_ctx) {
return _STD _Fill_align_and_width_formatter_parse(_Specs, _Parse_ctx);
}
template <class _FormatContext, class _Func>
_NODISCARD constexpr auto _Format(
_FormatContext& _Format_ctx, const int _Width, _Fmt_align _Default_align, _Func&& _Fn) const {
return _STD _Fill_align_and_width_formatter_format(
_Specs, _Format_ctx, _Width, _Default_align, _STD forward<_Func>(_Fn));
}
private:
_Fill_align_and_width_specs<_CharT> _Specs;
};
#endif // _HAS_CXX23
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_FORMATTER_HPP
@@ -0,0 +1,150 @@
// __msvc_heap_algorithms.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_HEAP_ALGORITHMS_HPP
#define __MSVC_HEAP_ALGORITHMS_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <xutility>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
template <class _RanIt, class _Ty, class _Pr>
_CONSTEXPR20 void _Push_heap_by_index(
_RanIt _First, _Iter_diff_t<_RanIt> _Hole, _Iter_diff_t<_RanIt> _Top, _Ty&& _Val, _Pr _Pred) {
// percolate _Hole to _Top or where _Val belongs
using _Diff = _Iter_diff_t<_RanIt>;
for (_Diff _Idx = (_Hole - 1) >> 1; // shift for codegen
_Top < _Hole && _DEBUG_LT_PRED(_Pred, *(_First + _Idx), _Val); _Idx = (_Hole - 1) >> 1) { // shift for codegen
// move _Hole up to parent
*(_First + _Hole) = _STD move(*(_First + _Idx));
_Hole = _Idx;
}
*(_First + _Hole) = _STD forward<_Ty>(_Val); // drop _Val into final hole
}
_EXPORT_STD template <class _RanIt, class _Pr>
_CONSTEXPR20 void push_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) {
// push *(_Last - 1) onto heap at [_First, _Last - 1)
_STD _Adl_verify_range(_First, _Last);
const auto _UFirst = _STD _Get_unwrapped(_First);
auto _ULast = _STD _Get_unwrapped(_Last);
using _Diff = _Iter_diff_t<_RanIt>;
_Diff _Count = _ULast - _UFirst;
if (2 <= _Count) {
_Iter_value_t<_RanIt> _Val(_STD move(*--_ULast));
_STD _Push_heap_by_index(_UFirst, --_Count, _Diff(0), _STD move(_Val), _STD _Pass_fn(_Pred));
}
}
_EXPORT_STD template <class _RanIt>
_CONSTEXPR20 void push_heap(_RanIt _First, _RanIt _Last) {
// push *(_Last - 1) onto heap at [_First, _Last - 1)
_STD push_heap(_First, _Last, less<>{});
}
template <class _RanIt, class _Ty, class _Pr>
_CONSTEXPR20 void _Pop_heap_hole_by_index(
_RanIt _First, _Iter_diff_t<_RanIt> _Hole, _Iter_diff_t<_RanIt> _Bottom, _Ty&& _Val, _Pr _Pred) {
// percolate _Hole to _Bottom, then push _Val
_STL_INTERNAL_CHECK(_Bottom > 0);
using _Diff = _Iter_diff_t<_RanIt>;
const _Diff _Top = _Hole;
_Diff _Idx = _Hole;
// Check whether _Idx can have a child before calculating that child's index, since
// calculating the child's index can trigger integer overflows
const _Diff _Max_sequence_non_leaf = (_Bottom - 1) >> 1; // shift for codegen
while (_Idx < _Max_sequence_non_leaf) { // move _Hole down to larger child
_Idx = 2 * _Idx + 2;
if (_DEBUG_LT_PRED(_Pred, *(_First + _Idx), *(_First + (_Idx - 1)))) {
--_Idx;
}
*(_First + _Hole) = _STD move(*(_First + _Idx));
_Hole = _Idx;
}
if (_Idx == _Max_sequence_non_leaf && _Bottom % 2 == 0) { // only child at bottom, move _Hole down to it
*(_First + _Hole) = _STD move(*(_First + (_Bottom - 1)));
_Hole = _Bottom - 1;
}
_STD _Push_heap_by_index(_First, _Hole, _Top, _STD forward<_Ty>(_Val), _Pred);
}
template <class _RanIt, class _Ty, class _Pr>
_CONSTEXPR20 void _Pop_heap_hole_unchecked(_RanIt _First, _RanIt _Last, _RanIt _Dest, _Ty&& _Val, _Pr _Pred) {
// pop *_First to *_Dest and reheap
// precondition: _First != _Last
// precondition: _First != _Dest
*_Dest = _STD move(*_First);
using _Diff = _Iter_diff_t<_RanIt>;
_STD _Pop_heap_hole_by_index(
_First, static_cast<_Diff>(0), static_cast<_Diff>(_Last - _First), _STD forward<_Ty>(_Val), _Pred);
}
template <class _RanIt, class _Pr>
_CONSTEXPR20 void _Pop_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) {
// pop *_First to *(_Last - 1) and reheap
if (2 <= _Last - _First) {
--_Last;
_Iter_value_t<_RanIt> _Val(_STD move(*_Last));
_STD _Pop_heap_hole_unchecked(_First, _Last, _Last, _STD move(_Val), _Pred);
}
}
_EXPORT_STD template <class _RanIt, class _Pr>
_CONSTEXPR20 void pop_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) {
// pop *_First to *(_Last - 1) and reheap
_STD _Adl_verify_range(_First, _Last);
_STD _Pop_heap_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last), _STD _Pass_fn(_Pred));
}
_EXPORT_STD template <class _RanIt>
_CONSTEXPR20 void pop_heap(_RanIt _First, _RanIt _Last) {
// pop *_First to *(_Last - 1) and reheap
_STD pop_heap(_First, _Last, less<>{});
}
template <class _RanIt, class _Pr>
_CONSTEXPR20 void _Make_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) {
// make [_First, _Last) into a heap
using _Diff = _Iter_diff_t<_RanIt>;
_Diff _Bottom = _Last - _First;
for (_Diff _Hole = _Bottom >> 1; _Hole > 0;) { // shift for codegen
// reheap top half, bottom to top
--_Hole;
_Iter_value_t<_RanIt> _Val(_STD move(*(_First + _Hole)));
_STD _Pop_heap_hole_by_index(_First, _Hole, _Bottom, _STD move(_Val), _Pred);
}
}
_EXPORT_STD template <class _RanIt, class _Pr>
_CONSTEXPR20 void make_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // make [_First, _Last) into a heap
_STD _Adl_verify_range(_First, _Last);
_STD _Make_heap_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last), _STD _Pass_fn(_Pred));
}
_EXPORT_STD template <class _RanIt>
_CONSTEXPR20 void make_heap(_RanIt _First, _RanIt _Last) { // make [_First, _Last) into a heap
_STD make_heap(_First, _Last, less<>{});
}
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_HEAP_ALGORITHMS_HPP
@@ -0,0 +1,550 @@
// __msvc_iter_core.hpp internal header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_ITER_CORE_HPP
#define __MSVC_ITER_CORE_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <utility>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
template <class _Ty, class _Alloc, class = void>
struct _Has_allocator_type : false_type {}; // tests for suitable _Ty::allocator_type
template <class _Ty, class _Alloc>
struct _Has_allocator_type<_Ty, _Alloc, void_t<typename _Ty::allocator_type>>
: is_convertible<_Alloc, typename _Ty::allocator_type>::type {};
_EXPORT_STD struct allocator_arg_t { // tag type for added allocator argument
explicit allocator_arg_t() = default;
};
_EXPORT_STD _INLINE_VAR constexpr allocator_arg_t allocator_arg{};
_EXPORT_STD template <class _Ty, class _Alloc>
struct uses_allocator : _Has_allocator_type<_Ty, _Alloc>::type {};
_EXPORT_STD template <class _Ty, class _Alloc>
constexpr bool uses_allocator_v = uses_allocator<_Ty, _Alloc>::value;
// from <iterator>
_EXPORT_STD struct input_iterator_tag {};
_EXPORT_STD struct output_iterator_tag {};
_EXPORT_STD struct forward_iterator_tag : input_iterator_tag {};
_EXPORT_STD struct bidirectional_iterator_tag : forward_iterator_tag {};
_EXPORT_STD struct random_access_iterator_tag : bidirectional_iterator_tag {};
#if _HAS_CXX20
_EXPORT_STD struct contiguous_iterator_tag : random_access_iterator_tag {};
template <class _Ty>
using _With_reference = _Ty&;
template <class _Ty>
concept _Can_reference = requires { typename _With_reference<_Ty>; };
template <class _Ty>
concept _Dereferenceable = requires(_Ty& __t) {
{ *__t } -> _Can_reference;
};
template <class _Ty>
concept _Has_member_iterator_concept = requires { typename _Ty::iterator_concept; };
template <class _Ty>
concept _Has_member_iterator_category = requires { typename _Ty::iterator_category; };
template <class _Ty>
concept _Has_member_value_type = requires { typename _Ty::value_type; };
template <class _Ty>
concept _Has_member_element_type = requires { typename _Ty::element_type; };
template <class _Ty>
concept _Has_member_difference_type = requires { typename _Ty::difference_type; };
template <class _Ty>
concept _Has_member_pointer = requires { typename _Ty::pointer; };
template <class _Ty>
concept _Has_member_reference = requires { typename _Ty::reference; };
_EXPORT_STD template <class>
struct incrementable_traits {};
template <class _Ty>
requires is_object_v<_Ty>
struct incrementable_traits<_Ty*> {
using difference_type = ptrdiff_t;
};
template <class _Ty>
struct incrementable_traits<const _Ty> : incrementable_traits<_Ty> {};
template <_Has_member_difference_type _Ty>
struct incrementable_traits<_Ty> {
using difference_type = _Ty::difference_type;
};
template <class _Ty>
concept _Can_difference = requires(const _Ty& __a, const _Ty& __b) {
{ __a - __b } -> integral;
};
template <class _Ty>
requires (!_Has_member_difference_type<_Ty> && _Can_difference<_Ty>)
struct incrementable_traits<_Ty> {
using difference_type = make_signed_t<decltype(_STD declval<_Ty>() - _STD declval<_Ty>())>;
};
template <class _Ty>
concept _Is_from_primary = _Same_impl<typename _Ty::_From_primary, _Ty>;
_EXPORT_STD template <class>
struct iterator_traits;
_EXPORT_STD template <class _Ty>
using iter_difference_t = conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
incrementable_traits<remove_cvref_t<_Ty>>, iterator_traits<remove_cvref_t<_Ty>>>::difference_type;
template <class>
struct _Cond_value_type {};
template <class _Ty>
requires is_object_v<_Ty>
struct _Cond_value_type<_Ty> {
using value_type = remove_cv_t<_Ty>;
};
_EXPORT_STD template <class>
struct indirectly_readable_traits {};
template <class _Ty>
struct indirectly_readable_traits<_Ty*> : _Cond_value_type<_Ty> {};
template <class _Ty>
requires is_array_v<_Ty>
struct indirectly_readable_traits<_Ty> {
using value_type = remove_cv_t<remove_extent_t<_Ty>>;
};
template <class _Ty>
struct indirectly_readable_traits<const _Ty> : indirectly_readable_traits<_Ty> {};
template <_Has_member_value_type _Ty>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_type> {};
template <_Has_member_element_type _Ty>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::element_type> {};
template <_Has_member_value_type _Ty>
requires _Has_member_element_type<_Ty>
struct indirectly_readable_traits<_Ty> {};
template <_Has_member_value_type _Ty>
requires _Has_member_element_type<_Ty>
&& same_as<remove_cv_t<typename _Ty::value_type>, remove_cv_t<typename _Ty::element_type>>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_type> {};
_EXPORT_STD template <class _Ty>
using iter_value_t = conditional_t<_Is_from_primary<iterator_traits<remove_cvref_t<_Ty>>>,
indirectly_readable_traits<remove_cvref_t<_Ty>>, iterator_traits<remove_cvref_t<_Ty>>>::value_type;
_EXPORT_STD template <_Dereferenceable _Ty>
using iter_reference_t = decltype(*_STD declval<_Ty&>());
template <class>
struct _Iterator_traits_base {};
template <class _It>
concept _Has_iter_types = _Has_member_difference_type<_It> && _Has_member_value_type<_It> && _Has_member_reference<_It>
&& _Has_member_iterator_category<_It>;
template <bool _Has_member_typedef>
struct _Old_iter_traits_pointer {
template <class _It>
using _Apply = _It::pointer;
};
template <>
struct _Old_iter_traits_pointer<false> {
template <class>
using _Apply = void;
};
template <_Has_iter_types _It>
struct _Iterator_traits_base<_It> {
using iterator_category = _It::iterator_category;
using value_type = _It::value_type;
using difference_type = _It::difference_type;
using pointer = _Old_iter_traits_pointer<_Has_member_pointer<_It>>::template _Apply<_It>;
using reference = _It::reference;
};
template <bool _Has_member_typedef>
struct _Iter_traits_difference {
template <class _It>
using _Apply = incrementable_traits<_It>::difference_type;
};
template <>
struct _Iter_traits_difference<false> {
template <class>
using _Apply = void;
};
template <class _It>
concept _Cpp17_iterator = requires(_It __i) {
{ *__i } -> _Can_reference;
{ ++__i } -> same_as<_It&>;
{ *__i++ } -> _Can_reference;
} && copyable<_It>;
template <class _It>
concept _Cpp17_input_iterator =
_Cpp17_iterator<_It> && equality_comparable<_It> && _Has_member_difference_type<incrementable_traits<_It>>
&& _Has_member_value_type<indirectly_readable_traits<_It>> && requires(_It __i) {
typename common_reference_t<iter_reference_t<_It>&&, typename indirectly_readable_traits<_It>::value_type&>;
typename common_reference_t<decltype(*__i++)&&, typename indirectly_readable_traits<_It>::value_type&>;
requires signed_integral<typename incrementable_traits<_It>::difference_type>;
};
template <class _It>
requires (!_Has_iter_types<_It> && _Cpp17_iterator<_It> && !_Cpp17_input_iterator<_It>)
struct _Iterator_traits_base<_It> {
using iterator_category = output_iterator_tag;
using value_type = void;
using difference_type =
_Iter_traits_difference<_Has_member_difference_type<incrementable_traits<_It>>>::template _Apply<_It>;
using pointer = void;
using reference = void;
};
enum class _Itraits_pointer_strategy { _Use_void, _Use_member, _Use_decltype };
template <_Itraits_pointer_strategy>
struct _Iter_traits_pointer;
template <>
struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_void> {
template <class>
using _Apply = void;
};
template <>
struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_member> {
template <class _It>
using _Apply = _It::pointer;
};
template <>
struct _Iter_traits_pointer<_Itraits_pointer_strategy::_Use_decltype> {
template <class _It>
using _Apply = decltype(_STD declval<_It&>().operator->());
};
template <class _Ty>
concept _Has_member_arrow = requires(_Ty&& __t) { static_cast<_Ty&&>(__t).operator->(); };
template <bool _Has_member_typedef>
struct _Iter_traits_reference {
template <class _It>
using _Apply = _It::reference;
};
template <>
struct _Iter_traits_reference<false> {
template <class _It>
using _Apply = iter_reference_t<_It>;
};
template <bool _Is_random>
struct _Iter_traits_category4 {
using type = random_access_iterator_tag;
};
template <>
struct _Iter_traits_category4<false> {
using type = bidirectional_iterator_tag;
};
template <class _It>
concept _Cpp17_random_delta =
#if defined(__CUDACC__) && !defined(__clang__) // TRANSITION, fixed in CUDA 12.5
totally_ordered<_It> && requires(_It __i, typename incrementable_traits<_It>::difference_type __n) {
#else // ^^^ workaround / no workaround vvv
totally_ordered<_It> && requires(_It __i, incrementable_traits<_It>::difference_type __n) {
#endif // ^^^ no workaround ^^^
{ __i += __n } -> same_as<_It&>;
{ __i -= __n } -> same_as<_It&>;
{ __i + __n } -> same_as<_It>;
{ __n + __i } -> same_as<_It>;
{ __i - __n } -> same_as<_It>;
{ __i - __i } -> same_as<decltype(__n)>;
{ __i[__n] } -> convertible_to<iter_reference_t<_It>>;
};
template <bool _Is_bidi>
struct _Iter_traits_category3 {
template <class _It>
using _Apply = _Iter_traits_category4<_Cpp17_random_delta<_It>>::type;
};
template <>
struct _Iter_traits_category3<false> {
template <class>
using _Apply = forward_iterator_tag;
};
template <class _It>
concept _Cpp17_bidi_delta = requires(_It __i) {
{ --__i } -> same_as<_It&>;
{ __i-- } -> convertible_to<const _It&>;
requires same_as<decltype(*__i--), iter_reference_t<_It>>;
};
template <bool _Is_forward>
struct _Iter_traits_category2 {
template <class _It>
using _Apply = _Iter_traits_category3<_Cpp17_bidi_delta<_It>>::template _Apply<_It>;
};
template <>
struct _Iter_traits_category2<false> {
template <class>
using _Apply = input_iterator_tag;
};
template <class _It>
concept _Cpp17_forward_delta =
constructible_from<_It> && is_reference_v<iter_reference_t<_It>>
&& same_as<remove_cvref_t<iter_reference_t<_It>>, typename indirectly_readable_traits<_It>::value_type>
&& requires(_It __i) {
{ __i++ } -> convertible_to<const _It&>;
requires same_as<decltype(*__i++), iter_reference_t<_It>>;
};
template <bool _Has_member_typedef>
struct _Iter_traits_category {
template <class _It>
using _Apply = _It::iterator_category;
};
template <>
struct _Iter_traits_category<false> {
template <class _It>
using _Apply = _Iter_traits_category2<_Cpp17_forward_delta<_It>>::template _Apply<_It>;
};
template <class _It>
requires (!_Has_iter_types<_It> && _Cpp17_input_iterator<_It>)
struct _Iterator_traits_base<_It> {
using iterator_category = _Iter_traits_category<_Has_member_iterator_category<_It>>::template _Apply<_It>;
using value_type = indirectly_readable_traits<_It>::value_type;
using difference_type = incrementable_traits<_It>::difference_type;
using pointer =
_Iter_traits_pointer<(_Has_member_pointer<_It> ? _Itraits_pointer_strategy::_Use_member
: _Has_member_arrow<_It&> ? _Itraits_pointer_strategy::_Use_decltype
: _Itraits_pointer_strategy::_Use_void)>::template _Apply<_It>;
using reference = _Iter_traits_reference<_Has_member_reference<_It>>::template _Apply<_It>;
};
_EXPORT_STD template <class _Ty>
struct iterator_traits : _Iterator_traits_base<_Ty> {
using _From_primary = iterator_traits;
};
template <class _Ty>
requires is_object_v<_Ty>
struct iterator_traits<_Ty*> {
using iterator_concept = contiguous_iterator_tag;
using iterator_category = random_access_iterator_tag;
using value_type = remove_cv_t<_Ty>;
using difference_type = ptrdiff_t;
using pointer = _Ty*;
using reference = _Ty&;
};
template <class _Ty>
constexpr bool _Integer_class = requires {
typename _Ty::_Signed_type;
typename _Ty::_Unsigned_type;
};
template <class _Ty>
concept _Integer_like = _Is_nonbool_integral<_Ty> || _Integer_class<_Ty>;
template <class _Ty>
concept _Signed_integer_like = _Integer_like<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0);
_EXPORT_STD template <class _Ty>
concept weakly_incrementable = movable<_Ty> && requires(_Ty __i) {
typename iter_difference_t<_Ty>;
requires _Signed_integer_like<iter_difference_t<_Ty>>;
{ ++__i } -> same_as<_Ty&>;
__i++;
};
_EXPORT_STD template <class _It>
concept input_or_output_iterator = requires(_It __i) {
{ *__i } -> _Can_reference;
} && weakly_incrementable<_It>;
_EXPORT_STD template <class _Se, class _It>
concept sentinel_for = semiregular<_Se> && input_or_output_iterator<_It> && _Weakly_equality_comparable_with<_Se, _It>;
_EXPORT_STD template <class _Se, class _It>
constexpr bool disable_sized_sentinel_for = false;
_EXPORT_STD template <class _Se, class _It>
concept sized_sentinel_for = sentinel_for<_Se, _It> && !disable_sized_sentinel_for<remove_cv_t<_Se>, remove_cv_t<_It>>
&& requires(const _It& __i, const _Se& __s) {
{ __s - __i } -> same_as<iter_difference_t<_It>>;
{ __i - __s } -> same_as<iter_difference_t<_It>>;
};
_EXPORT_STD struct default_sentinel_t {};
_EXPORT_STD inline constexpr default_sentinel_t default_sentinel{};
namespace ranges {
_EXPORT_STD enum class subrange_kind : bool { unsized, sized };
_EXPORT_STD template <input_or_output_iterator _It, sentinel_for<_It> _Se = _It,
subrange_kind _Ki = sized_sentinel_for<_Se, _It> ? subrange_kind::sized : subrange_kind::unsized>
requires (_Ki == subrange_kind::sized || !sized_sentinel_for<_Se, _It>)
class subrange;
_EXPORT_STD template <size_t _Idx, class _It, class _Se, subrange_kind _Ki>
requires ((_Idx == 0 && copyable<_It>) || _Idx == 1)
_NODISCARD constexpr auto get(const subrange<_It, _Se, _Ki>& _Val);
_EXPORT_STD template <size_t _Idx, class _It, class _Se, subrange_kind _Ki>
requires (_Idx < 2)
_NODISCARD constexpr auto get(subrange<_It, _Se, _Ki>&& _Val);
} // namespace ranges
_EXPORT_STD using ranges::get;
template <class _It, class _Se, ranges::subrange_kind _Ki>
constexpr bool _Is_subrange_v<ranges::subrange<_It, _Se, _Ki>> = true;
template <class _It, class _Se, ranges::subrange_kind _Ki>
struct tuple_size<ranges::subrange<_It, _Se, _Ki>> : integral_constant<size_t, 2> {};
template <class _It, class _Se, ranges::subrange_kind _Ki>
struct tuple_element<0, ranges::subrange<_It, _Se, _Ki>> {
using type = _It;
};
template <class _It, class _Se, ranges::subrange_kind _Ki>
struct tuple_element<1, ranges::subrange<_It, _Se, _Ki>> {
using type = _Se;
};
template <class _It, class _Se, ranges::subrange_kind _Ki>
struct tuple_element<0, const ranges::subrange<_It, _Se, _Ki>> {
using type = _It;
};
template <class _It, class _Se, ranges::subrange_kind _Ki>
struct tuple_element<1, const ranges::subrange<_It, _Se, _Ki>> {
using type = _Se;
};
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
template <class, class = void>
struct _Iterator_traits_base {}; // empty for non-iterators
template <class _Iter>
struct _Iterator_traits_base<_Iter,
void_t<typename _Iter::iterator_category, typename _Iter::value_type, typename _Iter::difference_type,
typename _Iter::pointer, typename _Iter::reference>> {
// defined if _Iter::* types exist
using iterator_category = typename _Iter::iterator_category;
using value_type = typename _Iter::value_type;
using difference_type = typename _Iter::difference_type;
using pointer = typename _Iter::pointer;
using reference = typename _Iter::reference;
};
template <class _Ty, bool = is_object_v<_Ty>>
struct _Iterator_traits_pointer_base { // iterator properties for pointers to object
using iterator_category = random_access_iterator_tag;
using value_type = remove_cv_t<_Ty>;
using difference_type = ptrdiff_t;
using pointer = _Ty*;
using reference = _Ty&;
};
template <class _Ty>
struct _Iterator_traits_pointer_base<_Ty, false> {}; // iterator non-properties for pointers to non-object
template <class _Iter>
struct iterator_traits : _Iterator_traits_base<_Iter> {}; // get traits from iterator _Iter, if possible
template <class _Ty>
struct iterator_traits<_Ty*> : _Iterator_traits_pointer_base<_Ty> {}; // get traits from pointer, if possible
template <class _Ty>
constexpr bool _Integer_like = _Is_nonbool_integral<_Ty>;
#endif // ^^^ !_HAS_CXX20 ^^^
_INLINE_VAR constexpr auto _Meta_npos = ~size_t{0};
constexpr size_t _Meta_find_index_i_(const bool* const _Ptr, const size_t _Count, size_t _Idx = 0) {
// return the index of the first true in the _Count bools at _Ptr, or _Meta_npos if all are false
for (; _Idx < _Count; ++_Idx) {
if (_Ptr[_Idx]) {
return _Idx;
}
}
return _Meta_npos;
}
template <class _List, class _Ty>
struct _Meta_find_unique_index_ {
using type = integral_constant<size_t, _Meta_npos>;
};
template <class _List, class _Ty>
using _Meta_find_unique_index =
// The index of _Ty in _List if it occurs exactly once, otherwise _Meta_npos
typename _Meta_find_unique_index_<_List, _Ty>::type;
constexpr size_t _Meta_find_unique_index_i_2(const bool* const _Ptr, const size_t _Count, const size_t _First) {
// return _First if there is no _First < j < _Count such that _Ptr[j] is true, otherwise _Meta_npos
return _First != _Meta_npos && _STD _Meta_find_index_i_(_Ptr, _Count, _First + 1) == _Meta_npos ? _First
: _Meta_npos;
}
constexpr size_t _Meta_find_unique_index_i_(const bool* const _Ptr, const size_t _Count) {
// Pass the smallest i such that _Ptr[i] is true to _Meta_find_unique_index_i_2
return _STD _Meta_find_unique_index_i_2(_Ptr, _Count, _STD _Meta_find_index_i_(_Ptr, _Count));
}
template <template <class...> class _List, class _First, class... _Rest, class _Ty>
struct _Meta_find_unique_index_<_List<_First, _Rest...>, _Ty> {
static constexpr bool _Bools[] = {is_same_v<_First, _Ty>, is_same_v<_Rest, _Ty>...};
using type = integral_constant<size_t, _STD _Meta_find_unique_index_i_(_Bools, 1 + sizeof...(_Rest))>;
};
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_ITER_CORE_HPP
@@ -0,0 +1,86 @@
// __msvc_minmax.hpp internal header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_MINMAX_HPP
#define __MSVC_MINMAX_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstdint>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
extern "C" {
struct _Min_max_element_t {
const void* _Min;
const void* _Max;
};
struct _Min_max_1i {
int8_t _Min;
int8_t _Max;
};
struct _Min_max_1u {
uint8_t _Min;
uint8_t _Max;
};
struct _Min_max_2i {
int16_t _Min;
int16_t _Max;
};
struct _Min_max_2u {
uint16_t _Min;
uint16_t _Max;
};
struct _Min_max_4i {
int32_t _Min;
int32_t _Max;
};
struct _Min_max_4u {
uint32_t _Min;
uint32_t _Max;
};
struct _Min_max_8i {
int64_t _Min;
int64_t _Max;
};
struct _Min_max_8u {
uint64_t _Min;
uint64_t _Max;
};
struct _Min_max_f {
float _Min;
float _Max;
};
struct _Min_max_d {
double _Min;
double _Max;
};
struct _Min_max_p {
void* _Min;
void* _Max;
};
} // extern "C"
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_MINMAX_HPP
@@ -0,0 +1,81 @@
// __msvc_print.hpp internal header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_PRINT_HPP
#define __MSVC_PRINT_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20 // note: <format> includes this header in C++20 mode
#error The contents of <print> are available only with C++23. (Also, you should not include this internal header.)
#endif // ^^^ !_HAS_CXX20 ^^^
#include <cstdio>
#include <xfilesystem_abi.h>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
extern "C" {
enum class __std_unicode_console_handle : intptr_t { _Invalid = -1 };
struct __std_unicode_console_retrieval_result {
__std_unicode_console_handle _Console_handle;
// For this, we have a few potential return values:
//
// - __std_win_error::_Success: The operation completed successfully. This is the only value for which the
// _Console_handle field has a well-defined value.
//
// - __std_win_error::_File_not_found: The FILE* provided is valid, but it is determined to not be associated
// with a unicode console. In this case, printing should fall back to vprint_nonunicode().
//
// - __std_win_error::_Not_supported: The FILE* provided does not actually have an associated output stream. In
// this case, the entire print can safely be elided, thanks to the "as-if" rule.
// (We haven't observed this happening in practice. Console applications with stdout redirected to NUL
// and Windows applications both appear to activate the __std_win_error::_File_not_found "valid, but
// not a unicode console" codepath.)
//
// - __std_win_error::_Invalid_parameter: The FILE* provided is invalid. A std::system_error exception should be
// thrown if this value is returned within the FILE* overload of vprint_unicode().
__std_win_error _Error;
};
_NODISCARD _Success_(return._Error == __std_win_error::_Success) __std_unicode_console_retrieval_result
__stdcall __std_get_unicode_console_handle_from_file_stream(_In_ FILE* _Stream) noexcept;
_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error
__stdcall __std_print_to_unicode_console(_In_ __std_unicode_console_handle _Console_handle,
_In_reads_(_Str_size) const char* _Str, _In_ size_t _Str_size) noexcept;
_NODISCARD _Success_(return == __std_win_error::_Success) __std_win_error
__stdcall __std_print_newline_only_to_unicode_console(_In_ __std_unicode_console_handle _Console_handle) noexcept;
} // extern "C"
_STD_BEGIN
_NODISCARD consteval bool _Is_ordinary_literal_encoding_utf8() {
// See: https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
#if defined(_MSVC_EXECUTION_CHARACTER_SET) && _MSVC_EXECUTION_CHARACTER_SET == 65001 // Unicode (UTF-8) == 65001
return true;
#else
return false;
#endif
}
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_PRINT_HPP
@@ -0,0 +1,177 @@
// __msvc_sanitizer_annotate_container.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_SANITIZER_ANNOTATE_CONTAINER_HPP
#define __MSVC_SANITIZER_ANNOTATE_CONTAINER_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
// The following macros change the behavior of this file:
// - _DISABLE_STL_ANNOTATION: Disable ASan annotations in the standard library
// (this will be auto-defined on unsupported platforms)
// + _DISABLE_STRING_ANNOTATION: same, but for only `basic_string`
// + _DISABLE_VECTOR_ANNOTATION: same, but for only `vector`
// - _ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS: Don't auto-disable ASan annotations
// - _ANNOTATE_STL: Even when ASan annotations are disabled, insert the code for annotating into the STL anyways;
// this is useful when building static libraries which may be linked against both ASan and non-ASan binaries.
// + _ANNOTATE_STRING: same, but only for `basic_string`
// + _ANNOTATE_VECTOR: same, but only for `vector`
#if !defined(_DISABLE_STL_ANNOTATION) && !defined(_ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS)
#if defined(_M_ARM64EC) || defined(_M_ARM64) || defined(_M_ARM) || defined(_M_CEE_PURE)
#define _DISABLE_STL_ANNOTATION
#endif // ^^^ unsupported platform ^^^
#endif // ^^^ !defined(_DISABLE_STL_ANNOTATION) && !defined(_ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS) ^^^
#ifdef _DISABLE_STL_ANNOTATION
#ifdef _ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS
#error _ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS and _DISABLE_STL_ANNOTATION are mutually exclusive
#endif // ^^^ defined(_ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS) ^^^
#ifndef _DISABLE_STRING_ANNOTATION
#define _DISABLE_STRING_ANNOTATION
#endif // ^^^ !defined(_DISABLE_STRING_ANNOTATION) ^^^
#ifndef _DISABLE_VECTOR_ANNOTATION
#define _DISABLE_VECTOR_ANNOTATION
#endif // ^^^ !defined(_DISABLE_VECTOR_ANNOTATION) ^^^
#endif // ^^^ defined(_DISABLE_STL_ANNOTATION) ^^^
#ifdef _ANNOTATE_STL
#ifndef _ANNOTATE_STRING
#define _ANNOTATE_STRING
#endif // ^^^ !defined(_ANNOTATE_STRING) ^^^
#ifndef _ANNOTATE_VECTOR
#define _ANNOTATE_VECTOR
#endif // ^^^ !defined(_ANNOTATE_VECTOR) ^^^
#endif // ^^^ defined(_ANNOTATE_STL) ^^^
#ifdef __SANITIZE_ADDRESS__
#define _ACTIVATE_STRING_ANNOTATION
#define _INSERT_STRING_ANNOTATION
#define _ACTIVATE_VECTOR_ANNOTATION
#define _INSERT_VECTOR_ANNOTATION
#elif defined(__clang__) // ^^^ defined(__SANITIZE_ADDRESS__) / defined(__clang__) vvv
#if __has_feature(address_sanitizer)
#define _ACTIVATE_STRING_ANNOTATION
#define _INSERT_STRING_ANNOTATION
#define _ACTIVATE_VECTOR_ANNOTATION
#define _INSERT_VECTOR_ANNOTATION
#pragma comment(linker, "/INFERASANLIBS")
#endif // __has_feature(address_sanitizer)
#endif // ^^^ defined(__clang__) ^^^
#ifdef _DISABLE_STRING_ANNOTATION
#undef _ACTIVATE_STRING_ANNOTATION
#undef _INSERT_STRING_ANNOTATION
#endif // ^^^ defined(_DISABLE_STRING_ANNOTATION) ^^^
#ifdef _DISABLE_VECTOR_ANNOTATION
#undef _ACTIVATE_VECTOR_ANNOTATION
#undef _INSERT_VECTOR_ANNOTATION
#endif // ^^^ defined(_DISABLE_VECTOR_ANNOTATION) ^^^
#ifdef _ANNOTATE_STRING
#define _INSERT_STRING_ANNOTATION
#endif // ^^^ defined(_ANNOTATE_STRING) ^^^
#ifdef _ANNOTATE_VECTOR
#define _INSERT_VECTOR_ANNOTATION
#endif // ^^^ defined(_ANNOTATE_VECTOR) ^^^
#ifndef _INSERT_STRING_ANNOTATION
#pragma detect_mismatch("annotate_string", "0")
#endif // ^^^ !defined(_INSERT_STRING_ANNOTATION) ^^^
#ifndef _INSERT_VECTOR_ANNOTATION
#pragma detect_mismatch("annotate_vector", "0")
#endif // ^^^ !defined(_INSERT_VECTOR_ANNOTATION) ^^^
#ifdef _ACTIVATE_STRING_ANNOTATION
#pragma comment(lib, "stl_asan")
#pragma detect_mismatch("annotate_string", "1")
#endif // ^^^ defined(_ACTIVATE_STRING_ANNOTATION) ^^^
#ifdef _ACTIVATE_VECTOR_ANNOTATION
#pragma comment(lib, "stl_asan")
#pragma detect_mismatch("annotate_vector", "1")
#endif // ^^^ defined(_ACTIVATE_VECTOR_ANNOTATION) ^^^
#undef _ACTIVATE_STRING_ANNOTATION
#undef _ACTIVATE_VECTOR_ANNOTATION
extern "C" {
#ifdef _INSERT_VECTOR_ANNOTATION
extern const bool _Asan_vector_should_annotate;
#endif
#ifdef _INSERT_STRING_ANNOTATION
extern const bool _Asan_string_should_annotate;
#endif
} // extern "C"
#if defined(_INSERT_VECTOR_ANNOTATION) || defined(_INSERT_STRING_ANNOTATION)
extern "C" {
// This must match ASan's primary declaration, which isn't marked `noexcept`.
void __cdecl __sanitizer_annotate_contiguous_container(
const void* _First, const void* _End, const void* _Old_last, const void* _New_last);
} // extern "C"
#ifdef _M_ARM64EC
#pragma comment(linker, \
"/alternatename:#__sanitizer_annotate_contiguous_container=#__sanitizer_annotate_contiguous_container_default")
#pragma comment(linker, \
"/alternatename:__sanitizer_annotate_contiguous_container=__sanitizer_annotate_contiguous_container_default")
#pragma comment(linker, "/alternatename:#_Asan_vector_should_annotate=#_Asan_vector_should_annotate_default")
#pragma comment(linker, "/alternatename:_Asan_vector_should_annotate=_Asan_vector_should_annotate_default")
#pragma comment(linker, "/alternatename:#_Asan_string_should_annotate=#_Asan_string_should_annotate_default")
#pragma comment(linker, "/alternatename:_Asan_string_should_annotate=_Asan_string_should_annotate_default")
#elif defined(_M_HYBRID)
#pragma comment(linker, \
"/alternatename:#__sanitizer_annotate_contiguous_container=#__sanitizer_annotate_contiguous_container_default")
#pragma comment(linker, \
"/alternatename:___sanitizer_annotate_contiguous_container=___sanitizer_annotate_contiguous_container_default")
#pragma comment(linker, "/alternatename:#_Asan_vector_should_annotate=#_Asan_vector_should_annotate_default")
#pragma comment(linker, "/alternatename:__Asan_vector_should_annotate=__Asan_vector_should_annotate_default")
#pragma comment(linker, "/alternatename:#_Asan_string_should_annotate=#_Asan_string_should_annotate_default")
#pragma comment(linker, "/alternatename:__Asan_string_should_annotate=__Asan_string_should_annotate_default")
#elif defined(_M_IX86)
#pragma comment(linker, \
"/alternatename:___sanitizer_annotate_contiguous_container=___sanitizer_annotate_contiguous_container_default")
#pragma comment(linker, "/alternatename:__Asan_vector_should_annotate=__Asan_vector_should_annotate_default")
#pragma comment(linker, "/alternatename:__Asan_string_should_annotate=__Asan_string_should_annotate_default")
#elif defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)
#pragma comment(linker, \
"/alternatename:__sanitizer_annotate_contiguous_container=__sanitizer_annotate_contiguous_container_default")
#pragma comment(linker, "/alternatename:_Asan_vector_should_annotate=_Asan_vector_should_annotate_default")
#pragma comment(linker, "/alternatename:_Asan_string_should_annotate=_Asan_string_should_annotate_default")
#else // ^^^ known architecture / unknown architecture vvv
#error Unknown architecture
#endif // ^^^ unknown architecture ^^^
#endif // ^^^ insert ASan annotations ^^^
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_SANITIZER_ANNOTATE_CONTAINER_HPP
@@ -0,0 +1,40 @@
// __msvc_system_error_abi.hpp internal header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_SYSTEM_ERROR_ABI_HPP
#define __MSVC_SYSTEM_ERROR_ABI_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstddef>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
#ifdef _M_CEE_PURE
#define __CLRCALL_PURE_OR_STDCALL __clrcall
#else
#define __CLRCALL_PURE_OR_STDCALL __stdcall
#endif
extern "C" {
_NODISCARD size_t __CLRCALL_PURE_OR_STDCALL __std_get_string_size_without_trailing_whitespace(
const char* _Str, size_t _Size) noexcept;
_NODISCARD size_t __CLRCALL_PURE_OR_STDCALL __std_system_error_allocate_message(
unsigned long _Message_id, char** _Ptr_str) noexcept;
void __CLRCALL_PURE_OR_STDCALL __std_system_error_deallocate_message(char* _Str) noexcept;
} // extern "C"
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_SYSTEM_ERROR_ABI_HPP
@@ -0,0 +1,100 @@
// __msvc_threads_core.hpp internal header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_THREADS_CORE_HPP
#define __MSVC_THREADS_CORE_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <type_traits>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
extern "C" {
using _Thrd_id_t = unsigned int;
struct _Thrd_t { // thread identifier for Win32
void* _Hnd; // Win32 HANDLE
_Thrd_id_t _Id;
};
using _Smtx_t = void*;
enum class _Thrd_result : int { _Success, _Nomem, _Timedout, _Busy, _Error };
struct _Stl_critical_section {
void* _Unused = nullptr; // TRANSITION, ABI: was the vptr
_Smtx_t _M_srw_lock = nullptr;
};
struct _Mtx_internal_imp_t {
// TRANSITION, ABI: We should directly store _M_srw_lock above.
#ifdef _WIN64
static constexpr size_t _Critical_section_size = 64;
#else // ^^^ 64-bit / 32-bit vvv
static constexpr size_t _Critical_section_size = 36;
#endif // ^^^ 32-bit ^^^
int _Type{};
union {
_Stl_critical_section _Critical_section{};
_STD _Aligned_storage_t<_Critical_section_size, alignof(void*)> _Cs_storage;
};
long _Thread_id{};
int _Count{};
};
using _Mtx_t = _Mtx_internal_imp_t*;
struct _Stl_condition_variable {
void* _Unused = nullptr; // TRANSITION, ABI: was the vptr
void* _Win_cv = nullptr;
};
#pragma warning(push)
#pragma warning(disable : 26495) // Variable 'meow' is uninitialized. Always initialize a member variable (type.6).
struct _Cnd_internal_imp_t {
// TRANSITION, ABI: We should directly store _Win_cv above.
#ifdef _WIN64
static constexpr size_t _Cnd_internal_imp_size = 72;
#else // ^^^ 64-bit / 32-bit vvv
static constexpr size_t _Cnd_internal_imp_size = 40;
#endif // ^^^ 32-bit ^^^
union {
_Stl_condition_variable _Stl_cv{};
_STD _Aligned_storage_t<_Cnd_internal_imp_size, alignof(void*)> _Cv_storage;
};
};
#pragma warning(pop)
using _Cnd_t = _Cnd_internal_imp_t*;
} // extern "C"
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_THREADS_CORE_HPP
/*
* This file is derived from software bearing the following
* restrictions:
*
* (c) Copyright William E. Kempf 2001
*
* Permission to use, copy, modify, distribute and sell this
* software and its documentation for any purpose is hereby
* granted without fee, provided that the above copyright
* notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting
* documentation. William E. Kempf makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*/
@@ -0,0 +1,168 @@
// __msvc_tzdb.hpp internal header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_TZDB_HPP
#define __MSVC_TZDB_HPP
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstddef>
#include <cstdint>
#include <type_traits>
#include <xutility>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
extern "C" {
using __std_tzdb_epoch_milli = double;
struct __std_tzdb_leap_info {
uint16_t _Year;
uint16_t _Month;
uint16_t _Day;
uint16_t _Hour;
uint16_t _Negative;
uint16_t _Reserved;
};
enum class __std_tzdb_error {
_Success = 0,
_Win_error = 1,
_Icu_error = 2,
};
struct __std_tzdb_time_zones_info {
__std_tzdb_error _Err;
// timezone data version currently being used
const char* _Version;
size_t _Num_time_zones;
// ordered list of null-terminated time_zone/time_zone_link names
const char** _Names;
// contains corresponding entry for every name, if:
// (_Links[i] == nullptr) then _Names[i] is a time_zone
// (_Links[i] != nullptr) then _Names[i] is a time_zone_link to time_zone with name _Links[i]
const char** _Links;
};
struct __std_tzdb_current_zone_info {
__std_tzdb_error _Err;
const char* _Tz_name;
};
struct __std_tzdb_sys_info {
__std_tzdb_error _Err;
__std_tzdb_epoch_milli _Begin;
__std_tzdb_epoch_milli _End;
int32_t _Offset;
int32_t _Save;
const char* _Abbrev;
};
enum class __std_tzdb_sys_info_type : char {
// TRANSITION, ABI: In order to be compatible with existing object files which do not know about
// `__std_tzdb_sys_info_type`, the type is passed in the after-end byte of a string passed with its length to
// `__std_tzdb_get_sys_info`. Since older object files always pass the `.c_str()` of a `std::string`
// to that function, the after-end byte will always be '\0'.
_Full = '\0',
_Offset_only,
_Offset_and_range,
};
_NODISCARD __std_tzdb_time_zones_info* __stdcall __std_tzdb_get_time_zones() noexcept;
void __stdcall __std_tzdb_delete_time_zones(__std_tzdb_time_zones_info* _Info) noexcept;
_NODISCARD __std_tzdb_current_zone_info* __stdcall __std_tzdb_get_current_zone() noexcept;
void __stdcall __std_tzdb_delete_current_zone(__std_tzdb_current_zone_info* _Info) noexcept;
_NODISCARD __std_tzdb_sys_info* __stdcall __std_tzdb_get_sys_info(
const char* _Tz, size_t _Tz_len, __std_tzdb_epoch_milli _Local) noexcept;
void __stdcall __std_tzdb_delete_sys_info(__std_tzdb_sys_info* _Info) noexcept;
_NODISCARD __std_tzdb_leap_info* __stdcall __std_tzdb_get_leap_seconds(
size_t _Prev_ls_size, size_t* _Current_ls_size) noexcept;
void __stdcall __std_tzdb_delete_leap_seconds(__std_tzdb_leap_info* _Info) noexcept;
_NODISCARD void* __stdcall __std_calloc_crt(size_t _Count, size_t _Size) noexcept;
void __stdcall __std_free_crt(void* _Ptr) noexcept;
} // extern "C"
_STD_BEGIN
template <class _Ty>
struct _Tzdb_deleter;
template <>
struct _Tzdb_deleter<__std_tzdb_time_zones_info> {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_time_zones_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_time_zones(_Info);
}
};
template <>
struct _Tzdb_deleter<__std_tzdb_current_zone_info> {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_current_zone_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_current_zone(_Info);
}
};
template <>
struct _Tzdb_deleter<__std_tzdb_sys_info> {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_sys_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_sys_info(_Info);
}
};
template <>
struct _Tzdb_deleter<__std_tzdb_leap_info[]> {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_leap_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_leap_seconds(_Info);
}
};
template <class _Ty>
class _Crt_allocator {
public:
using value_type = _Ty;
using propagate_on_container_move_assignment = true_type;
using is_always_equal = true_type;
constexpr _Crt_allocator() noexcept = default;
constexpr _Crt_allocator(const _Crt_allocator&) noexcept = default;
template <class _Other>
constexpr _Crt_allocator(const _Crt_allocator<_Other>&) noexcept {}
_NODISCARD __declspec(allocator) _Ty* allocate(_CRT_GUARDOVERFLOW const size_t _Count) {
const auto _Ptr = __std_calloc_crt(_Count, sizeof(_Ty));
if (!_Ptr) {
_Xbad_alloc();
}
return static_cast<_Ty*>(_Ptr);
}
void deallocate(_Ty* const _Ptr, size_t) noexcept {
__std_free_crt(_Ptr);
}
template <class _Other>
_NODISCARD bool operator==(const _Crt_allocator<_Other>&) const noexcept {
return true;
}
};
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_TZDB_HPP
@@ -0,0 +1,46 @@
// __msvc_xlocinfo_types.hpp internal header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef __MSVC_XLOCINFO_TYPES_HPP
#define __MSVC_XLOCINFO_TYPES_HPP
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_EXTERN_C_UNLESS_PURE
struct _Collvec { // stuff needed by _Strcoll, etc.
unsigned int _Page; // UINT
wchar_t* _LocaleName;
};
struct _Ctypevec { // stuff needed by _Tolower, etc.
unsigned int _Page; // UINT
const short* _Table;
int _Delfl;
wchar_t* _LocaleName;
};
struct _Cvtvec { // stuff needed by _Mbrtowc, etc.
unsigned int _Page; // UINT
unsigned int _Mbcurmax;
int _Isclocale; // LCID == _CLOCALEHANDLE
unsigned char _Isleadbyte[32]; // 256 bits
};
_END_EXTERN_C_UNLESS_PURE
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // __MSVC_XLOCINFO_TYPES_HPP
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,459 @@
//
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// Code in Details namespace is for internal usage within the library code
//
#ifndef _PLATFORM_AGILE_H_
#define _PLATFORM_AGILE_H_
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#include <algorithm>
#include <wrl/client.h>
#if !defined(__cplusplus_winrt)
#error agile.h can only be used with /ZW
#endif
namespace Platform
{
namespace Details
{
__declspec(dllimport) IUnknown* __stdcall GetObjectContext();
__declspec(dllimport) HRESULT __stdcall GetProxyImpl(::IUnknown*, REFIID, ::IUnknown*, ::IUnknown**);
__declspec(dllimport) HRESULT __stdcall ReleaseInContextImpl(::IUnknown*, ::IUnknown*);
template <typename T>
__declspec(no_refcount) inline HRESULT GetProxy(T ^ObjectIn, ::IUnknown *ContextCallBack, T ^*Proxy)
{
return GetProxyImpl(*reinterpret_cast<IUnknown**>(&ObjectIn), __uuidof(T^) , ContextCallBack, reinterpret_cast< ::IUnknown**>(Proxy));
}
template <typename T>
inline HRESULT ReleaseInContext(T *ObjectIn, ::IUnknown *ContextCallBack)
{
return ReleaseInContextImpl(ObjectIn, ContextCallBack);
}
template <typename T>
class AgileHelper
{
__abi_IUnknown* _p;
bool _release;
public:
AgileHelper(__abi_IUnknown* p, bool release = true) : _p(p), _release(release)
{
}
AgileHelper(AgileHelper && other) : _p(other._p), _release(other._release)
{
_other._p = nullptr;
_other._release = true;
}
AgileHelper operator=(AgileHelper && other)
{
_p = other._p;
_release = other._release;
_other._p = nullptr;
_other._release = true;
return *this;
}
~AgileHelper()
{
if (_release && _p)
{
_p->__abi_Release();
}
}
__declspec(no_refcount) __declspec(no_release_return)
T^ operator->()
{
return reinterpret_cast<T^>(_p);
}
__declspec(no_refcount) __declspec(no_release_return)
operator T^()
{
return reinterpret_cast<T^>(_p);
}
private:
AgileHelper(const AgileHelper&);
AgileHelper operator=(const AgileHelper&) ;
};
template <typename T>
struct __remove_hat
{
typedef T type;
};
template <typename T>
struct __remove_hat<T^>
{
typedef T type;
};
template <typename T>
struct AgileTypeHelper
{
typename typedef __remove_hat<T>::type type;
typename typedef __remove_hat<T>::type^ agileMemberType;
};
} // namespace Details
#pragma warning(push)
#pragma warning(disable: 4451) // Usage of ref class inside this context can lead to invalid marshaling of object across contexts
template <
typename T,
bool TIsNotAgile = (__is_win_class(typename Details::AgileTypeHelper<T>::type) && !__is_winrt_agile(typename Details::AgileTypeHelper<T>::type)) ||
__is_win_interface(typename Details::AgileTypeHelper<T>::type)
>
class Agile
{
static_assert(__is_win_class(typename Details::AgileTypeHelper<T>::type) || __is_win_interface(typename Details::AgileTypeHelper<T>::type), "Agile can only be used with ref class or interface class types");
typename typedef Details::AgileTypeHelper<T>::agileMemberType TypeT;
TypeT _object;
::Microsoft::WRL::ComPtr< ::IUnknown> _contextCallback;
ULONG_PTR _contextToken;
enum class AgileState
{
NonAgilePointer = 0,
AgilePointer = 1,
Unknown = 2
};
AgileState _agileState;
void CaptureContext()
{
_contextCallback = Details::GetObjectContext();
__abi_ThrowIfFailed(CoGetContextToken(&_contextToken));
}
void SetObject(TypeT object)
{
// Capture context before setting the pointer
// If context capture fails then nothing to cleanup
Release();
if (object != nullptr)
{
::Microsoft::WRL::ComPtr< ::IAgileObject> checkIfAgile;
HRESULT hr = reinterpret_cast< ::IUnknown*>(object)->QueryInterface(__uuidof(::IAgileObject), &checkIfAgile);
// Don't Capture context if object is agile
if (hr != S_OK)
{
_agileState = AgileState::NonAgilePointer;
CaptureContext();
}
else
{
_agileState = AgileState::AgilePointer;
}
}
_object = object;
}
public:
Agile() throw() : _object(nullptr), _contextToken(0), _agileState(AgileState::Unknown)
{
}
Agile(nullptr_t) throw() : _object(nullptr), _contextToken(0), _agileState(AgileState::Unknown)
{
}
explicit Agile(TypeT object) throw() : _object(nullptr), _contextToken(0), _agileState(AgileState::Unknown)
{
// Assumes that the source object is from the current context
SetObject(object);
}
Agile(const Agile& object) throw() : _object(nullptr), _contextToken(0), _agileState(AgileState::Unknown)
{
// Get returns pointer valid for current context
SetObject(object.Get());
}
Agile(Agile && object) throw() : _object(nullptr), _contextToken(0), _agileState(AgileState::Unknown)
{
// Assumes that the source object is from the current context
Swap(object);
}
~Agile() throw()
{
Release();
}
TypeT Get() const
{
// Agile object, no proxy required
if (_agileState == AgileState::AgilePointer || _object == nullptr)
{
return _object;
}
// Do the check for same context
ULONG_PTR currentContextToken;
__abi_ThrowIfFailed(CoGetContextToken(&currentContextToken));
if (currentContextToken == _contextToken)
{
return _object;
}
// Different context and holding on to a non agile object
// Do the costly work of getting a proxy
TypeT localObject;
__abi_ThrowIfFailed(Details::GetProxy(_object, _contextCallback.Get(), &localObject));
if (_agileState == AgileState::Unknown)
{
// Object is agile if it implements IAgileObject
// GetAddressOf captures the context with out knowing the type of object that it will hold
::Microsoft::WRL::ComPtr< ::IAgileObject> checkIfAgile;
HRESULT hr = reinterpret_cast<IUnknown*>(localObject)->QueryInterface(__uuidof(::IAgileObject), &checkIfAgile);
if (hr == S_OK)
{
auto pThis = const_cast<Agile*>(this);
pThis->_agileState = AgileState::AgilePointer;
pThis->_contextToken = 0;
pThis->_contextCallback = nullptr;
return _object;
}
else
{
auto pThis = const_cast<Agile*>(this);
pThis->_agileState = AgileState::NonAgilePointer;
}
}
return localObject;
}
TypeT* GetAddressOf() throw()
{
Release();
CaptureContext();
return &_object;
}
TypeT* GetAddressOfForInOut() throw()
{
CaptureContext();
return &_object;
}
TypeT operator->() const throw()
{
return Get();
}
Agile& operator=(nullptr_t) throw()
{
Release();
return *this;
}
Agile& operator=(TypeT object) throw()
{
Agile(object).Swap(*this);
return *this;
}
Agile& operator=(Agile object) throw()
{
// parameter is by copy which gets pointer valid for current context
object.Swap(*this);
return *this;
}
void Swap(Agile& object)
{
std::swap(_object, object._object);
std::swap(_contextCallback, object._contextCallback);
std::swap(_contextToken, object._contextToken);
std::swap(_agileState, object._agileState);
}
// Release the interface and set to NULL
void Release() throw()
{
if (_object)
{
// Cast to IInspectable (no QI)
IUnknown* pObject = *(::IUnknown**) (&_object);
// Set ^ to null without release
*(IUnknown**) (&_object) = nullptr;
ULONG_PTR currentContextToken;
__abi_ThrowIfFailed(CoGetContextToken(&currentContextToken));
if (_contextToken == 0 || _contextCallback == nullptr || _contextToken == currentContextToken)
{
pObject->Release();
}
else
{
Details::ReleaseInContext(pObject, _contextCallback.Get());
}
_contextCallback = nullptr;
_contextToken = 0;
_agileState = AgileState::Unknown;
}
}
bool operator==(nullptr_t) const throw()
{
return _object == nullptr;
}
bool operator==(const Agile& other) const throw()
{
return _object == other._object && _contextToken == other._contextToken;
}
bool operator < (const Agile& other) const throw()
{
if (reinterpret_cast<void*>(_object) < reinterpret_cast<void*>(other._object))
{
return true;
}
return _object == other._object && _contextToken < other._contextToken;
}
};
template <typename T>
class Agile<T, false>
{
static_assert(__is_win_class(typename Details::AgileTypeHelper<T>::type) || __is_win_interface(typename Details::AgileTypeHelper<T>::type), "Agile can only be used with ref class or interface class types");
typename typedef Details::AgileTypeHelper<T>::agileMemberType TypeT;
TypeT _object;
public:
Agile() throw() : _object(nullptr)
{
}
Agile(nullptr_t) throw() : _object(nullptr)
{
}
explicit Agile(TypeT object) throw() : _object(object)
{
}
Agile(const Agile& object) throw() : _object(object._object)
{
}
Agile(Agile && object) throw() : _object(nullptr)
{
Swap(object);
}
~Agile() throw()
{
Release();
}
TypeT Get() const
{
return _object;
}
TypeT* GetAddressOf() throw()
{
Release();
return &_object;
}
TypeT* GetAddressOfForInOut() throw()
{
return &_object;
}
TypeT operator->() const throw()
{
return Get();
}
Agile& operator=(nullptr_t) throw()
{
Release();
return *this;
}
Agile& operator=(TypeT object) throw()
{
if (_object != object)
{
_object = object;
}
return *this;
}
Agile& operator=(Agile object) throw()
{
object.Swap(*this);
return *this;
}
// Release the interface and set to NULL
void Release() throw()
{
_object = nullptr;
}
void Swap(Agile& object)
{
std::swap(_object, object._object);
}
bool operator==(nullptr_t) const throw()
{
return _object == nullptr;
}
bool operator==(const Agile& other) const throw()
{
return _object == other._object;
}
bool operator < (const Agile& other) const throw()
{
return reinterpret_cast<void*>(_object) < reinterpret_cast<void*>(other._object);
}
};
#pragma warning(pop)
template<class U>
bool operator==(nullptr_t, const Agile<U>& a) throw()
{
return a == nullptr;
}
template<class U>
bool operator!=(const Agile<U>& a, nullptr_t) throw()
{
return !(a == nullptr);
}
template<class U>
bool operator!=(nullptr_t, const Agile<U>& a) throw()
{
return !(a == nullptr);
}
template<class U>
bool operator!=(const Agile<U>& a, const Agile<U>& b) throw()
{
return !(a == b);
}
} // namespace Platform
#endif // _PLATFORM_AGILE_H_
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,387 @@
/****
* Copyright (C) 2007-2020 Advanced Micro Devices Inc. All rights reserved.
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* ammintrin.h - Definitions for AMD-specific intrinsics
*
****/
#pragma once
#if !defined(_M_IX86) && !defined(_M_X64) && !(defined(_M_ARM64) && defined(USE_SOFT_INTRINSICS))
#error This header is specific to X86, X64, ARM64, and ARM64EC targets
#endif
#if (defined(_M_ARM64) || defined(_M_ARM64EC)) && !defined(__INTRIN_H_)
#error this header should only be included through <intrin.h>
#endif
#ifndef _INCLUDED_AMM
#define _INCLUDED_AMM
#ifndef __midl
#if defined (_M_CEE_PURE)
#error ERROR: This file is not supported in the pure mode!
#else /* defined (_M_CEE_PURE) */
#if defined __cplusplus
extern "C" { /* Intrinsics use C name-mangling. */
#endif /* defined __cplusplus */
/*
* Vector integer comparison control macros
*/
#define _MM_PCOMCTRL_LT 0
#define _MM_PCOMCTRL_LE 1
#define _MM_PCOMCTRL_GT 2
#define _MM_PCOMCTRL_GE 3
#define _MM_PCOMCTRL_EQ 4
#define _MM_PCOMCTRL_NEQ 5
#define _MM_PCOMCTRL_FALSE 6
#define _MM_PCOMCTRL_TRUE 7
/*
* MACRO functions for vector integer comparisons
*/
#define _mm_comlt_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epu8(v1, v2) _mm_com_epu8(v1, v2, _MM_PCOMCTRL_TRUE)
#define _mm_comlt_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epu16(v1, v2) _mm_com_epu16(v1, v2, _MM_PCOMCTRL_TRUE)
#define _mm_comlt_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epu32(v1, v2) _mm_com_epu32(v1, v2, _MM_PCOMCTRL_TRUE)
#define _mm_comlt_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epu64(v1, v2) _mm_com_epu64(v1, v2, _MM_PCOMCTRL_TRUE)
#define _mm_comlt_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epi8(v1, v2) _mm_com_epi8(v1, v2, _MM_PCOMCTRL_TRUE)
#define _mm_comlt_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epi16(v1, v2) _mm_com_epi16(v1, v2, _MM_PCOMCTRL_TRUE)
#define _mm_comlt_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epi32(v1, v2) _mm_com_epi32(v1, v2, _MM_PCOMCTRL_TRUE)
#define _mm_comlt_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_LT)
#define _mm_comle_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_LE)
#define _mm_comgt_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_GT)
#define _mm_comge_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_GE)
#define _mm_comeq_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_EQ)
#define _mm_comneq_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_NEQ)
#define _mm_comfalse_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_FALSE)
#define _mm_comtrue_epi64(v1, v2) _mm_com_epi64(v1, v2, _MM_PCOMCTRL_TRUE)
/* SSE5 intrinsics */
/* Float/double multiply-accumulate */
__m128 _mm_macc_ps(__m128, __m128, __m128);
__m128d _mm_macc_pd(__m128d, __m128d, __m128d);
__m128 _mm_macc_ss(__m128, __m128, __m128);
__m128d _mm_macc_sd(__m128d, __m128d, __m128d);
__m128 _mm_maddsub_ps(__m128, __m128, __m128);
__m128d _mm_maddsub_pd(__m128d, __m128d, __m128d);
__m128 _mm_msubadd_ps(__m128, __m128, __m128);
__m128d _mm_msubadd_pd(__m128d, __m128d, __m128d);
__m128 _mm_msub_ps(__m128, __m128, __m128);
__m128d _mm_msub_pd(__m128d, __m128d, __m128d);
__m128 _mm_msub_ss(__m128, __m128, __m128);
__m128d _mm_msub_sd(__m128d, __m128d, __m128d);
__m128 _mm_nmacc_ps(__m128, __m128, __m128);
__m128d _mm_nmacc_pd(__m128d, __m128d, __m128d);
__m128 _mm_nmacc_ss(__m128, __m128, __m128);
__m128d _mm_nmacc_sd(__m128d, __m128d, __m128d);
__m128 _mm_nmsub_ps(__m128, __m128, __m128);
__m128d _mm_nmsub_pd(__m128d, __m128d, __m128d);
__m128 _mm_nmsub_ss(__m128, __m128, __m128);
__m128d _mm_nmsub_sd(__m128d, __m128d, __m128d);
/* Integer multiply-accumulate */
__m128i _mm_maccs_epi16(__m128i, __m128i, __m128i);
__m128i _mm_macc_epi16(__m128i, __m128i, __m128i);
__m128i _mm_maccsd_epi16(__m128i, __m128i, __m128i);
__m128i _mm_maccd_epi16(__m128i, __m128i, __m128i);
__m128i _mm_maccs_epi32(__m128i, __m128i, __m128i);
__m128i _mm_macc_epi32(__m128i, __m128i, __m128i);
__m128i _mm_maccslo_epi32(__m128i, __m128i, __m128i);
__m128i _mm_macclo_epi32(__m128i, __m128i, __m128i);
__m128i _mm_maccshi_epi32(__m128i, __m128i, __m128i);
__m128i _mm_macchi_epi32(__m128i, __m128i, __m128i);
__m128i _mm_maddsd_epi16(__m128i, __m128i, __m128i);
__m128i _mm_maddd_epi16(__m128i, __m128i, __m128i);
/* Horizontal add/subtract */
__m128i _mm_haddw_epi8(__m128i);
__m128i _mm_haddd_epi8(__m128i);
__m128i _mm_haddq_epi8(__m128i);
__m128i _mm_haddd_epi16(__m128i);
__m128i _mm_haddq_epi16(__m128i);
__m128i _mm_haddq_epi32(__m128i);
__m128i _mm_haddw_epu8(__m128i);
__m128i _mm_haddd_epu8(__m128i);
__m128i _mm_haddq_epu8(__m128i);
__m128i _mm_haddd_epu16(__m128i);
__m128i _mm_haddq_epu16(__m128i);
__m128i _mm_haddq_epu32(__m128i);
__m128i _mm_hsubw_epi8(__m128i);
__m128i _mm_hsubd_epi16(__m128i);
__m128i _mm_hsubq_epi32(__m128i);
/* Vector conditional moves */
__m128i _mm_cmov_si128(__m128i, __m128i, __m128i);
__m128i _mm_perm_epi8(__m128i, __m128i, __m128i);
/* Vector shifts and rotates */
__m128i _mm_rot_epi8(__m128i, __m128i);
__m128i _mm_rot_epi16(__m128i, __m128i);
__m128i _mm_rot_epi32(__m128i, __m128i);
__m128i _mm_rot_epi64(__m128i, __m128i);
__m128i _mm_roti_epi8(__m128i, int);
__m128i _mm_roti_epi16(__m128i, int);
__m128i _mm_roti_epi32(__m128i, int);
__m128i _mm_roti_epi64(__m128i, int);
__m128i _mm_shl_epi8(__m128i, __m128i);
__m128i _mm_shl_epi16(__m128i, __m128i);
__m128i _mm_shl_epi32(__m128i, __m128i);
__m128i _mm_shl_epi64(__m128i, __m128i);
__m128i _mm_sha_epi8(__m128i, __m128i);
__m128i _mm_sha_epi16(__m128i, __m128i);
__m128i _mm_sha_epi32(__m128i, __m128i);
__m128i _mm_sha_epi64(__m128i, __m128i);
/* Vector integer comparisons */
__m128i _mm_com_epu8(__m128i, __m128i, int);
__m128i _mm_com_epu16(__m128i, __m128i, int);
__m128i _mm_com_epu32(__m128i, __m128i, int);
__m128i _mm_com_epu64(__m128i, __m128i, int);
__m128i _mm_com_epi8(__m128i, __m128i, int);
__m128i _mm_com_epi16(__m128i, __m128i, int);
__m128i _mm_com_epi32(__m128i, __m128i, int);
__m128i _mm_com_epi64(__m128i, __m128i, int);
/* Precision control */
__m128 _mm_frcz_ps(__m128);
__m128d _mm_frcz_pd(__m128d);
__m128 _mm_frcz_ss(__m128, __m128);
__m128d _mm_frcz_sd(__m128d, __m128d);
/* Control values for permute2 intrinsics */
#define _MM_PERMUTE2_COPY 0 /* just copy the selected value */
/* Note that using the constant 1 would have the same effect as 0 */
#define _MM_PERMUTE2_ZEROIF1 2 /* zero selected value if src3 bit is 1 */
#define _MM_PERMUTE2_ZEROIF0 3 /* zero selected value if src3 bit is 3 */
/* Permutation */
__m128 _mm_permute2_ps(__m128, __m128, __m128i, int);
__m128d _mm_permute2_pd(__m128d, __m128d, __m128i, int);
/* YMM versions */
__m256 _mm256_macc_ps(__m256, __m256, __m256);
__m256d _mm256_macc_pd(__m256d, __m256d, __m256d);
__m256 _mm256_maddsub_ps(__m256, __m256, __m256);
__m256d _mm256_maddsub_pd(__m256d, __m256d, __m256d);
__m256 _mm256_msubadd_ps(__m256, __m256, __m256);
__m256d _mm256_msubadd_pd(__m256d, __m256d, __m256d);
__m256 _mm256_msub_ps(__m256, __m256, __m256);
__m256d _mm256_msub_pd(__m256d, __m256d, __m256d);
__m256 _mm256_nmacc_ps(__m256, __m256, __m256);
__m256d _mm256_nmacc_pd(__m256d, __m256d, __m256d);
__m256 _mm256_nmsub_ps(__m256, __m256, __m256);
__m256d _mm256_nmsub_pd(__m256d, __m256d, __m256d);
__m256i _mm256_cmov_si256(__m256i, __m256i, __m256i);
__m256 _mm256_frcz_ps(__m256);
__m256d _mm256_frcz_pd(__m256d);
__m256 _mm256_permute2_ps(__m256, __m256, __m256i, int);
__m256d _mm256_permute2_pd(__m256d, __m256d, __m256i, int);
/* LWP intrinsics */
void __llwpcb(void *);
void *__slwpcb(void);
void __lwpval32(unsigned int, unsigned int, unsigned int);
unsigned char __lwpins32(unsigned int, unsigned int, unsigned int);
#if defined (_M_X64)
void __lwpval64(unsigned __int64, unsigned int, unsigned int);
unsigned char __lwpins64(unsigned __int64, unsigned int, unsigned int);
#endif /* defined (_M_X64) */
/*BMI intrinsics */
unsigned int _bextr_u32(unsigned int, unsigned int, unsigned int);
unsigned int _andn_u32(unsigned int, unsigned int);
unsigned int _tzcnt_u32(unsigned int);
unsigned int _lzcnt_u32(unsigned int);
unsigned int _blsr_u32(unsigned int);
unsigned int _blsmsk_u32(unsigned int);
unsigned int _blsi_u32(unsigned int);
#if defined (_M_X64)
unsigned __int64 _bextr_u64(unsigned __int64, unsigned int, unsigned int);
unsigned __int64 _andn_u64(unsigned __int64, unsigned __int64);
unsigned __int64 _tzcnt_u64(unsigned __int64);
unsigned __int64 _lzcnt_u64(unsigned __int64);
unsigned __int64 _blsr_u64(unsigned __int64);
unsigned __int64 _blsmsk_u64(unsigned __int64);
unsigned __int64 _blsi_u64(unsigned __int64);
#endif /* defined (_M_X64) */
/* TBM intrinsics */
unsigned int _bextri_u32(unsigned int, unsigned int);
unsigned int _blcfill_u32(unsigned int);
unsigned int _blsfill_u32(unsigned int);
unsigned int _blcs_u32(unsigned int);
unsigned int _tzmsk_u32(unsigned int);
unsigned int _blcic_u32(unsigned int);
unsigned int _blsic_u32(unsigned int);
unsigned int _t1mskc_u32(unsigned int);
unsigned int _blcmsk_u32(unsigned int);
unsigned int _blci_u32(unsigned int);
#if defined (_M_X64)
unsigned __int64 _bextri_u64(unsigned __int64, unsigned int);
unsigned __int64 _blcfill_u64(unsigned __int64);
unsigned __int64 _blsfill_u64(unsigned __int64);
unsigned __int64 _blcs_u64(unsigned __int64);
unsigned __int64 _tzmsk_u64(unsigned __int64);
unsigned __int64 _blcic_u64(unsigned __int64);
unsigned __int64 _blsic_u64(unsigned __int64);
unsigned __int64 _t1mskc_u64(unsigned __int64);
unsigned __int64 _blcmsk_u64(unsigned __int64);
unsigned __int64 _blci_u64(unsigned __int64);
#endif /* defined (_M_X64) */
void _mm_monitorx(void const *, unsigned int, unsigned int);
void _mm_mwaitx(unsigned int, unsigned int, unsigned int);
void _mm_clzero(void const *);
unsigned __int64 _rdpru(unsigned int);
#if defined (_M_X64)
// Secure Nested Paging
#if _MSC_VER <= 1942
typedef struct rmp_seg {
unsigned __int64 rmp_gpa;
__int8 rmp_entry;
__int8 rmp_pageSize;
__int8 rmp_pageMark;
__int8 rmp_reserved;
__int32 rmp_ASID;
} rmp_seg;
unsigned int __rmpupdate(unsigned __int64, rmp_seg*, int);
unsigned int __pvalidate(unsigned __int64, int, int, int*);
unsigned int __psmash(unsigned __int64);
unsigned int __rmpadjust(unsigned __int64, int, int);
unsigned int __rmpquery(unsigned __int64, int, int);
#else
// Secure Nested Paging
typedef struct rmp_entry {
unsigned __int64 guest_pa;
unsigned __int8 assigned;
unsigned __int8 page_size : 1;
unsigned __int8 rmp_2mb_region_status : 1;
unsigned __int8 reserved1 : 6;
unsigned __int8 immutable;
unsigned __int8 reserved2;
unsigned __int32 asid;
} rmp_entry;
typedef struct rmpquery_result {
unsigned __int8 target_perm_mask;
unsigned __int8 vmsa;
unsigned __int8 page_size;
} rmpquery_result;
unsigned int __rmpupdate(unsigned __int64, rmp_entry*);
unsigned int __pvalidate(unsigned __int64, unsigned __int8, unsigned __int8, unsigned __int8*);
unsigned int __psmash(unsigned __int64);
unsigned int __rmpadjust(unsigned __int64, unsigned __int8, unsigned __int8, unsigned __int8);
unsigned int __rmpquery(unsigned __int64, unsigned __int8, rmpquery_result*);
unsigned int __rmpread(unsigned __int64, rmp_entry*);
#endif /* _MSC_VER */
#endif /* defined (_M_X64) */
//TLB extension
void __svm_invlpgb(void*, int);
void __svm_tlbsync(void);
#if defined __cplusplus
}; /* End "C" */
#endif /* defined __cplusplus */
#endif /* defined (_M_CEE_PURE) */
#endif /* __midl */
#endif /* _INCLUDED_AMM */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,190 @@
/***
* ==++==
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* ==--==
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* amprt_exceptions.h
*
* Define the C++ interfaces exported by the C++ AMP runtime
*
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
****/
#pragma once
#ifndef _SILENCE_AMP_DEPRECATION_WARNINGS
#error <amprt_exceptions.h> is part of C++ AMP which is deprecated by Microsoft and will be REMOVED. \
You can define _SILENCE_AMP_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
#endif // _SILENCE_AMP_DEPRECATION_WARNINGS
#include <exception>
#if !defined(_AMPIMP)
#define _AMPIMP __declspec(dllimport)
#endif
// exceptions
namespace Concurrency {
/// <summary>
/// Exception thrown due to a C++ AMP runtime_exception.
/// This is the base type for all C++ AMP exception types.
/// </summary>
class runtime_exception : public std::exception
{
public:
/// <summary>
/// Construct a runtime_exception exception with a message and an error code
/// </summary>
/// <param name="_Message">
/// Descriptive message of error
/// </param>
/// <param name="_Hresult">
/// HRESULT of error that caused this exception
/// </param>
_AMPIMP runtime_exception(const char * _Message, HRESULT _Hresult) throw();
/// <summary>
/// Construct a runtime_exception exception with an error code
/// </summary>
/// <param name="_Hresult">
/// HRESULT of error that caused this exception
/// </param>
_AMPIMP explicit runtime_exception(HRESULT _Hresult) throw();
/// <summary>
/// Copy construct a runtime_exception exception
/// </summary>
/// <param name="_Other">
/// The runtime_exception object to be copied from
/// </param>
_AMPIMP runtime_exception(const runtime_exception &_Other) throw();
/// <summary>
/// Assignment operator
/// </summary>
/// <param name="_Other">
/// The runtime_exception object to be assigned from
/// </param>
_AMPIMP runtime_exception &operator=(const runtime_exception &_Other) throw();
/// <summary>
/// Destruct a runtime_exception exception object instance
/// </summary>
_AMPIMP virtual ~runtime_exception() noexcept;
/// <summary>
/// Get the error code that caused this exception
/// </summary>
/// <returns>
/// HRESULT of error that caused the exception
/// </returns>
_AMPIMP HRESULT get_error_code() const throw();
private:
HRESULT _M_error_code;
}; // class runtime_exception
/// <summary>
/// Exception thrown when an underlying OS/DirectX call fails
/// due to lack of system or device memory
/// </summary>
class out_of_memory : public runtime_exception
{
public:
/// <summary>
/// Construct an out_of_memory exception with a message
/// </summary>
/// <param name="_Message">
/// Descriptive message of error
/// </param>
_AMPIMP explicit out_of_memory(const char * _Message) throw();
/// <summary>
/// Construct an out_of_memory exception
/// </summary>
_AMPIMP out_of_memory () throw();
}; // class out_of_memory
/// <summary>
/// Exception thrown when an underlying DirectX call fails
/// due to the Windows timeout detection and recovery mechanism
/// </summary>
class accelerator_view_removed : public runtime_exception
{
public:
/// <summary>
/// Construct an accelerator_view_removed exception with a message and
/// a view removed reason code
/// </summary>
/// <param name="_Message">
/// Descriptive message of error
/// </param>
/// <param name="_View_removed_reason">
/// HRESULT error code indicating the cause of removal of the accelerator_view
/// </param>
_AMPIMP explicit accelerator_view_removed(const char * _Message, HRESULT _View_removed_reason) throw();
/// <summary>
/// Construct an accelerator_view_removed exception
/// </summary>
/// <param name="_View_removed_reason">
/// HRESULT error code indicating the cause of removal of the accelerator_view
/// </param>
_AMPIMP explicit accelerator_view_removed(HRESULT _View_removed_reason) throw();
/// <summary>
/// Returns an HRESULT error code indicating the cause of the accelerator_view's removal
/// </summary>
/// <returns>
/// The HRESULT error code that indicates the cause of accelerator_view's removal
/// </returns>
_AMPIMP HRESULT get_view_removed_reason() const throw();
private:
HRESULT _M_view_removed_reason_code;
}; // class accelerator_view_removed
/// <summary>
/// Exception thrown when the runtime fails to launch a kernel
/// using the compute domain specified at the parallel_for_each call site.
/// </summary>
class invalid_compute_domain : public runtime_exception
{
public:
/// <summary>
/// Construct an invalid_compute_domain exception with a message
/// </summary>
/// <param name="_Message">
/// Descriptive message of error
/// </param>
_AMPIMP explicit invalid_compute_domain(const char * _Message) throw();
/// <summary>
/// Construct an invalid_compute_domain exception
/// </summary>
_AMPIMP invalid_compute_domain() throw();
}; // class invalid_compute_domain
/// <summary>
/// Exception thrown when an unsupported feature is used
/// </summary>
class unsupported_feature : public runtime_exception
{
public:
/// <summary>
/// Construct an unsupported_feature exception with a message
/// </summary>
/// <param name="_Message">
/// Descriptive message of error
/// </param>
_AMPIMP explicit unsupported_feature(const char * _Message) throw();
/// <summary>
/// Construct an unsupported_feature exception
/// </summary>
_AMPIMP unsupported_feature() throw();
}; // class unsupported_feature
}
@@ -0,0 +1,464 @@
// any standard header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _ANY_
#define _ANY_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX17
_EMIT_STL_WARNING(STL4038, "The contents of <any> are available only with C++17 or later.");
#elif !_HAS_STATIC_RTTI // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
_EMIT_STL_WARNING(STL4040, "The contents of <any> require static RTTI.");
#else // ^^^ !_HAS_STATIC_RTTI / _HAS_STATIC_RTTI vvv
#include <initializer_list>
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <xmemory>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
_EXPORT_STD class _NODISCARD bad_any_cast : public bad_cast { // thrown by failed any_cast
public:
_NODISCARD const char* __CLR_OR_THIS_CALL what() const noexcept override {
return "Bad any_cast";
}
};
[[noreturn]] inline void _Throw_bad_any_cast() {
_THROW(bad_any_cast{});
}
inline constexpr size_t _Any_trivial_space_size = (_Small_object_num_ptrs - 1) * sizeof(void*);
template <class _Ty>
constexpr bool _Any_is_trivial =
alignof(_Ty) <= alignof(max_align_t) && is_trivially_copyable_v<_Ty> && sizeof(_Ty) <= _Any_trivial_space_size;
inline constexpr size_t _Any_small_space_size = (_Small_object_num_ptrs - 2) * sizeof(void*);
template <class _Ty>
constexpr bool _Any_is_small = alignof(_Ty) <= alignof(max_align_t)
&& is_nothrow_move_constructible_v<_Ty> && sizeof(_Ty) <= _Any_small_space_size;
enum class _Any_representation : uintptr_t { _Trivial, _Big, _Small };
struct _Any_big_RTTI { // Hand-rolled vtable for types that must be heap allocated in an any
using _Destroy_fn = void __CLRCALL_PURE_OR_CDECL(void*) _NOEXCEPT_FNPTR;
using _Copy_fn = void* __CLRCALL_PURE_OR_CDECL(const void*);
template <class _Ty>
static void __CLRCALL_PURE_OR_CDECL _Destroy_impl(void* const _Target) noexcept {
::delete static_cast<_Ty*>(_Target);
}
template <class _Ty>
_NODISCARD static void* __CLRCALL_PURE_OR_CDECL _Copy_impl(const void* const _Source) {
return ::new _Ty(*static_cast<const _Ty*>(_Source));
}
_Destroy_fn* _Destroy;
_Copy_fn* _Copy;
};
struct _Any_small_RTTI { // Hand-rolled vtable for nontrivial types that can be stored internally in an any
using _Destroy_fn = void __CLRCALL_PURE_OR_CDECL(void*) _NOEXCEPT_FNPTR;
using _Copy_fn = void __CLRCALL_PURE_OR_CDECL(void*, const void*);
using _Move_fn = void __CLRCALL_PURE_OR_CDECL(void*, void*) _NOEXCEPT_FNPTR;
template <class _Ty>
static void __CLRCALL_PURE_OR_CDECL _Destroy_impl(void* const _Target) noexcept {
_STD _Destroy_in_place(*static_cast<_Ty*>(_Target));
}
template <class _Ty>
static void __CLRCALL_PURE_OR_CDECL _Copy_impl(void* const _Target, const void* const _Source) {
_STD _Construct_in_place(*static_cast<_Ty*>(_Target), *static_cast<const _Ty*>(_Source));
}
template <class _Ty>
static void __CLRCALL_PURE_OR_CDECL _Move_impl(void* const _Target, void* const _Source) noexcept {
_STD _Construct_in_place(*static_cast<_Ty*>(_Target), _STD move(*static_cast<_Ty*>(_Source)));
}
_Destroy_fn* _Destroy;
_Copy_fn* _Copy;
_Move_fn* _Move;
};
template <class _Ty>
constexpr _Any_big_RTTI _Any_big_RTTI_obj = {&_Any_big_RTTI::_Destroy_impl<_Ty>, &_Any_big_RTTI::_Copy_impl<_Ty>};
template <class _Ty>
constexpr _Any_small_RTTI _Any_small_RTTI_obj = {
&_Any_small_RTTI::_Destroy_impl<_Ty>, &_Any_small_RTTI::_Copy_impl<_Ty>, &_Any_small_RTTI::_Move_impl<_Ty>};
_EXPORT_STD class any { // storage for any (CopyConstructible) type
public:
// Construction and destruction [any.cons]
constexpr any() noexcept {}
any(const any& _That) {
_Storage._TypeData = _That._Storage._TypeData;
switch (_Rep()) {
case _Any_representation::_Small:
_Storage._SmallStorage._RTTI = _That._Storage._SmallStorage._RTTI;
_Storage._SmallStorage._RTTI->_Copy(&_Storage._SmallStorage._Data, &_That._Storage._SmallStorage._Data);
break;
case _Any_representation::_Big:
_Storage._BigStorage._RTTI = _That._Storage._BigStorage._RTTI;
_Storage._BigStorage._Ptr = _Storage._BigStorage._RTTI->_Copy(_That._Storage._BigStorage._Ptr);
break;
case _Any_representation::_Trivial:
default:
_CSTD memcpy(_Storage._TrivialData, _That._Storage._TrivialData, sizeof(_Storage._TrivialData));
break;
}
}
any(any&& _That) noexcept {
_Move_from(_That);
}
template <class _ValueType, enable_if_t<conjunction_v<negation<is_same<decay_t<_ValueType>, any>>,
negation<_Is_specialization<decay_t<_ValueType>, in_place_type_t>>,
is_copy_constructible<decay_t<_ValueType>>>,
int> = 0>
any(_ValueType&& _Value) { // initialize with _Value
_Emplace<decay_t<_ValueType>>(_STD forward<_ValueType>(_Value));
}
template <class _ValueType, class... _Types,
enable_if_t<
conjunction_v<is_constructible<decay_t<_ValueType>, _Types...>, is_copy_constructible<decay_t<_ValueType>>>,
int> = 0>
explicit any(in_place_type_t<_ValueType>, _Types&&... _Args) {
// in-place initialize a value of type decay_t<_ValueType> with _Args...
_Emplace<decay_t<_ValueType>>(_STD forward<_Types>(_Args)...);
}
template <class _ValueType, class _Elem, class... _Types,
enable_if_t<conjunction_v<is_constructible<decay_t<_ValueType>, initializer_list<_Elem>&, _Types...>,
is_copy_constructible<decay_t<_ValueType>>>,
int> = 0>
explicit any(in_place_type_t<_ValueType>, initializer_list<_Elem> _Ilist, _Types&&... _Args) {
// in-place initialize a value of type decay_t<_ValueType> with _Ilist and _Args...
_Emplace<decay_t<_ValueType>>(_Ilist, _STD forward<_Types>(_Args)...);
}
~any() noexcept {
reset();
#if _MSVC_STL_DESTRUCTOR_TOMBSTONES
// The two least significant bits (LSBs) of _Storage._TypeData encode whether we're in _Small, _Big,
// or _Trivial mode; see _Rep(). The rest of the bits encode the type_info pointer that's used
// to remember what type of object we're storing; see _TypeInfo(). So, we'll take the tombstone value,
// clear out the two LSBs with the _Rep_mask, then set the bits for _Small mode.
// _Small mode will prevent the most misuse, as the pseudo-vtable will be used for _Destroy, _Copy, and _Move.
// _Big mode wouldn't use the pseudo-vtable for _Move, and _Trivial mode doesn't have a pseudo-vtable at all.
const uintptr_t _Tombstone_value{_MSVC_STL_UINTPTR_TOMBSTONE_VALUE};
// Set the pseudo-vtable pointer:
_Storage._SmallStorage._RTTI = reinterpret_cast<const _Any_small_RTTI*>(_Tombstone_value);
// Set the combined type_info pointer and representation mode bits:
_Storage._TypeData = (_Tombstone_value & ~_Rep_mask) | static_cast<uintptr_t>(_Any_representation::_Small);
#endif // _MSVC_STL_DESTRUCTOR_TOMBSTONES
}
// Assignment [any.assign]
any& operator=(const any& _That) {
_Assign(_That);
return *this;
}
any& operator=(any&& _That) noexcept {
_Assign(_STD move(_That));
return *this;
}
template <class _ValueType, enable_if_t<conjunction_v<negation<is_same<decay_t<_ValueType>, any>>,
is_copy_constructible<decay_t<_ValueType>>>,
int> = 0>
any& operator=(_ValueType&& _Value) {
// replace contained value with an object of type decay_t<_ValueType> initialized from _Value
_Assign(_STD forward<_ValueType>(_Value));
return *this;
}
// Modifiers [any.modifiers]
template <class _ValueType, class... _Types,
enable_if_t<
conjunction_v<is_constructible<decay_t<_ValueType>, _Types...>, is_copy_constructible<decay_t<_ValueType>>>,
int> = 0>
decay_t<_ValueType>& emplace(_Types&&... _Args) {
// replace contained value with an object of type decay_t<_ValueType> initialized from _Args...
reset();
return _Emplace<decay_t<_ValueType>>(_STD forward<_Types>(_Args)...);
}
template <class _ValueType, class _Elem, class... _Types,
enable_if_t<conjunction_v<is_constructible<decay_t<_ValueType>, initializer_list<_Elem>&, _Types...>,
is_copy_constructible<decay_t<_ValueType>>>,
int> = 0>
decay_t<_ValueType>& emplace(initializer_list<_Elem> _Ilist, _Types&&... _Args) {
// replace contained value with an object of type decay_t<_ValueType> initialized from _Ilist and _Args...
reset();
return _Emplace<decay_t<_ValueType>>(_Ilist, _STD forward<_Types>(_Args)...);
}
void reset() noexcept { // transition to the empty state
switch (_Rep()) {
case _Any_representation::_Small:
_Storage._SmallStorage._RTTI->_Destroy(&_Storage._SmallStorage._Data);
break;
case _Any_representation::_Big:
_Storage._BigStorage._RTTI->_Destroy(_Storage._BigStorage._Ptr);
break;
case _Any_representation::_Trivial:
default:
break;
}
_Storage._TypeData = 0;
}
void swap(any& _That) noexcept {
_That = _STD exchange(*this, _STD move(_That));
}
// Observers [any.observers]
_NODISCARD bool has_value() const noexcept {
return _Storage._TypeData != 0;
}
_NODISCARD const type_info& type() const noexcept {
// if *this contains a value of type T, return typeid(T); otherwise typeid(void)
const type_info* const _Info = _TypeInfo();
if (_Info) {
return *_Info;
}
return typeid(void);
}
template <class _Decayed>
_NODISCARD const _Decayed* _Cast() const noexcept {
// if *this contains a value of type _Decayed, return a pointer to it
const type_info* const _Info = _TypeInfo();
if (!_Info || *_Info != typeid(_Decayed)) {
return nullptr;
}
if constexpr (_Any_is_trivial<_Decayed>) {
// get a pointer to the contained _Trivial value of type _Decayed
return reinterpret_cast<const _Decayed*>(&_Storage._TrivialData);
} else if constexpr (_Any_is_small<_Decayed>) {
// get a pointer to the contained _Small value of type _Decayed
return reinterpret_cast<const _Decayed*>(&_Storage._SmallStorage._Data);
} else {
// get a pointer to the contained _Big value of type _Decayed
return static_cast<const _Decayed*>(_Storage._BigStorage._Ptr);
}
}
template <class _Decayed>
_NODISCARD _Decayed* _Cast() noexcept { // if *this contains a value of type _Decayed, return a pointer to it
return const_cast<_Decayed*>(static_cast<const any*>(this)->_Cast<_Decayed>());
}
private:
static constexpr uintptr_t _Rep_mask = 3;
_NODISCARD _Any_representation _Rep() const noexcept { // extract the representation format from _TypeData
return static_cast<_Any_representation>(_Storage._TypeData & _Rep_mask);
}
_NODISCARD const type_info* _TypeInfo() const noexcept { // extract the type_info from _TypeData
return reinterpret_cast<const type_info*>(_Storage._TypeData & ~_Rep_mask);
}
void _Move_from(any& _That) noexcept {
_Storage._TypeData = _That._Storage._TypeData;
switch (_Rep()) {
case _Any_representation::_Small:
_Storage._SmallStorage._RTTI = _That._Storage._SmallStorage._RTTI;
_Storage._SmallStorage._RTTI->_Move(&_Storage._SmallStorage._Data, &_That._Storage._SmallStorage._Data);
break;
case _Any_representation::_Big:
_Storage._BigStorage._RTTI = _That._Storage._BigStorage._RTTI;
_Storage._BigStorage._Ptr = _That._Storage._BigStorage._Ptr;
_That._Storage._TypeData = 0;
break;
case _Any_representation::_Trivial:
default:
_CSTD memcpy(_Storage._TrivialData, _That._Storage._TrivialData, sizeof(_Storage._TrivialData));
break;
}
}
void _Assign(any _That) noexcept { // intentionally pass by value
reset();
_Move_from(_That);
}
template <class _Decayed, class... _Types>
_Decayed& _Emplace(_Types&&... _Args) { // emplace construct _Decayed
if constexpr (_Any_is_trivial<_Decayed>) {
// using the _Trivial representation
auto& _Obj = reinterpret_cast<_Decayed&>(_Storage._TrivialData);
_STD _Construct_in_place(_Obj, _STD forward<_Types>(_Args)...);
_Storage._TypeData =
reinterpret_cast<uintptr_t>(&typeid(_Decayed)) | static_cast<uintptr_t>(_Any_representation::_Trivial);
return _Obj;
} else if constexpr (_Any_is_small<_Decayed>) {
// using the _Small representation
auto& _Obj = reinterpret_cast<_Decayed&>(_Storage._SmallStorage._Data);
_STD _Construct_in_place(_Obj, _STD forward<_Types>(_Args)...);
_Storage._SmallStorage._RTTI = &_Any_small_RTTI_obj<_Decayed>;
_Storage._TypeData =
reinterpret_cast<uintptr_t>(&typeid(_Decayed)) | static_cast<uintptr_t>(_Any_representation::_Small);
return _Obj;
} else {
// using the _Big representation
_Decayed* const _Ptr = ::new _Decayed(_STD forward<_Types>(_Args)...);
_Storage._BigStorage._Ptr = _Ptr;
_Storage._BigStorage._RTTI = &_Any_big_RTTI_obj<_Decayed>;
_Storage._TypeData =
reinterpret_cast<uintptr_t>(&typeid(_Decayed)) | static_cast<uintptr_t>(_Any_representation::_Big);
return *_Ptr;
}
}
struct _Small_storage_t {
unsigned char _Data[_Any_small_space_size];
const _Any_small_RTTI* _RTTI;
};
static_assert(sizeof(_Small_storage_t) == _Any_trivial_space_size);
struct _Big_storage_t {
// Pad so that _Ptr and _RTTI might share _TypeData's cache line
unsigned char _Padding[_Any_small_space_size - sizeof(void*)];
void* _Ptr;
const _Any_big_RTTI* _RTTI;
};
static_assert(sizeof(_Big_storage_t) == _Any_trivial_space_size);
struct _Storage_t {
union {
unsigned char _TrivialData[_Any_trivial_space_size];
_Small_storage_t _SmallStorage;
_Big_storage_t _BigStorage;
};
uintptr_t _TypeData;
};
static_assert(sizeof(_Storage_t) == _Any_trivial_space_size + sizeof(void*));
static_assert(is_standard_layout_v<_Storage_t>);
union {
_Storage_t _Storage{};
max_align_t _Dummy;
};
};
// Non-member functions [any.nonmembers]
_EXPORT_STD inline void swap(any& _Left, any& _Right) noexcept {
_Left.swap(_Right);
}
_EXPORT_STD template <class _ValueType, class... _Types,
enable_if_t<is_constructible_v<any, in_place_type_t<_ValueType>, _Types...>, int> = 0>
_NODISCARD any make_any(_Types&&... _Args) { // construct an any containing a _ValueType initialized with _Args...
return any{in_place_type<_ValueType>, _STD forward<_Types>(_Args)...};
}
_EXPORT_STD template <class _ValueType, class _Elem, class... _Types,
enable_if_t<is_constructible_v<any, in_place_type_t<_ValueType>, initializer_list<_Elem>&, _Types...>, int> = 0>
_NODISCARD any make_any(initializer_list<_Elem> _Ilist, _Types&&... _Args) {
// construct an any containing a _ValueType initialized with _Ilist and _Args...
return any{in_place_type<_ValueType>, _Ilist, _STD forward<_Types>(_Args)...};
}
_EXPORT_STD template <class _ValueType>
_NODISCARD const _ValueType* any_cast(const any* const _Any) noexcept {
// retrieve a pointer to the _ValueType contained in _Any, or null
static_assert(!is_void_v<_ValueType>, "std::any cannot contain void.");
if constexpr (is_function_v<_ValueType> || is_array_v<_ValueType>) {
return nullptr;
} else {
if (!_Any) {
return nullptr;
}
return _Any->_Cast<_Remove_cvref_t<_ValueType>>();
}
}
_EXPORT_STD template <class _ValueType>
_NODISCARD _ValueType* any_cast(any* const _Any) noexcept {
// retrieve a pointer to the _ValueType contained in _Any, or null
static_assert(!is_void_v<_ValueType>, "std::any cannot contain void.");
if constexpr (is_function_v<_ValueType> || is_array_v<_ValueType>) {
return nullptr;
} else {
if (!_Any) {
return nullptr;
}
return _Any->_Cast<_Remove_cvref_t<_ValueType>>();
}
}
_EXPORT_STD template <class _Ty>
_NODISCARD remove_cv_t<_Ty> any_cast(const any& _Any) {
static_assert(is_constructible_v<remove_cv_t<_Ty>, const _Remove_cvref_t<_Ty>&>,
"any_cast<T>(const any&) requires remove_cv_t<T> to be constructible from "
"const remove_cv_t<remove_reference_t<T>>&");
const auto _Ptr = _STD any_cast<_Remove_cvref_t<_Ty>>(&_Any);
if (!_Ptr) {
_Throw_bad_any_cast();
}
return static_cast<remove_cv_t<_Ty>>(*_Ptr);
}
_EXPORT_STD template <class _Ty>
_NODISCARD remove_cv_t<_Ty> any_cast(any& _Any) {
static_assert(is_constructible_v<remove_cv_t<_Ty>, _Remove_cvref_t<_Ty>&>,
"any_cast<T>(any&) requires remove_cv_t<T> to be constructible from remove_cv_t<remove_reference_t<T>>&");
const auto _Ptr = _STD any_cast<_Remove_cvref_t<_Ty>>(&_Any);
if (!_Ptr) {
_Throw_bad_any_cast();
}
return static_cast<remove_cv_t<_Ty>>(*_Ptr);
}
_EXPORT_STD template <class _Ty>
_NODISCARD remove_cv_t<_Ty> any_cast(any&& _Any) {
static_assert(is_constructible_v<remove_cv_t<_Ty>, _Remove_cvref_t<_Ty>>,
"any_cast<T>(any&&) requires remove_cv_t<T> to be constructible from remove_cv_t<remove_reference_t<T>>");
const auto _Ptr = _STD any_cast<_Remove_cvref_t<_Ty>>(&_Any);
if (!_Ptr) {
_Throw_bad_any_cast();
}
return static_cast<remove_cv_t<_Ty>>(_STD move(*_Ptr));
}
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // ^^^ _HAS_STATIC_RTTI ^^^
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _ANY_
@@ -0,0 +1,186 @@
/***
* arm64intr.h - definitions and declarations for ARM64 specific intrinsics
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file contains constant definitions and external subroutine
* declarations for the ARM64 specific intrinsics
*
****/
#pragma once
#if !defined(_M_ARM64) && !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC)
#error This header is specific to ARM64 targets
#endif
#define ARM64_SYSREG(op0, op1, crn, crm, op2) \
( ((op0 & 1) << 14) | \
((op1 & 7) << 11) | \
((crn & 15) << 7) | \
((crm & 15) << 3) | \
((op2 & 7) << 0) )
#define ARM64_FPCR ARM64_SYSREG(3, 3, 4, 4, 0) // Floating point control register (EL0)
#define ARM64_FPSR ARM64_SYSREG(3, 3, 4, 4, 1) // Floating point status register (EL0)
typedef struct {
unsigned __int64 _val[8];
} data512_t;
#if defined(__cplusplus)
extern "C" {
#endif
// ARM64-TRANSITION: define more. Only need barrier so far.
typedef enum _tag_ARM64INTR_BARRIER_TYPE
{
_ARM64_BARRIER_SY = 0xF,
_ARM64_BARRIER_ST = 0xE,
_ARM64_BARRIER_LD = 0xD,
_ARM64_BARRIER_ISH = 0xB,
_ARM64_BARRIER_ISHST = 0xA,
_ARM64_BARRIER_ISHLD = 0x9,
_ARM64_BARRIER_NSH = 0x7,
_ARM64_BARRIER_NSHST = 0x6,
_ARM64_BARRIER_NSHLD = 0x5,
_ARM64_BARRIER_OSH = 0x3,
_ARM64_BARRIER_OSHST = 0x2,
_ARM64_BARRIER_OSHLD = 0x1
}
_ARM64INTR_BARRIER_TYPE;
void __dmb(unsigned int _Type);
void __dsb(unsigned int _Type);
void __isb(unsigned int _Type);
void __sb(void);
void __ld64b(const void *_addr, unsigned __int64 _value[8]);
void __st64b(void *_addr, unsigned __int64 _value[8]);
unsigned __int64 __st64bv(void *_addr, unsigned __int64 _value[8]);
unsigned __int64 __st64bv0(void *_addr, unsigned __int64 _value[8]);
static __forceinline data512_t __arm_ld64b(const void *_addr)
{
data512_t _value;
__ld64b(_addr, _value._val);
return _value;
}
static __forceinline void __arm_st64b(void *_addr, data512_t _value)
{
__st64b(_addr, _value._val);
}
static __forceinline unsigned __int64 __arm_st64bv(void *_addr, data512_t _value)
{
return __st64bv(_addr, _value._val);
}
static __forceinline unsigned __int64 __arm_st64bv0(void *_addr, data512_t _value)
{
return __st64bv0(_addr, _value._val);
}
unsigned __int8 __ldar8(const volatile unsigned __int8 * _Target);
unsigned __int16 __ldar16(const volatile unsigned __int16 * _Target);
unsigned __int32 __ldar32(const volatile unsigned __int32 * _Target);
unsigned __int64 __ldar64(const volatile unsigned __int64 * _Target);
unsigned __int8 __ldapr8(const volatile unsigned __int8 * _Target);
unsigned __int16 __ldapr16(const volatile unsigned __int16 * _Target);
unsigned __int32 __ldapr32(const volatile unsigned __int32 * _Target);
unsigned __int64 __ldapr64(const volatile unsigned __int64 * _Target);
unsigned __int8 __load_acquire8(const volatile unsigned __int8 * _Target);
unsigned __int16 __load_acquire16(const volatile unsigned __int16 * _Target);
unsigned __int32 __load_acquire32(const volatile unsigned __int32 * _Target);
unsigned __int64 __load_acquire64(const volatile unsigned __int64 * _Target);
unsigned __int8 __ldxr8(const volatile unsigned __int8 * _Target);
unsigned __int16 __ldxr16(const volatile unsigned __int16 * _Target);
unsigned __int32 __ldxr32(const volatile unsigned __int32 * _Target);
unsigned __int64 __ldxr64(const volatile unsigned __int64 * _Target);
unsigned __int8 __ldaxr8(const volatile unsigned __int8 * _Target);
unsigned __int16 __ldaxr16(const volatile unsigned __int16 * _Target);
unsigned __int32 __ldaxr32(const volatile unsigned __int32 * _Target);
unsigned __int64 __ldaxr64(const volatile unsigned __int64 * _Target);
unsigned __int8 __stxr8(volatile unsigned __int8 * _Target, unsigned __int8 _Value);
unsigned __int8 __stxr16(volatile unsigned __int16 * _Target, unsigned __int16 _Value);
unsigned __int8 __stxr32(volatile unsigned __int32 * _Target, unsigned __int32 _Value);
unsigned __int8 __stxr64(volatile unsigned __int64 * _Target, unsigned __int64 _Value);
unsigned __int8 __stlxr8(volatile unsigned __int8 * _Target, unsigned __int8 _Value);
unsigned __int8 __stlxr16(volatile unsigned __int16 * _Target, unsigned __int16 _Value);
unsigned __int8 __stlxr32(volatile unsigned __int32 * _Target, unsigned __int32 _Value);
unsigned __int8 __stlxr64(volatile unsigned __int64 * _Target, unsigned __int64 _Value);
void __clrex(unsigned __int8 crm);
void __stlr8(volatile unsigned __int8 * _Target, unsigned __int8 _Value);
void __stlr16(volatile unsigned __int16 * _Target, unsigned __int16 _Value);
void __stlr32(volatile unsigned __int32 * _Target, unsigned __int32 _Value);
void __stlr64(volatile unsigned __int64 * _Target, unsigned __int64 _Value);
// load/store unprivileged
unsigned __int8 __ldtr8(const volatile unsigned __int8 * _Target);
unsigned __int16 __ldtr16(const volatile unsigned __int16 * _Target);
unsigned __int32 __ldtr32(const volatile unsigned __int32 * _Target);
unsigned __int64 __ldtr64(const volatile unsigned __int64 * _Target);
signed __int8 __ldtrs8(const volatile __int8 * _Target);
signed __int16 __ldtrs16(const volatile __int16 * _Target);
signed __int32 __ldtrs32(const volatile __int32 * _Target);
void __sttr8(volatile unsigned __int8 * _Target, unsigned __int8 _Value);
void __sttr16(volatile unsigned __int16 * _Target, unsigned __int16 _Value);
void __sttr32(volatile unsigned __int32 * _Target, unsigned __int32 _Value);
void __sttr64(volatile unsigned __int64 * _Target, unsigned __int64 _Value);
unsigned __int8 __swp8(unsigned __int8 volatile * _Target, unsigned __int8 _Value);
unsigned __int16 __swp16(unsigned __int16 volatile * _Target, unsigned __int16 _Value);
unsigned __int32 __swp32(unsigned __int32 volatile * _Target, unsigned __int32 _Value);
unsigned __int64 __swp64(unsigned __int64 volatile * _Target, unsigned __int64 _Value);
unsigned __int8 __swpa8(unsigned __int8 volatile * _Target, unsigned __int8 _Value);
unsigned __int16 __swpa16(unsigned __int16 volatile * _Target, unsigned __int16 _Value);
unsigned __int32 __swpa32(unsigned __int32 volatile * _Target, unsigned __int32 _Value);
unsigned __int64 __swpa64(unsigned __int64 volatile * _Target, unsigned __int64 _Value);
unsigned __int8 __swpl8(unsigned __int8 volatile * _Target, unsigned __int8 _Value);
unsigned __int16 __swpl16(unsigned __int16 volatile * _Target, unsigned __int16 _Value);
unsigned __int32 __swpl32(unsigned __int32 volatile * _Target, unsigned __int32 _Value);
unsigned __int64 __swpl64(unsigned __int64 volatile * _Target, unsigned __int64 _Value);
unsigned __int8 __swpal8(unsigned __int8 volatile * _Target, unsigned __int8 _Value);
unsigned __int16 __swpal16(unsigned __int16 volatile * _Target, unsigned __int16 _Value);
unsigned __int32 __swpal32(unsigned __int32 volatile * _Target, unsigned __int32 _Value);
unsigned __int64 __swpal64(unsigned __int64 volatile * _Target, unsigned __int64 _Value);
unsigned __int8 __cas8(unsigned __int8 volatile * _Target, unsigned __int8 _Comp, unsigned __int8 _Value);
unsigned __int16 __cas16(unsigned __int16 volatile * _Target, unsigned __int16 _Comp, unsigned __int16 _Value);
unsigned __int32 __cas32(unsigned __int32 volatile * _Target, unsigned __int32 _Comp, unsigned __int32 _Value);
unsigned __int64 __cas64(unsigned __int64 volatile * _Target, unsigned __int64 _Comp, unsigned __int64 _Value);
unsigned __int8 __casa8(unsigned __int8 volatile * _Target, unsigned __int8 _Comp, unsigned __int8 _Value);
unsigned __int16 __casa16(unsigned __int16 volatile * _Target, unsigned __int16 _Comp, unsigned __int16 _Value);
unsigned __int32 __casa32(unsigned __int32 volatile * _Target, unsigned __int32 _Comp, unsigned __int32 _Value);
unsigned __int64 __casa64(unsigned __int64 volatile * _Target, unsigned __int64 _Comp, unsigned __int64 _Value);
unsigned __int8 __casl8(unsigned __int8 volatile * _Target, unsigned __int8 _Comp, unsigned __int8 _Value);
unsigned __int16 __casl16(unsigned __int16 volatile * _Target, unsigned __int16 _Comp, unsigned __int16 _Value);
unsigned __int32 __casl32(unsigned __int32 volatile * _Target, unsigned __int32 _Comp, unsigned __int32 _Value);
unsigned __int64 __casl64(unsigned __int64 volatile * _Target, unsigned __int64 _Comp, unsigned __int64 _Value);
unsigned __int8 __casal8(unsigned __int8 volatile * _Target, unsigned __int8 _Comp, unsigned __int8 _Value);
unsigned __int16 __casal16(unsigned __int16 volatile * _Target, unsigned __int16 _Comp, unsigned __int16 _Value);
unsigned __int32 __casal32(unsigned __int32 volatile * _Target, unsigned __int32 _Comp, unsigned __int32 _Value);
unsigned __int64 __casal64(unsigned __int64 volatile * _Target, unsigned __int64 _Comp, unsigned __int64 _Value);
void * __xpaci(void * _Pointer);
// Reverses the bits in _Value.
unsigned __int32 __rbit(unsigned __int32 _Value);
unsigned long __rbitl(unsigned long _Value);
unsigned __int64 __rbitll(unsigned __int64 _Value);
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,599 @@
/***
* armintr.h - definitions and declarations for ARM specific intrinsics
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file contains constant definitions and external subroutine
* declarations for the ARM specific intrinsics
*
****/
#pragma once
#if !defined (_M_ARM)
#error This header is specific to ARM targets
#endif /* !defined (_M_ARM) */
#if defined (__cplusplus)
extern "C" {
#endif /* defined (__cplusplus) */
typedef enum _tag_ARMINTR_SHIFT_T
{
_ARM_LSR = 0,
_ARM_LSL = 1,
_ARM_ASR = 2,
_ARM_ROR = 3
}
_ARMINTR_SHIFT_T;
int __arm_gen_s_Rd_Rd (const unsigned int, int);
int __arm_gen_s_Rd_RdRn (const unsigned int, int, int);
int __arm_gen_s_Rd_RdRm (const unsigned int, int, int);
int __arm_gen_s_Rd_RnRm_g (const unsigned int, int, int);
int __arm_gen_s_Rd_RnRm_q (const unsigned int, int, int);
int __arm_gen_s_Rd_Rn (const unsigned int, int);
int __arm_gen_s_Rd_Rn_q (const unsigned int, int);
int __arm_gen_s_Rd_RnRm (const unsigned int, int, int);
int __arm_gen_s_Rd_Rm (const unsigned int, int);
int __arm_gen_s_Rd_Rm_q (const unsigned int, int);
int __arm_gen_s_Rd_Rm2 (const unsigned int, int);
__int64 __arm_gen_s_Rdn_RdnRmRs(const unsigned int, __int64, int, int);
__int64 __arm_gen_s_Rdn_RmRs (const unsigned int, int, int);
int __arm_gen_s_Rn_RmRs (const unsigned int, int, int);
int __arm_gen_s_Rn_RmRsRd (const unsigned int, int, int, int);
unsigned int __arm_gen_u_Rd_Rd (const unsigned int, unsigned int);
unsigned int __arm_gen_u_Rd_RdRn (const unsigned int, unsigned int, unsigned int);
unsigned int __arm_gen_u_Rd_RdRm (const unsigned int, unsigned int, unsigned int);
unsigned int __arm_gen_u_Rd_RnRm_g (const unsigned int, unsigned int, unsigned int);
unsigned int __arm_gen_u_Rd_Rn (const unsigned int, unsigned int);
unsigned int __arm_gen_u_Rd_RnRm (const unsigned int, unsigned int, unsigned int);
unsigned int __arm_gen_u_Rd_Rm (const unsigned int, unsigned int);
unsigned int __arm_gen_u_Rd_Rm2 (const unsigned int, unsigned int);
unsigned __int64 __arm_gen_u_Rdn_RdnRmRs(const unsigned int, unsigned __int64, unsigned int, unsigned int);
unsigned __int64 __arm_gen_u_Rdn_RmRs (const unsigned int, unsigned int, unsigned int);
unsigned int __arm_gen_u_Rn_RmRs (const unsigned int, unsigned int, unsigned int);
unsigned int __arm_gen_u_Rn_RmRsRd (const unsigned int, unsigned int, unsigned int, unsigned int);
#define _ARMINTR_ASSERT(exp, msg) __static_assert(exp, msg)
#define _ARMINTR_IN_RANGE(val, low, high) (((val) >= low) && ((val) <= high))
#define _ARMINTR_ASSERT_RANGE(val, low, high, name) \
(_ARMINTR_ASSERT(_ARMINTR_IN_RANGE((val), (low), (high)), name " is out of range '" #low " - " #high "'"))
#define _ARMINTR_ASSERT_ROT(rot) \
(_ARMINTR_ASSERT(((rot) & ~0x18U) == 0, "rotation must be 0, 8, 16, or 24"))
#define _ARMINTR_ASSERT_SAT_BIT(sat_bit, low, high) \
(_ARMINTR_ASSERT_RANGE((sat_bit), low, high, "saturation bit position")) // low, high intentionally not in (parentheses)
#if defined (_M_THUMB)
#define _ARMINTR_ASSERT_SAT_SHIFT(type, amt) \
(_ARMINTR_ASSERT(((type) == _ARM_LSL) || ((type) == _ARM_ASR), "shift type must be _ARM_LSL or _ARM_ASR"), \
_ARMINTR_ASSERT(((type) != _ARM_LSL) || _ARMINTR_IN_RANGE((amt), 0, 31), "shift is out of range '0 - 31'"), \
_ARMINTR_ASSERT(((type) != _ARM_ASR) || _ARMINTR_IN_RANGE((amt), 1, 31), "shift is out of range '1 - 31'"))
#else /* defined (_M_THUMB) */
#define _ARMINTR_ASSERT_SAT_SHIFT(type, amt) \
(_ARMINTR_ASSERT(((type) == _ARM_LSL) || ((type) == _ARM_ASR), "shift type must be _ARM_LSL or _ARM_ASR"), \
_ARMINTR_ASSERT(((type) != _ARM_LSL) || _ARMINTR_IN_RANGE((amt), 0, 31), "shift is out of range '0 - 31'"), \
_ARMINTR_ASSERT(((type) != _ARM_ASR) || _ARMINTR_IN_RANGE((amt), 1, 32), "shift is out of range '1 - 32'"))
#endif /* defined (_M_THUMB) */
#if defined (_M_THUMB)
#define _ARMINTR_ENCODE_XTROT(rot) (((rot) & 0x18U) << 17)
#define _ARMINTR_ENCODE_PKHSHIFT(shift) ((((shift) & 0x1CU) << 26) | (((shift) & 0x3U) << 22))
#define _ARMINTR_ENCODE_IMM5_16(imm) (((imm) & 0x1FU) << 16)
#define _ARMINTR_ENCODE_IMM5_7(imm) ((((imm) & 0x1CU) << 26) | (((imm) & 0x3U) << 22))
#define _ARMINTR_ENCODE_SAT_SH(type, amt) ((((type) & 2U) << 4) | _ARMINTR_ENCODE_IMM5_7(amt))
#define _ARMINTR_ENCODE_IMM4_16(bit) (((bit) & 0xFU) << 16)
#define _ARMINTR_BFC 0x0000F36FU
#define _ARMINTR_BFI 0x0000F360U
#define _ARMINTR_SBFX 0x0000F340U
#define _ARMINTR_UBFX 0x0000F3C0U
#define _ARMINTR_QADD 0xF080FA80U
#define _ARMINTR_QDADD 0xF090FA80U
#define _ARMINTR_QDSUB 0xF0B0FA80U
#define _ARMINTR_QSUB 0xF0A0FA80U
#define _ARMINTR_QADD16 0xF010FA90U
#define _ARMINTR_QADD8 0xF010FA80U
#define _ARMINTR_QASX 0xF010FAA0U
#define _ARMINTR_QSAX 0xF010FAE0U
#define _ARMINTR_QSUB16 0xF010FAD0U
#define _ARMINTR_QSUB8 0xF010FAC0U
#define _ARMINTR_SHADD16 0xF020FA90U
#define _ARMINTR_SHADD8 0xF020FA80U
#define _ARMINTR_SHASX 0xF020FAA0U
#define _ARMINTR_SHSAX 0xF020FAE0U
#define _ARMINTR_SHSUB16 0xF020FAD0U
#define _ARMINTR_SHSUB8 0xF020FAC0U
#define _ARMINTR_UHADD16 0xF060FA90U
#define _ARMINTR_UHADD8 0xF060FA80U
#define _ARMINTR_UHASX 0xF060FAA0U
#define _ARMINTR_UHSAX 0xF060FAE0U
#define _ARMINTR_UHSUB16 0xF060FAD0U
#define _ARMINTR_UHSUB8 0xF060FAC0U
#define _ARMINTR_UQADD16 0xF050FA90U
#define _ARMINTR_UQADD8 0xF050FA80U
#define _ARMINTR_UQASX 0xF050FAA0U
#define _ARMINTR_UQSAX 0xF050FAE0U
#define _ARMINTR_UQSUB16 0xF050FAD0U
#define _ARMINTR_UQSUB8 0xF050FAC0U
#define _ARMINTR_SXTAB 0xF080FA40U
#define _ARMINTR_SXTAB16 0xF080FA20U
#define _ARMINTR_SXTAH 0xF080FA00U
#define _ARMINTR_UXTAB 0xF080FA50U
#define _ARMINTR_UXTAB16 0xF080FA30U
#define _ARMINTR_UXTAH 0xF080FA10U
#define _ARMINTR_SXTB 0xF080FA4FU
#define _ARMINTR_SXTB16 0xF080FA2FU
#define _ARMINTR_SXTH 0xF080FA0FU
#define _ARMINTR_UXTB 0xF080FA5FU
#define _ARMINTR_UXTB16 0xF080FA3FU
#define _ARMINTR_UXTBH 0xF080FA1FU
#define _ARMINTR_PKHBT 0x0000EAC0U
#define _ARMINTR_PKHTB 0x0020EAC0U
#define _ARMINTR_USAD8 0xF000FB70U
#define _ARMINTR_USADA8 0x0000FB70U
#define _ARMINTR_SADD16 0xF000FA90U
#define _ARMINTR_SADD8 0xF000FA80U
#define _ARMINTR_SASX 0xF000FAA0U
#define _ARMINTR_SSAX 0xF000FAE0U
#define _ARMINTR_SSUB16 0xF000FAD0U
#define _ARMINTR_SSUB8 0xF000FAC0U
#define _ARMINTR_UADD16 0xF040FA90U
#define _ARMINTR_UADD8 0xF040FA80U
#define _ARMINTR_UASX 0xF040FAA0U
#define _ARMINTR_USAX 0xF040FAE0U
#define _ARMINTR_USUB16 0xF040FAD0U
#define _ARMINTR_USUB8 0xF040FAC0U
#define _ARMINTR_SSAT 0x0000F300U
#define _ARMINTR_USAT 0x0000F380U
#define _ARMINTR_SSAT16 0x0000F320U
#define _ARMINTR_USAT16 0x0000F3A0U
#define _ARMINTR_CLZ 0xF080FAB0U
#define _ARMINTR_RBIT 0xF0A0FA90U
#define _ARMINTR_REV 0xF080FA90U
#define _ARMINTR_REV16 0xF090FA90U
#define _ARMINTR_REVSH 0xF0B0FA90U
#define _ARMINTR_SMLAD 0x0000FB20U
#define _ARMINTR_SMLADX 0x0010FB20U
#define _ARMINTR_SMLSD 0x0000FB40U
#define _ARMINTR_SMLSDX 0x0010FB40U
#define _ARMINTR_SMMLA 0x0000FB50U
#define _ARMINTR_SMMLAR 0x0010FB50U
#define _ARMINTR_SMMLS 0x0000FB60U
#define _ARMINTR_SMMLSR 0x0010FB60U
#define _ARMINTR_SMLABB 0x0000FB10U
#define _ARMINTR_SMLABT 0x0010FB10U
#define _ARMINTR_SMLATB 0x0020FB10U
#define _ARMINTR_SMLATT 0x0030FB10U
#define _ARMINTR_SMLAWB 0x0000FB30U
#define _ARMINTR_SMLAWT 0x0010FB30U
#define _ARMINTR_SMULWB 0xF000FB30U
#define _ARMINTR_SMULWT 0xF010FB30U
#define _ARMINTR_SMULBB 0xF000FB10U
#define _ARMINTR_SMULBT 0xF010FB10U
#define _ARMINTR_SMULTB 0xF020FB10U
#define _ARMINTR_SMULTT 0xF030FB10U
#define _ARMINTR_SMULL 0x0000FB80U
#define _ARMINTR_SMMUL 0xF000FB50U
#define _ARMINTR_SMMULR 0xF010FB50U
#define _ARMINTR_SMUAD 0xF000FB20U
#define _ARMINTR_SMUADX 0xF010FB20U
#define _ARMINTR_SMUSD 0xF000FB40U
#define _ARMINTR_SMUSDX 0xF010FB40U
#define _ARMINTR_SMLALBB 0x0080FBC0U
#define _ARMINTR_SMLALBT 0x0090FBC0U
#define _ARMINTR_SMLALTB 0x00A0FBC0U
#define _ARMINTR_SMLALTT 0x00B0FBC0U
#define _ARMINTR_SMLALD 0x00C0FBC0U
#define _ARMINTR_SMLALDX 0x00D0FBC0U
#define _ARMINTR_SMLSLD 0x00C0FBD0U
#define _ARMINTR_SMLSLDX 0x00D0FBD0U
#define _ARMINTR_SMLAL 0x0000FBC0U
#define _ARMINTR_UMLAL 0x0000FBE0U
#define _ARMINTR_UMAAL 0x0060FBE0U
#define _ARMINTR_UMULL 0x0000FBA0U
#define _ARMINTR_SDIV 0xF0F0FB90U
#define _ARMINTR_UDIV 0xF0F0FBB0U
#define _ARMINTR_U_DDMx __arm_gen_u_Rd_RdRn
#define _ARMINTR_U_DMx __arm_gen_u_Rd_Rn
#define _ARMINTR_S_DMx __arm_gen_s_Rd_Rn
#else /* defined (_M_THUMB) */
#define _ARMINTR_ENCODE_XTROT(rot) (((rot) & 0x18U) << 7)
#define _ARMINTR_ENCODE_PKHSHIFT(shift) (((shift) & 0x1FU) << 7)
#define _ARMINTR_ENCODE_IMM5_16(imm) (((imm) & 0x1FU) << 16)
#define _ARMINTR_ENCODE_IMM5_7(imm) (((imm) & 0x1FU) << 7)
#define _ARMINTR_ENCODE_SAT_SH(type, amt) ((((type) & 2U) << 5) | _ARMINTR_ENCODE_IMM5_7(amt))
#define _ARMINTR_ENCODE_IMM4_16(bit) (((bit) & 0xFU) << 16)
#define _ARMINTR_BFC 0x07C0001FU
#define _ARMINTR_BFI 0x07C00010U
#define _ARMINTR_SBFX 0x07A00050U
#define _ARMINTR_UBFX 0x07E00050U
#define _ARMINTR_QADD 0x01000050U
#define _ARMINTR_QDADD 0x01400050U
#define _ARMINTR_QDSUB 0x01600050U
#define _ARMINTR_QSUB 0x01200050U
#define _ARMINTR_QADD16 0x06200F10U
#define _ARMINTR_QADD8 0x06200F90U
#define _ARMINTR_QASX 0x06200F30U
#define _ARMINTR_QSAX 0x06200F50U
#define _ARMINTR_QSUB16 0x06200F70U
#define _ARMINTR_QSUB8 0x06200FF0U
#define _ARMINTR_SHADD16 0x06300F10U
#define _ARMINTR_SHADD8 0x06300F90U
#define _ARMINTR_SHASX 0x06300F30U
#define _ARMINTR_SHSAX 0x06300F50U
#define _ARMINTR_SHSUB16 0x06300F70U
#define _ARMINTR_SHSUB8 0x06300FF0U
#define _ARMINTR_UHADD16 0x06700F10U
#define _ARMINTR_UHADD8 0x06700F90U
#define _ARMINTR_UHASX 0x06700F30U
#define _ARMINTR_UHSAX 0x06700F50U
#define _ARMINTR_UHSUB16 0x06700F70U
#define _ARMINTR_UHSUB8 0x06700FF0U
#define _ARMINTR_UQADD16 0x06600F10U
#define _ARMINTR_UQADD8 0x06600F90U
#define _ARMINTR_UQASX 0x06600F30U
#define _ARMINTR_UQSAX 0x06600F50U
#define _ARMINTR_UQSUB16 0x06600F70U
#define _ARMINTR_UQSUB8 0x06600FF0U
#define _ARMINTR_SXTAB 0x06A00070U
#define _ARMINTR_SXTAB16 0x06800070U
#define _ARMINTR_SXTAH 0x06B00070U
#define _ARMINTR_UXTAB 0x06E00070U
#define _ARMINTR_UXTAB16 0x06C00070U
#define _ARMINTR_UXTAH 0x06F00070U
#define _ARMINTR_SXTB 0x06AF0070U
#define _ARMINTR_SXTB16 0x068F0070U
#define _ARMINTR_SXTH 0x06BF0070U
#define _ARMINTR_UXTB 0x06EF0070U
#define _ARMINTR_UXTB16 0x06CF0070U
#define _ARMINTR_UXTBH 0x06FF0070U
#define _ARMINTR_PKHBT 0x06800010U
#define _ARMINTR_PKHTB 0x06800050U
#define _ARMINTR_USAD8 0x0780F010U
#define _ARMINTR_USADA8 0x07800010U
#define _ARMINTR_SADD16 0x06100F10U
#define _ARMINTR_SADD8 0x06100F90U
#define _ARMINTR_SASX 0x06100F30U
#define _ARMINTR_SSAX 0x06100F50U
#define _ARMINTR_SSUB16 0x06100F70U
#define _ARMINTR_SSUB8 0x06100FF0U
#define _ARMINTR_UADD16 0x06500F10U
#define _ARMINTR_UADD8 0x06500F90U
#define _ARMINTR_UASX 0x06500F30U
#define _ARMINTR_USAX 0x06500F50U
#define _ARMINTR_USUB16 0x06500F70U
#define _ARMINTR_USUB8 0x06500FF0U
#define _ARMINTR_SSAT 0x06A00010U
#define _ARMINTR_USAT 0x06E00010U
#define _ARMINTR_SSAT16 0x06A00F30U
#define _ARMINTR_USAT16 0x06E00F30U
#define _ARMINTR_CLZ 0x016F0F10U
#define _ARMINTR_RBIT 0x06FF0F30U
#define _ARMINTR_REV 0x06BF0F30U
#define _ARMINTR_REV16 0x06BF0FB0U
#define _ARMINTR_REVSH 0x06FF0FB0U
#define _ARMINTR_SMLAD 0x07000010U
#define _ARMINTR_SMLADX 0x07000030U
#define _ARMINTR_SMLSD 0x07000050U
#define _ARMINTR_SMLSDX 0x07000070U
#define _ARMINTR_SMMLA 0x07500010U
#define _ARMINTR_SMMLAR 0x07500030U
#define _ARMINTR_SMMLS 0x075000D0U
#define _ARMINTR_SMMLSR 0x075000F0U
#define _ARMINTR_SMLABB 0x01000080U
#define _ARMINTR_SMLABT 0x010000C0U
#define _ARMINTR_SMLATB 0x010000A0U
#define _ARMINTR_SMLATT 0x010000E0U
#define _ARMINTR_SMLAWB 0x01200080U
#define _ARMINTR_SMLAWT 0x012000C0U
#define _ARMINTR_SMULWB 0x012000A0U
#define _ARMINTR_SMULWT 0x012000E0U
#define _ARMINTR_SMULBB 0x01600080U
#define _ARMINTR_SMULBT 0x016000C0U
#define _ARMINTR_SMULTB 0x016000A0U
#define _ARMINTR_SMULTT 0x016000E0U
#define _ARMINTR_SMULL 0x00C00090U
#define _ARMINTR_SMMUL 0x0750F010U
#define _ARMINTR_SMMULR 0x0750F030U
#define _ARMINTR_SMUAD 0x0700F010U
#define _ARMINTR_SMUADX 0x0700F030U
#define _ARMINTR_SMUSD 0x0700F050U
#define _ARMINTR_SMUSDX 0x0700F070U
#define _ARMINTR_SMLALBB 0x01400080U
#define _ARMINTR_SMLALBT 0x014000C0U
#define _ARMINTR_SMLALTB 0x014000A0U
#define _ARMINTR_SMLALTT 0x014000E0U
#define _ARMINTR_SMLALD 0x07400010U
#define _ARMINTR_SMLALDX 0x07400030U
#define _ARMINTR_SMLSLD 0x07400050U
#define _ARMINTR_SMLSLDX 0x07400070U
#define _ARMINTR_SMLAL 0x00E00090U
#define _ARMINTR_UMLAL 0x00A00090U
#define _ARMINTR_UMAAL 0x00400090U
#define _ARMINTR_UMULL 0x00800090U
#define _ARMINTR_U_DDMx __arm_gen_u_Rd_RdRm
#define _ARMINTR_U_DMx __arm_gen_u_Rd_Rm
#define _ARMINTR_S_DMx __arm_gen_s_Rd_Rm
#endif /* defined (_M_THUMB) */
/* ARMv4 */
#define _arm_smlal(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLAL, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_umlal(_RdHiLo, _Rn, _Rm) (__arm_gen_u_Rdn_RdnRmRs(_ARMINTR_UMLAL, (_RdHiLo), (_Rn), (_Rm)))
/* ARMv5E */
#define _arm_clz(_Rm) (__arm_gen_u_Rd_Rm2(_ARMINTR_CLZ, (_Rm)))
#define _arm_qadd(_Rm, _Rn) (__arm_gen_s_Rd_RnRm_q(_ARMINTR_QADD, (_Rn), (_Rm)))
#define _arm_qdadd(_Rm, _Rn) (__arm_gen_s_Rd_RnRm_q(_ARMINTR_QDADD, (_Rn), (_Rm)))
#define _arm_qdsub(_Rm, _Rn) (__arm_gen_s_Rd_RnRm_q(_ARMINTR_QDSUB, (_Rn), (_Rm)))
#define _arm_qsub(_Rm, _Rn) (__arm_gen_s_Rd_RnRm_q(_ARMINTR_QSUB, (_Rn), (_Rm)))
#define _arm_smlabb(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLABB, (_Rn), (_Rm), (_Ra)))
#define _arm_smlabt(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLABT, (_Rn), (_Rm), (_Ra)))
#define _arm_smlatb(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLATB, (_Rn), (_Rm), (_Ra)))
#define _arm_smlatt(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLATT, (_Rn), (_Rm), (_Ra)))
#define _arm_smlalbb(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLALBB, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smlalbt(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLALBT, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smlaltb(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLALTB, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smlaltt(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLALTT, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smlawb(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLAWB, (_Rn), (_Rm), (_Ra)))
#define _arm_smlawt(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLAWT, (_Rn), (_Rm), (_Ra)))
#define _arm_smulbb(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMULBB, (_Rn), (_Rm)))
#define _arm_smulbt(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMULBT, (_Rn), (_Rm)))
#define _arm_smultb(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMULTB, (_Rn), (_Rm)))
#define _arm_smultt(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMULTT, (_Rn), (_Rm)))
#define _arm_smulwb(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMULWB, (_Rn), (_Rm)))
#define _arm_smulwt(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMULWT, (_Rn), (_Rm)))
/* ARMv6 */
#define _arm_sadd16(_Rn, _Rm) (__arm_gen_s_Rd_RnRm_g(_ARMINTR_SADD16, (_Rn), (_Rm)))
#define _arm_sadd8(_Rn, _Rm) (__arm_gen_s_Rd_RnRm_g(_ARMINTR_SADD8, (_Rn), (_Rm)))
#define _arm_sasx(_Rn, _Rm) (__arm_gen_s_Rd_RnRm_g(_ARMINTR_SASX, (_Rn), (_Rm)))
#define _arm_ssax(_Rn, _Rm) (__arm_gen_s_Rd_RnRm_g(_ARMINTR_SSAX, (_Rn), (_Rm)))
#define _arm_ssub16(_Rn, _Rm) (__arm_gen_s_Rd_RnRm_g(_ARMINTR_SSUB16, (_Rn), (_Rm)))
#define _arm_ssub8(_Rn, _Rm) (__arm_gen_s_Rd_RnRm_g(_ARMINTR_SSUB8, (_Rn), (_Rm)))
#define _arm_shadd16(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_SHADD16, (_Rn), (_Rm)))
#define _arm_shadd8(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_SHADD8, (_Rn), (_Rm)))
#define _arm_shasx(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_SHASX, (_Rn), (_Rm)))
#define _arm_shsax(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_SHSAX, (_Rn), (_Rm)))
#define _arm_shsub16(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_SHSUB16, (_Rn), (_Rm)))
#define _arm_shsub8(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_SHSUB8, (_Rn), (_Rm)))
#define _arm_qadd16(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_QADD16, (_Rn), (_Rm)))
#define _arm_qadd8(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_QADD8, (_Rn), (_Rm)))
#define _arm_qasx(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_QASX, (_Rn), (_Rm)))
#define _arm_qsax(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_QSAX, (_Rn), (_Rm)))
#define _arm_qsub16(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_QSUB16, (_Rn), (_Rm)))
#define _arm_qsub8(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_QSUB8, (_Rn), (_Rm)))
#define _arm_uadd16(_Rn, _Rm) (__arm_gen_u_Rd_RnRm_g(_ARMINTR_UADD16, (_Rn), (_Rm)))
#define _arm_uadd8(_Rn, _Rm) (__arm_gen_u_Rd_RnRm_g(_ARMINTR_UADD8, (_Rn), (_Rm)))
#define _arm_uasx(_Rn, _Rm) (__arm_gen_u_Rd_RnRm_g(_ARMINTR_UASX, (_Rn), (_Rm)))
#define _arm_usax(_Rn, _Rm) (__arm_gen_u_Rd_RnRm_g(_ARMINTR_USAX, (_Rn), (_Rm)))
#define _arm_usub16(_Rn, _Rm) (__arm_gen_u_Rd_RnRm_g(_ARMINTR_USUB16, (_Rn), (_Rm)))
#define _arm_usub8(_Rn, _Rm) (__arm_gen_u_Rd_RnRm_g(_ARMINTR_USUB8, (_Rn), (_Rm)))
#define _arm_uhadd16(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UHADD16, (_Rn), (_Rm)))
#define _arm_uhadd8(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UHADD8, (_Rn), (_Rm)))
#define _arm_uhasx(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UHASX, (_Rn), (_Rm)))
#define _arm_uhsax(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UHSAX, (_Rn), (_Rm)))
#define _arm_uhsub16(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UHSUB16, (_Rn), (_Rm)))
#define _arm_uhsub8(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UHSUB8, (_Rn), (_Rm)))
#define _arm_uqadd16(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UQADD16, (_Rn), (_Rm)))
#define _arm_uqadd8(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UQADD8, (_Rn), (_Rm)))
#define _arm_uqasx(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UQASX, (_Rn), (_Rm)))
#define _arm_uqsax(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UQSAX, (_Rn), (_Rm)))
#define _arm_uqsub16(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UQSUB16, (_Rn), (_Rm)))
#define _arm_uqsub8(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UQSUB8, (_Rn), (_Rm)))
#define _arm_sxtab(_Rn, _Rm, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_s_Rd_RnRm(_ARMINTR_SXTAB | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn), (_Rm)))
#define _arm_sxtab16(_Rn, _Rm, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_s_Rd_RnRm(_ARMINTR_SXTAB16 | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn), (_Rm)))
#define _arm_sxtah(_Rn, _Rm, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_s_Rd_RnRm(_ARMINTR_SXTAH | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn), (_Rm)))
#define _arm_uxtab(_Rn, _Rm, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_u_Rd_RnRm(_ARMINTR_UXTAB | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn), (_Rm)))
#define _arm_uxtab16(_Rn, _Rm, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_u_Rd_RnRm(_ARMINTR_UXTAB16 | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn), (_Rm)))
#define _arm_uxtah(_Rn, _Rm, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_u_Rd_RnRm(_ARMINTR_UXTAH | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn), (_Rm)))
#define _arm_sxtb(_Rn, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_s_Rd_Rm(_ARMINTR_SXTB | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn)))
#define _arm_sxtb16(_Rn, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_s_Rd_Rm(_ARMINTR_SXTB16 | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn)))
#define _arm_sxth(_Rn, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_s_Rd_Rm(_ARMINTR_SXTH | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn)))
#define _arm_uxtb(_Rn, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_u_Rd_Rm(_ARMINTR_UXTB | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn)))
#define _arm_uxtb16(_Rn, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_u_Rd_Rm(_ARMINTR_UXTB16 | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn)))
#define _arm_uxth(_Rn, _Rotation) (_ARMINTR_ASSERT_ROT(_Rotation), __arm_gen_u_Rd_Rm(_ARMINTR_UXTBH | _ARMINTR_ENCODE_XTROT(_Rotation), (_Rn)))
#define _arm_pkhbt(_Rn, _Rm, _Lsl_imm) (_ARMINTR_ASSERT_RANGE((_Lsl_imm), 0, 31, "logical left shift"), \
__arm_gen_s_Rd_RnRm(_ARMINTR_PKHBT | _ARMINTR_ENCODE_PKHSHIFT(_Lsl_imm), (_Rn), (_Rm)))
#define _arm_pkhtb(_Rn, _Rm, _Asr_imm) (_ARMINTR_ASSERT_RANGE((_Asr_imm), 1, 32, "arithmetic right shift"), \
__arm_gen_s_Rd_RnRm(_ARMINTR_PKHTB | _ARMINTR_ENCODE_PKHSHIFT(_Asr_imm), (_Rn), (_Rm)))
#define _arm_usad8(_Rn, _Rm) (__arm_gen_u_Rn_RmRs(_ARMINTR_USAD8, (_Rn), (_Rm)))
#define _arm_usada8(_Rn, _Rm, _Ra) (__arm_gen_u_Rn_RmRsRd(_ARMINTR_USADA8, (_Rn), (_Rm), (_Ra)))
#define _arm_ssat(_Sat_imm, _Rn, _Shift_type, _Shift_imm) (_ARMINTR_ASSERT_SAT_BIT((_Sat_imm), 1, 32), _ARMINTR_ASSERT_SAT_SHIFT((_Shift_type), (_Shift_imm)), \
_ARMINTR_S_DMx(_ARMINTR_SSAT | _ARMINTR_ENCODE_IMM5_16((_Sat_imm) - 1) | _ARMINTR_ENCODE_SAT_SH((_Shift_type), (_Shift_imm)), (_Rn)))
#define _arm_usat(_Sat_imm, _Rn, _Shift_type, _Shift_imm) (_ARMINTR_ASSERT_SAT_BIT((_Sat_imm), 0, 31), _ARMINTR_ASSERT_SAT_SHIFT((_Shift_type), (_Shift_imm)), \
_ARMINTR_S_DMx(_ARMINTR_USAT | _ARMINTR_ENCODE_IMM5_16(_Sat_imm) | _ARMINTR_ENCODE_SAT_SH((_Shift_type), (_Shift_imm)), (_Rn)))
#define _arm_ssat16(_Sat_imm, _Rn) (_ARMINTR_ASSERT_SAT_BIT((_Sat_imm), 1, 16), \
_ARMINTR_S_DMx(_ARMINTR_SSAT16 | _ARMINTR_ENCODE_IMM4_16((_Sat_imm) - 1), (_Rn)))
#define _arm_usat16(_Sat_imm, _Rn) (_ARMINTR_ASSERT_SAT_BIT((_Sat_imm), 0, 15), \
_ARMINTR_S_DMx(_ARMINTR_USAT16 | _ARMINTR_ENCODE_IMM4_16(_Sat_imm), (_Rn)))
#define _arm_rev(_Rm) (__arm_gen_u_Rd_Rm2(_ARMINTR_REV, (_Rm)))
#define _arm_rev16(_Rm) (__arm_gen_u_Rd_Rm2(_ARMINTR_REV16, (_Rm)))
#define _arm_revsh(_Rm) (__arm_gen_s_Rd_Rm2(_ARMINTR_REVSH, (_Rm)))
#define _arm_smlad(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLAD, (_Rn), (_Rm), (_Ra)))
#define _arm_smladx(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLADX, (_Rn), (_Rm), (_Ra)))
#define _arm_smlsd(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLSD, (_Rn), (_Rm), (_Ra)))
#define _arm_smlsdx(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMLSDX, (_Rn), (_Rm), (_Ra)))
#define _arm_smmla(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMMLA, (_Rn), (_Rm), (_Ra)))
#define _arm_smmlar(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMMLAR, (_Rn), (_Rm), (_Ra)))
#define _arm_smmls(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMMLS, (_Rn), (_Rm), (_Ra)))
#define _arm_smmlsr(_Rn, _Rm, _Ra) (__arm_gen_s_Rn_RmRsRd(_ARMINTR_SMMLSR, (_Rn), (_Rm), (_Ra)))
#define _arm_smmul(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMMUL, (_Rn), (_Rm)))
#define _arm_smmulr(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMMULR, (_Rn), (_Rm)))
#define _arm_smlald(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLALD, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smlaldx(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLALDX, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smlsld(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLSLD, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smlsldx(_RdHiLo, _Rn, _Rm) (__arm_gen_s_Rdn_RdnRmRs(_ARMINTR_SMLSLDX, (_RdHiLo), (_Rn), (_Rm)))
#define _arm_smuad(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMUAD, (_Rn), (_Rm)))
#define _arm_smuadx(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMUADX, (_Rn), (_Rm)))
#define _arm_smusd(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMUSD, (_Rn), (_Rm)))
#define _arm_smusdx(_Rn, _Rm) (__arm_gen_s_Rn_RmRs(_ARMINTR_SMUSDX, (_Rn), (_Rm)))
#define _arm_smull(_Rn, _Rm) (__arm_gen_s_Rdn_RmRs(_ARMINTR_SMULL, (_Rn), (_Rm)))
#define _arm_umull(_Rn, _Rm) (__arm_gen_u_Rdn_RmRs(_ARMINTR_UMULL, (_Rn), (_Rm)))
#define _arm_umaal(_RdLo, _RdHi, _Rn, _Rm) (__arm_gen_u_Rdn_RdnRmRs(_ARMINTR_UMAAL, ((unsigned __int64)(_RdHi) << 32) | (_RdLo), (_Rn), (_Rm)))
/* ARMv6T2 */
#define _arm_bfc(_Rd, _Lsb, _Width) (_ARMINTR_ASSERT_RANGE((_Lsb), 0, 31, "least significant bit"), _ARMINTR_ASSERT_RANGE((_Width), 1, 32-(_Lsb), "width"), \
__arm_gen_u_Rd_Rd(_ARMINTR_BFC | _ARMINTR_ENCODE_IMM5_7(_Lsb) | _ARMINTR_ENCODE_IMM5_16((_Lsb) + (_Width) - 1), (_Rd)))
#define _arm_bfi(_Rd, _Rn, _Lsb, _Width) (_ARMINTR_ASSERT_RANGE((_Lsb), 0, 31, "least significant bit"), _ARMINTR_ASSERT_RANGE((_Width), 1, 32-(_Lsb), "width"), \
_ARMINTR_U_DDMx(_ARMINTR_BFI | _ARMINTR_ENCODE_IMM5_7(_Lsb) | _ARMINTR_ENCODE_IMM5_16((_Lsb) + (_Width) - 1), (_Rd), (_Rn)))
#define _arm_rbit(_Rm) (__arm_gen_u_Rd_Rm2(_ARMINTR_RBIT, (_Rm)))
#define _arm_sbfx(_Rn, _Lsb, _Width) (_ARMINTR_ASSERT_RANGE((_Lsb), 0, 31, "least significant bit"), _ARMINTR_ASSERT_RANGE((_Width), 1, 32-(_Lsb), "width"), \
_ARMINTR_S_DMx(_ARMINTR_SBFX | _ARMINTR_ENCODE_IMM5_7(_Lsb) | _ARMINTR_ENCODE_IMM5_16((_Width) - 1), (_Rn)))
#define _arm_ubfx(_Rn, _Lsb, _Width) (_ARMINTR_ASSERT_RANGE((_Lsb), 0, 31, "least significant bit"), _ARMINTR_ASSERT_RANGE((_Width), 1, 32-(_Lsb), "width"), \
_ARMINTR_U_DMx(_ARMINTR_UBFX | _ARMINTR_ENCODE_IMM5_7(_Lsb) | _ARMINTR_ENCODE_IMM5_16((_Width) - 1), (_Rn)))
/* ARMv7 */
#if defined (_M_THUMB)
#define _arm_sdiv(_Rn, _Rm) (__arm_gen_s_Rd_RnRm(_ARMINTR_SDIV, (_Rn), (_Rm)))
#define _arm_udiv(_Rn, _Rm) (__arm_gen_u_Rd_RnRm(_ARMINTR_UDIV, (_Rn), (_Rm)))
#endif /* defined (_M_THUMB) */
typedef enum _tag_ARMINTR_CPS_OP
{
_ARM_CPS_ENABLE_INTERRUPTS = 1,
_ARM_CPS_DISABLE_INTERRUPTS = 2,
_ARM_CPS_CHANGE_MODE = 4
}
_ARMINTR_CPS_OP;
typedef enum _tag_ARMINTR_CPS_FLAG
{
_ARM_CPS_INTERRUPT_FLAG_F = 1,
_ARM_CPS_INTERRUPT_FLAG_I = 2,
_ARM_CPS_INTERRUPT_FLAG_A = 4
}
_ARMINTR_CPS_FLAG;
void __cps(unsigned int _Ops, unsigned int _Flags, unsigned int _Mode);
typedef enum _tag_ARMINTR_BARRIER_TYPE
{
_ARM_BARRIER_SY = 0xF,
_ARM_BARRIER_ST = 0xE,
_ARM_BARRIER_ISH = 0xB,
_ARM_BARRIER_ISHST = 0xA,
_ARM_BARRIER_NSH = 0x7,
_ARM_BARRIER_NSHST = 0x6,
_ARM_BARRIER_OSH = 0x3,
_ARM_BARRIER_OSHST = 0x2
}
_ARMINTR_BARRIER_TYPE;
void __dmb(unsigned int _Type);
void __dsb(unsigned int _Type);
void __isb(unsigned int _Type);
/* ARMv7VE */
typedef enum _tag_ARMINTR_BANKED_REG
{
_ARM_BANKED_R8_USR = 0x0,
_ARM_BANKED_R9_USR = 0x1,
_ARM_BANKED_R10_USR = 0x2,
_ARM_BANKED_R11_USR = 0x3,
_ARM_BANKED_R12_USR = 0x4,
_ARM_BANKED_R13_USR = 0x5,
_ARM_BANKED_SP_USR = 0x5,
_ARM_BANKED_R14_USR = 0x6,
_ARM_BANKED_LR_USR = 0x6,
_ARM_BANKED_R8_FIQ = 0x8,
_ARM_BANKED_R9_FIQ = 0x9,
_ARM_BANKED_R10_FIQ = 0xA,
_ARM_BANKED_R11_FIQ = 0xB,
_ARM_BANKED_R12_FIQ = 0xC,
_ARM_BANKED_R13_FIQ = 0xD,
_ARM_BANKED_SP_FIQ = 0xD,
_ARM_BANKED_R14_FIQ = 0xE,
_ARM_BANKED_LR_FIQ = 0xE,
_ARM_BANKED_R14_IRQ = 0x10,
_ARM_BANKED_LR_IRQ = 0x10,
_ARM_BANKED_R13_IRQ = 0x11,
_ARM_BANKED_SP_IRQ = 0x11,
_ARM_BANKED_R14_SVC = 0x12,
_ARM_BANKED_LR_SVC = 0x12,
_ARM_BANKED_R13_SVC = 0x13,
_ARM_BANKED_SP_SVC = 0x13,
_ARM_BANKED_R14_ABT = 0x14,
_ARM_BANKED_LR_ABT = 0x14,
_ARM_BANKED_R13_ABT = 0x15,
_ARM_BANKED_SP_ABT = 0x15,
_ARM_BANKED_R14_UND = 0x16,
_ARM_BANKED_LR_UND = 0x16,
_ARM_BANKED_R13_UND = 0x17,
_ARM_BANKED_SP_UND = 0x17,
_ARM_BANKED_R14_MON = 0x1C,
_ARM_BANKED_LR_MON = 0x1C,
_ARM_BANKED_R13_MON = 0x1D,
_ARM_BANKED_SP_MON = 0x1D,
_ARM_BANKED_ELR_HYP = 0x1E,
_ARM_BANKED_R13_HYP = 0x1F,
_ARM_BANKED_SP_HYP = 0x1F,
_ARM_BANKED_SPSR_FIQ = 0x2E,
_ARM_BANKED_SPSR_IRQ = 0x30,
_ARM_BANKED_SPSR_SVC = 0x32,
_ARM_BANKED_SPSR_ABT = 0x34,
_ARM_BANKED_SPSR_UND = 0x36,
_ARM_BANKED_SPSR_MON = 0x3C,
_ARM_BANKED_SPSR_HYP = 0x3E
}
_ARMINTR_BANKED_REG;
void _WriteBankedReg(int _Value, int _Reg);
int _ReadBankedReg(int _Reg);
#ifdef __cplusplus
}
#endif /* __cplusplus */
@@ -0,0 +1,913 @@
// array standard header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _ARRAY_
#define _ARRAY_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <xutility>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
#if _ITERATOR_DEBUG_LEVEL != 0
struct _Iterator_base12_compatible { // TRANSITION, for binary compatibility
_Container_proxy* _Myproxy{};
_Iterator_base12* _Mynextiter{};
};
#endif // _ITERATOR_DEBUG_LEVEL != 0
template <class _Ty, size_t _Size>
class _Array_const_iterator
#if _ITERATOR_DEBUG_LEVEL != 0
: private _Iterator_base12_compatible
#endif // _ITERATOR_DEBUG_LEVEL != 0
{
public:
#if _HAS_CXX20
using iterator_concept = contiguous_iterator_tag;
#endif // _HAS_CXX20
using iterator_category = random_access_iterator_tag;
using value_type = _Ty;
using difference_type = ptrdiff_t;
using pointer = const _Ty*;
using reference = const _Ty&;
enum { _EEN_SIZE = _Size }; // helper for expression evaluator
#if _ITERATOR_DEBUG_LEVEL == 0
_CONSTEXPR17 _Array_const_iterator() noexcept : _Ptr() {}
_CONSTEXPR17 explicit _Array_const_iterator(pointer _Parg, size_t _Off = 0) noexcept : _Ptr(_Parg + _Off) {}
_NODISCARD _CONSTEXPR17 reference operator*() const noexcept {
return *_Ptr;
}
_NODISCARD _CONSTEXPR17 pointer operator->() const noexcept {
return _Ptr;
}
_CONSTEXPR17 _Array_const_iterator& operator++() noexcept {
++_Ptr;
return *this;
}
_CONSTEXPR17 _Array_const_iterator operator++(int) noexcept {
_Array_const_iterator _Tmp = *this;
++_Ptr;
return _Tmp;
}
_CONSTEXPR17 _Array_const_iterator& operator--() noexcept {
--_Ptr;
return *this;
}
_CONSTEXPR17 _Array_const_iterator operator--(int) noexcept {
_Array_const_iterator _Tmp = *this;
--_Ptr;
return _Tmp;
}
_CONSTEXPR17 _Array_const_iterator& operator+=(const ptrdiff_t _Off) noexcept {
_Ptr += _Off;
return *this;
}
_CONSTEXPR17 _Array_const_iterator& operator-=(const ptrdiff_t _Off) noexcept {
_Ptr -= _Off;
return *this;
}
_NODISCARD _CONSTEXPR17 ptrdiff_t operator-(const _Array_const_iterator& _Right) const noexcept {
return _Ptr - _Right._Ptr;
}
_NODISCARD _CONSTEXPR17 reference operator[](const ptrdiff_t _Off) const noexcept {
return _Ptr[_Off];
}
_NODISCARD _CONSTEXPR17 bool operator==(const _Array_const_iterator& _Right) const noexcept {
return _Ptr == _Right._Ptr;
}
#if _HAS_CXX20
_NODISCARD constexpr strong_ordering operator<=>(const _Array_const_iterator& _Right) const noexcept {
return _Ptr <=> _Right._Ptr;
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD _CONSTEXPR17 bool operator<(const _Array_const_iterator& _Right) const noexcept {
return _Ptr < _Right._Ptr;
}
#endif // ^^^ !_HAS_CXX20 ^^^
using _Prevent_inheriting_unwrap = _Array_const_iterator;
_NODISCARD constexpr pointer _Unwrapped() const noexcept {
return _Ptr;
}
static constexpr bool _Unwrap_when_unverified = true;
constexpr void _Seek_to(pointer _It) noexcept {
_Ptr = _It;
}
private:
pointer _Ptr; // beginning of array
#else // ^^^ _ITERATOR_DEBUG_LEVEL == 0 / _ITERATOR_DEBUG_LEVEL != 0 vvv
_CONSTEXPR17 _Array_const_iterator() noexcept : _Ptr(), _Idx(0) {}
_CONSTEXPR17 explicit _Array_const_iterator(pointer _Parg, size_t _Off = 0) noexcept : _Ptr(_Parg), _Idx(_Off) {}
_NODISCARD _CONSTEXPR17 reference operator*() const noexcept {
return *operator->();
}
_NODISCARD _CONSTEXPR17 pointer operator->() const noexcept {
_STL_VERIFY(_Ptr, "cannot dereference value-initialized array iterator");
_STL_VERIFY(_Idx < _Size, "cannot dereference out of range array iterator");
return _Ptr + _Idx;
}
_CONSTEXPR17 _Array_const_iterator& operator++() noexcept {
_STL_VERIFY(_Ptr, "cannot increment value-initialized array iterator");
_STL_VERIFY(_Idx < _Size, "cannot increment array iterator past end");
++_Idx;
return *this;
}
_CONSTEXPR17 _Array_const_iterator operator++(int) noexcept {
_Array_const_iterator _Tmp = *this;
++*this;
return _Tmp;
}
_CONSTEXPR17 _Array_const_iterator& operator--() noexcept {
_STL_VERIFY(_Ptr, "cannot decrement value-initialized array iterator");
_STL_VERIFY(_Idx != 0, "cannot decrement array iterator before begin");
--_Idx;
return *this;
}
_CONSTEXPR17 _Array_const_iterator operator--(int) noexcept {
_Array_const_iterator _Tmp = *this;
--*this;
return _Tmp;
}
constexpr void _Verify_offset(const ptrdiff_t _Off) const noexcept {
if (_Off != 0) {
_STL_VERIFY(_Ptr, "cannot seek value-initialized array iterator");
}
if (_Off < 0) {
_STL_VERIFY(_Idx >= size_t{0} - static_cast<size_t>(_Off), "cannot seek array iterator before begin");
}
if (_Off > 0) {
_STL_VERIFY(_Size - _Idx >= static_cast<size_t>(_Off), "cannot seek array iterator after end");
}
}
_CONSTEXPR17 _Array_const_iterator& operator+=(const ptrdiff_t _Off) noexcept {
_Verify_offset(_Off);
_Idx += static_cast<size_t>(_Off);
return *this;
}
_CONSTEXPR17 _Array_const_iterator& operator-=(const ptrdiff_t _Off) noexcept {
return *this += -_Off;
}
_NODISCARD _CONSTEXPR17 ptrdiff_t operator-(const _Array_const_iterator& _Right) const noexcept {
_Compat(_Right);
return static_cast<ptrdiff_t>(_Idx - _Right._Idx);
}
_NODISCARD _CONSTEXPR17 reference operator[](const ptrdiff_t _Off) const noexcept {
return *(*this + _Off);
}
_NODISCARD _CONSTEXPR17 bool operator==(const _Array_const_iterator& _Right) const noexcept {
_Compat(_Right);
return _Idx == _Right._Idx;
}
#if _HAS_CXX20
_NODISCARD constexpr strong_ordering operator<=>(const _Array_const_iterator& _Right) const noexcept {
_Compat(_Right);
return _Idx <=> _Right._Idx;
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD _CONSTEXPR17 bool operator<(const _Array_const_iterator& _Right) const noexcept {
_Compat(_Right);
return _Idx < _Right._Idx;
}
#endif // ^^^ !_HAS_CXX20 ^^^
_CONSTEXPR17 void _Compat(const _Array_const_iterator& _Right) const noexcept { // test for compatible iterator pair
_STL_VERIFY(_Ptr == _Right._Ptr, "array iterators incompatible");
}
using _Prevent_inheriting_unwrap = _Array_const_iterator;
_NODISCARD constexpr pointer _Unwrapped() const noexcept {
return _Ptr + _Idx;
}
constexpr void _Verify_with(const _Array_const_iterator& _Last) const noexcept {
// note _Compat check inside operator<=
_STL_VERIFY(*this <= _Last, "array iterator range transposed");
}
friend constexpr void _Verify_range(
const _Array_const_iterator& _First, const _Array_const_iterator& _Last) noexcept {
_First._Verify_with(_Last);
}
constexpr void _Seek_to(pointer _It) noexcept {
_Idx = static_cast<size_t>(_It - _Ptr);
}
private:
pointer _Ptr; // beginning of array
size_t _Idx; // offset into array
#endif // ^^^ _ITERATOR_DEBUG_LEVEL != 0 ^^^
public:
_NODISCARD _CONSTEXPR17 _Array_const_iterator operator+(const ptrdiff_t _Off) const noexcept {
_Array_const_iterator _Tmp = *this;
_Tmp += _Off;
return _Tmp;
}
_NODISCARD _CONSTEXPR17 _Array_const_iterator operator-(const ptrdiff_t _Off) const noexcept {
_Array_const_iterator _Tmp = *this;
_Tmp -= _Off;
return _Tmp;
}
_NODISCARD friend _CONSTEXPR17 _Array_const_iterator operator+(
const ptrdiff_t _Off, _Array_const_iterator _Next) noexcept {
_Next += _Off;
return _Next;
}
#if !_HAS_CXX20
_NODISCARD _CONSTEXPR17 bool operator!=(const _Array_const_iterator& _Right) const noexcept {
return !(*this == _Right);
}
_NODISCARD _CONSTEXPR17 bool operator>(const _Array_const_iterator& _Right) const noexcept {
return _Right < *this;
}
_NODISCARD _CONSTEXPR17 bool operator<=(const _Array_const_iterator& _Right) const noexcept {
return !(_Right < *this);
}
_NODISCARD _CONSTEXPR17 bool operator>=(const _Array_const_iterator& _Right) const noexcept {
return !(*this < _Right);
}
#endif // !_HAS_CXX20
};
#if _HAS_CXX20
template <class _Ty, size_t _Size>
struct pointer_traits<_Array_const_iterator<_Ty, _Size>> {
using pointer = _Array_const_iterator<_Ty, _Size>;
using element_type = const _Ty;
using difference_type = ptrdiff_t;
_NODISCARD static constexpr element_type* to_address(const pointer _Iter) noexcept {
return _Iter._Unwrapped();
}
};
#endif // _HAS_CXX20
template <class _Ty, size_t _Size>
class _Array_iterator : public _Array_const_iterator<_Ty, _Size> {
public:
using _Mybase = _Array_const_iterator<_Ty, _Size>;
#if _HAS_CXX20
using iterator_concept = contiguous_iterator_tag;
#endif // _HAS_CXX20
using iterator_category = random_access_iterator_tag;
using value_type = _Ty;
using difference_type = ptrdiff_t;
using pointer = _Ty*;
using reference = _Ty&;
enum { _EEN_SIZE = _Size }; // helper for expression evaluator
_CONSTEXPR17 _Array_iterator() noexcept {}
_CONSTEXPR17 explicit _Array_iterator(pointer _Parg, size_t _Off = 0) noexcept : _Mybase(_Parg, _Off) {}
_NODISCARD _CONSTEXPR17 reference operator*() const noexcept {
return const_cast<reference>(_Mybase::operator*());
}
_NODISCARD _CONSTEXPR17 pointer operator->() const noexcept {
return const_cast<pointer>(_Mybase::operator->());
}
_CONSTEXPR17 _Array_iterator& operator++() noexcept {
_Mybase::operator++();
return *this;
}
_CONSTEXPR17 _Array_iterator operator++(int) noexcept {
_Array_iterator _Tmp = *this;
_Mybase::operator++();
return _Tmp;
}
_CONSTEXPR17 _Array_iterator& operator--() noexcept {
_Mybase::operator--();
return *this;
}
_CONSTEXPR17 _Array_iterator operator--(int) noexcept {
_Array_iterator _Tmp = *this;
_Mybase::operator--();
return _Tmp;
}
_CONSTEXPR17 _Array_iterator& operator+=(const ptrdiff_t _Off) noexcept {
_Mybase::operator+=(_Off);
return *this;
}
_NODISCARD _CONSTEXPR17 _Array_iterator operator+(const ptrdiff_t _Off) const noexcept {
_Array_iterator _Tmp = *this;
_Tmp += _Off;
return _Tmp;
}
_NODISCARD friend _CONSTEXPR17 _Array_iterator operator+(const ptrdiff_t _Off, _Array_iterator _Next) noexcept {
_Next += _Off;
return _Next;
}
_CONSTEXPR17 _Array_iterator& operator-=(const ptrdiff_t _Off) noexcept {
_Mybase::operator-=(_Off);
return *this;
}
using _Mybase::operator-;
_NODISCARD _CONSTEXPR17 _Array_iterator operator-(const ptrdiff_t _Off) const noexcept {
_Array_iterator _Tmp = *this;
_Tmp -= _Off;
return _Tmp;
}
_NODISCARD _CONSTEXPR17 reference operator[](const ptrdiff_t _Off) const noexcept {
return const_cast<reference>(_Mybase::operator[](_Off));
}
using _Prevent_inheriting_unwrap = _Array_iterator;
_NODISCARD constexpr pointer _Unwrapped() const noexcept {
return const_cast<pointer>(_Mybase::_Unwrapped());
}
};
#if _HAS_CXX20
template <class _Ty, size_t _Size>
struct pointer_traits<_Array_iterator<_Ty, _Size>> {
using pointer = _Array_iterator<_Ty, _Size>;
using element_type = _Ty;
using difference_type = ptrdiff_t;
_NODISCARD static constexpr element_type* to_address(const pointer _Iter) noexcept {
return _Iter._Unwrapped();
}
};
#endif // _HAS_CXX20
_EXPORT_STD template <class _Ty, size_t _Size>
class array { // fixed size array of values
public:
static_assert(is_object_v<_Ty>, "The C++ Standard forbids containers of non-object types "
"because of [container.requirements].");
using value_type = _Ty;
using size_type = size_t;
using difference_type = ptrdiff_t;
using pointer = _Ty*;
using const_pointer = const _Ty*;
using reference = _Ty&;
using const_reference = const _Ty&;
using iterator = _Array_iterator<_Ty, _Size>;
using const_iterator = _Array_const_iterator<_Ty, _Size>;
using reverse_iterator = _STD reverse_iterator<iterator>;
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
using _Library_defined = array;
#if _HAS_TR1_NAMESPACE
_DEPRECATE_TR1_NAMESPACE void assign(const _Ty& _Value) {
_STD fill_n(_Elems, _Size, _Value);
}
#endif // _HAS_TR1_NAMESPACE
_CONSTEXPR20 void fill(const _Ty& _Value) {
_STD fill_n(_Elems, _Size, _Value);
}
_CONSTEXPR20 void swap(array& _Other) noexcept(_Is_nothrow_swappable<_Ty>::value) {
_STD _Swap_ranges_unchecked(_Elems, _Elems + _Size, _Other._Elems);
}
_NODISCARD _CONSTEXPR17 iterator begin() noexcept {
return iterator(_Elems, 0);
}
_NODISCARD _CONSTEXPR17 const_iterator begin() const noexcept {
return const_iterator(_Elems, 0);
}
_NODISCARD _CONSTEXPR17 iterator end() noexcept {
return iterator(_Elems, _Size);
}
_NODISCARD _CONSTEXPR17 const_iterator end() const noexcept {
return const_iterator(_Elems, _Size);
}
_NODISCARD _CONSTEXPR17 reverse_iterator rbegin() noexcept {
return reverse_iterator(end());
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator rbegin() const noexcept {
return const_reverse_iterator(end());
}
_NODISCARD _CONSTEXPR17 reverse_iterator rend() noexcept {
return reverse_iterator(begin());
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator rend() const noexcept {
return const_reverse_iterator(begin());
}
_NODISCARD _CONSTEXPR17 const_iterator cbegin() const noexcept {
return begin();
}
_NODISCARD _CONSTEXPR17 const_iterator cend() const noexcept {
return end();
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator crbegin() const noexcept {
return rbegin();
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator crend() const noexcept {
return rend();
}
_CONSTEXPR17 _Ty* _Unchecked_begin() noexcept {
return _Elems;
}
_CONSTEXPR17 const _Ty* _Unchecked_begin() const noexcept {
return _Elems;
}
_CONSTEXPR17 _Ty* _Unchecked_end() noexcept {
return _Elems + _Size;
}
_CONSTEXPR17 const _Ty* _Unchecked_end() const noexcept {
return _Elems + _Size;
}
_NODISCARD _Ret_range_(==, _Size) constexpr size_type size() const noexcept {
return _Size;
}
_NODISCARD constexpr size_type max_size() const noexcept {
return _Size;
}
_NODISCARD_EMPTY_ARRAY_MEMBER constexpr bool empty() const noexcept {
return false;
}
_NODISCARD _CONSTEXPR17 reference at(size_type _Pos) {
if (_Size <= _Pos) {
_Xran();
}
return _Elems[_Pos];
}
_NODISCARD constexpr const_reference at(size_type _Pos) const {
if (_Size <= _Pos) {
_Xran();
}
return _Elems[_Pos];
}
_NODISCARD _CONSTEXPR17 reference operator[](_In_range_(<, _Size) size_type _Pos) noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(_Pos < _Size, "array subscript out of range");
#endif
return _Elems[_Pos];
}
_NODISCARD constexpr const_reference operator[](_In_range_(<, _Size) size_type _Pos) const noexcept
/* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(_Pos < _Size, "array subscript out of range");
#endif
return _Elems[_Pos];
}
_NODISCARD _CONSTEXPR17 reference front() noexcept /* strengthened */ {
return _Elems[0];
}
_NODISCARD constexpr const_reference front() const noexcept /* strengthened */ {
return _Elems[0];
}
_NODISCARD _CONSTEXPR17 reference back() noexcept /* strengthened */ {
return _Elems[_Size - 1];
}
_NODISCARD constexpr const_reference back() const noexcept /* strengthened */ {
return _Elems[_Size - 1];
}
_NODISCARD _CONSTEXPR17 _Ty* data() noexcept {
return _Elems;
}
_NODISCARD _CONSTEXPR17 const _Ty* data() const noexcept {
return _Elems;
}
_Ty _Elems[_Size];
private:
[[noreturn]] static void _Xran() {
_Xout_of_range("invalid array<T, N> subscript");
}
};
#if _HAS_CXX17
template <class _First, class... _Rest>
struct _Enforce_same {
static_assert(
conjunction_v<is_same<_First, _Rest>...>, "N4950 [array.cons]/2: Mandates: (is_same_v<T, U> && ...) is true.");
using type = _First;
};
template <class _First, class... _Rest>
array(_First, _Rest...) -> array<typename _Enforce_same<_First, _Rest...>::type, 1 + sizeof...(_Rest)>;
#endif // _HAS_CXX17
struct _Empty_array_element {};
template <class _Ty>
class array<_Ty, 0> {
public:
static_assert(is_object_v<_Ty>, "The C++ Standard forbids containers of non-object types "
"because of [container.requirements].");
using value_type = _Ty;
using size_type = size_t;
using difference_type = ptrdiff_t;
using pointer = _Ty*;
using const_pointer = const _Ty*;
using reference = _Ty&;
using const_reference = const _Ty&;
using iterator = _Array_iterator<_Ty, 0>;
using const_iterator = _Array_const_iterator<_Ty, 0>;
using reverse_iterator = _STD reverse_iterator<iterator>;
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
using _Library_defined = array;
#if _HAS_TR1_NAMESPACE
_DEPRECATE_TR1_NAMESPACE void assign(const _Ty&) {}
#endif // _HAS_TR1_NAMESPACE
_CONSTEXPR20 void fill(const _Ty&) {}
_CONSTEXPR20 void swap(array&) noexcept {}
_NODISCARD _CONSTEXPR17 iterator begin() noexcept {
return iterator{};
}
_NODISCARD _CONSTEXPR17 const_iterator begin() const noexcept {
return const_iterator{};
}
_NODISCARD _CONSTEXPR17 iterator end() noexcept {
return iterator{};
}
_NODISCARD _CONSTEXPR17 const_iterator end() const noexcept {
return const_iterator{};
}
_NODISCARD _CONSTEXPR17 reverse_iterator rbegin() noexcept {
return reverse_iterator(end());
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator rbegin() const noexcept {
return const_reverse_iterator(end());
}
_NODISCARD _CONSTEXPR17 reverse_iterator rend() noexcept {
return reverse_iterator(begin());
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator rend() const noexcept {
return const_reverse_iterator(begin());
}
_NODISCARD _CONSTEXPR17 const_iterator cbegin() const noexcept {
return begin();
}
_NODISCARD _CONSTEXPR17 const_iterator cend() const noexcept {
return end();
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator crbegin() const noexcept {
return rbegin();
}
_NODISCARD _CONSTEXPR17 const_reverse_iterator crend() const noexcept {
return rend();
}
_CONSTEXPR17 _Ty* _Unchecked_begin() noexcept {
return nullptr;
}
_CONSTEXPR17 const _Ty* _Unchecked_begin() const noexcept {
return nullptr;
}
_CONSTEXPR17 _Ty* _Unchecked_end() noexcept {
return nullptr;
}
_CONSTEXPR17 const _Ty* _Unchecked_end() const noexcept {
return nullptr;
}
_NODISCARD constexpr size_type size() const noexcept {
return 0;
}
_NODISCARD constexpr size_type max_size() const noexcept {
return 0;
}
_NODISCARD_EMPTY_ARRAY_MEMBER constexpr bool empty() const noexcept {
return true;
}
[[noreturn]] reference at(size_type) {
_Xran();
}
[[noreturn]] const_reference at(size_type) const {
_Xran();
}
_NODISCARD reference operator[](size_type) noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_REPORT_ERROR("array<T, 0> subscript is invalid");
#endif
return *data();
}
_NODISCARD const_reference operator[](size_type) const noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_REPORT_ERROR("array<T, 0> subscript is invalid");
#endif
return *data();
}
_NODISCARD reference front() noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_REPORT_ERROR("array<T, 0>::front() is invalid");
#endif
return *data();
}
_NODISCARD const_reference front() const noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_REPORT_ERROR("array<T, 0>::front() is invalid");
#endif
return *data();
}
_NODISCARD reference back() noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_REPORT_ERROR("array<T, 0>::back() is invalid");
#endif
return *data();
}
_NODISCARD const_reference back() const noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_ARRAY || _ITERATOR_DEBUG_LEVEL != 0
_STL_REPORT_ERROR("array<T, 0>::back() is invalid");
#endif
return *data();
}
_NODISCARD _CONSTEXPR17 _Ty* data() noexcept {
return nullptr;
}
_NODISCARD _CONSTEXPR17 const _Ty* data() const noexcept {
return nullptr;
}
conditional_t<disjunction_v<is_default_constructible<_Ty>, _Is_implicitly_default_constructible<_Ty>>, _Ty,
_Empty_array_element>
_Elems[1]{};
private:
[[noreturn]] static void _Xran() {
_Xout_of_range("invalid array<T, 0> subscript");
}
};
_EXPORT_STD template <class _Ty, size_t _Size, enable_if_t<_Size == 0 || _Is_swappable<_Ty>::value, int> = 0>
_CONSTEXPR20 void swap(array<_Ty, _Size>& _Left, array<_Ty, _Size>& _Right) noexcept(noexcept(_Left.swap(_Right))) {
_Left.swap(_Right);
}
_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator==(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return _STD equal(_Left.data(), _Left.data() + _Size, _Right.data());
}
#if _HAS_CXX20
_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD constexpr _Synth_three_way_result<_Ty> operator<=>(
const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return _STD lexicographical_compare_three_way(
_Left.data(), _Left.data() + _Size, _Right.data(), _Right.data() + _Size, _Synth_three_way{});
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
template <class _Ty, size_t _Size>
_NODISCARD bool operator!=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return !(_Left == _Right);
}
template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator<(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return _STD lexicographical_compare(_Left.data(), _Left.data() + _Size, _Right.data(), _Right.data() + _Size);
}
template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator>(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return _Right < _Left;
}
template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator<=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return !(_Right < _Left);
}
template <class _Ty, size_t _Size>
_NODISCARD _CONSTEXPR20 bool operator>=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
return !(_Left < _Right);
}
#endif // ^^^ !_HAS_CXX20 ^^^
#if _HAS_CXX20
template <class _Ty, size_t _Size, size_t... _Idx>
_NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> _To_array_lvalue_impl(
_Ty (&_Array)[_Size], index_sequence<_Idx...>) {
return {{_Array[_Idx]...}};
}
template <class _Ty, size_t _Size, size_t... _Idx>
_NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> _To_array_rvalue_impl(
_Ty (&&_Array)[_Size], index_sequence<_Idx...>) {
return {{_STD move(_Array[_Idx])...}};
}
_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> to_array(_Ty (&_Array)[_Size]) {
static_assert(!is_array_v<_Ty>, "N4950 [array.creation]/1: "
"to_array does not accept multidimensional arrays.");
static_assert(is_constructible_v<_Ty, _Ty&>, "N4950 [array.creation]/1: "
"to_array requires copy constructible elements.");
return _STD _To_array_lvalue_impl(_Array, make_index_sequence<_Size>{});
}
_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> to_array(_Ty (&&_Array)[_Size]) {
static_assert(!is_array_v<_Ty>, "N4950 [array.creation]/4: "
"to_array does not accept multidimensional arrays.");
static_assert(is_move_constructible_v<_Ty>, "N4950 [array.creation]/4: "
"to_array requires move constructible elements.");
return _STD _To_array_rvalue_impl(_STD move(_Array), make_index_sequence<_Size>{});
}
#endif // _HAS_CXX20
template <class _Ty, class _Enable = void>
constexpr bool _Is_library_defined = false;
template <class _Ty>
constexpr bool _Is_library_defined<_Ty, enable_if_t<is_same_v<typename _Ty::_Library_defined, _Ty>>> = true;
_EXPORT_STD template <size_t _Idx, class _Ty, size_t _Size>
_NODISCARD constexpr _Ty& get(array<_Ty, _Size>& _Arr) noexcept {
static_assert(_Idx < _Size, "array index out of bounds");
if constexpr (_Is_library_defined<array<_Ty, _Size>>) {
return _Arr._Elems[_Idx];
} else {
#if _HAS_CXX17
return _Arr[_Idx];
#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv
return const_cast<_Ty&>(_STD as_const(_Arr)[_Idx]);
#endif // ^^^ !_HAS_CXX17 ^^^
}
}
_EXPORT_STD template <size_t _Idx, class _Ty, size_t _Size>
_NODISCARD constexpr const _Ty& get(const array<_Ty, _Size>& _Arr) noexcept {
static_assert(_Idx < _Size, "array index out of bounds");
if constexpr (_Is_library_defined<array<_Ty, _Size>>) {
return _Arr._Elems[_Idx];
} else {
return _Arr[_Idx];
}
}
_EXPORT_STD template <size_t _Idx, class _Ty, size_t _Size>
_NODISCARD constexpr _Ty&& get(array<_Ty, _Size>&& _Arr) noexcept {
static_assert(_Idx < _Size, "array index out of bounds");
if constexpr (_Is_library_defined<array<_Ty, _Size>>) {
return _STD move(_Arr._Elems[_Idx]);
} else {
#if _HAS_CXX17
return _STD move(_Arr[_Idx]);
#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv
return const_cast<_Ty&&>(_STD move(_STD as_const(_Arr)[_Idx]));
#endif // ^^^ !_HAS_CXX17 ^^^
}
}
_EXPORT_STD template <size_t _Idx, class _Ty, size_t _Size>
_NODISCARD constexpr const _Ty&& get(const array<_Ty, _Size>&& _Arr) noexcept {
static_assert(_Idx < _Size, "array index out of bounds");
if constexpr (_Is_library_defined<array<_Ty, _Size>>) {
return _STD move(_Arr._Elems[_Idx]);
} else {
return _STD move(_Arr[_Idx]);
}
}
#if _HAS_TR1_NAMESPACE
namespace _DEPRECATE_TR1_NAMESPACE tr1 {
using _STD array;
using _STD get;
} // namespace _DEPRECATE_TR1_NAMESPACE tr1
#endif // _HAS_TR1_NAMESPACE
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _ARRAY_
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,196 @@
// barrier standard header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _BARRIER_
#define _BARRIER_
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#ifdef _M_CEE_PURE
#error <barrier> is not supported when compiling with /clr:pure.
#endif // defined(_M_CEE_PURE)
#if !_HAS_CXX20
_EMIT_STL_WARNING(STL4038, "The contents of <barrier> are available only with C++20 or later.");
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#include <atomic>
#include <climits>
#include <type_traits>
#include <xmemory>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
struct _No_completion_function {
void operator()() noexcept {}
};
_EXPORT_STD template <class _Completion_function = _No_completion_function>
class barrier;
inline constexpr ptrdiff_t _Barrier_arrival_token_mask = 1;
inline constexpr ptrdiff_t _Barrier_value_mask = ~_Barrier_arrival_token_mask;
inline constexpr ptrdiff_t _Barrier_value_shift = 1;
inline constexpr ptrdiff_t _Barrier_invalid_token = 0;
inline constexpr ptrdiff_t _Barrier_value_step = 1 << _Barrier_value_shift;
inline constexpr ptrdiff_t _Barrier_max = PTRDIFF_MAX >> _Barrier_value_shift;
template <class _Completion_function>
class _Arrival_token {
public:
_Arrival_token(_Arrival_token&& _Other) noexcept {
_Value = _Other._Value;
_Other._Value = _Barrier_invalid_token;
}
_Arrival_token& operator=(_Arrival_token&& _Other) noexcept {
_Value = _Other._Value;
_Other._Value = _Barrier_invalid_token;
return *this;
}
private:
explicit _Arrival_token(ptrdiff_t _Value_) noexcept : _Value(_Value_) {}
friend barrier<_Completion_function>;
ptrdiff_t _Value;
};
_EXPORT_STD template <class _Completion_function>
class barrier {
public:
static_assert(
#ifndef __cpp_noexcept_function_type
is_function_v<remove_pointer_t<_Completion_function>> ||
#endif // !defined(__cpp_noexcept_function_type)
is_nothrow_invocable_v<_Completion_function&>,
"N4950 [thread.barrier.class]/5: is_nothrow_invocable_v<CompletionFunction&> shall be true");
using arrival_token = _Arrival_token<_Completion_function>;
constexpr explicit barrier(
const ptrdiff_t _Expected, _Completion_function _Fn = _Completion_function()) noexcept /* strengthened */
: _Val(_One_then_variadic_args_t{}, _STD move(_Fn), _Expected << _Barrier_value_shift) {
_STL_VERIFY(_Expected >= 0 && _Expected <= (max) (),
"Precondition: expected >= 0 and expected <= max() (N4950 [thread.barrier.class]/9)");
}
barrier(const barrier&) = delete;
barrier& operator=(const barrier&) = delete;
_NODISCARD static constexpr ptrdiff_t(max)() noexcept {
return _Barrier_max;
}
_NODISCARD_BARRIER_TOKEN arrival_token arrive(ptrdiff_t _Update = 1) noexcept /* strengthened */ {
_STL_VERIFY(_Update > 0 && _Update <= (max) (), "Precondition: update > 0 (N4950 [thread.barrier.class]/12)");
_Update <<= _Barrier_value_shift;
// TRANSITION, GH-1133: should be memory_order_release
ptrdiff_t _Current = _Val._Myval2._Current.fetch_sub(_Update) - _Update;
_STL_VERIFY(_Current >= 0, "Precondition: update is less than or equal to the expected count "
"for the current barrier phase (N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_value_mask) == 0) {
// TRANSITION, GH-1133: should have this fence:
// atomic_thread_fence(memory_order_acquire);
_Completion(_Current);
}
// Embedding this into the token to provide an additional correctness check that the token is from the same
// barrier and wasn't used. All bits of this fit, as barrier should be aligned to at least the size of an
// atomic counter.
return arrival_token{(_Current & _Barrier_arrival_token_mask) | reinterpret_cast<intptr_t>(this)};
}
void wait(arrival_token&& _Arrival) const noexcept /* strengthened */ {
_STL_VERIFY((_Arrival._Value & _Barrier_value_mask) == reinterpret_cast<intptr_t>(this),
"Preconditions: arrival is associated with the phase synchronization point for the current phase "
"or the immediately preceding phase of the same barrier object (N4950 [thread.barrier.class]/19)");
const ptrdiff_t _Arrival_value = _Arrival._Value & _Barrier_arrival_token_mask;
_Arrival._Value = _Barrier_invalid_token;
for (;;) {
// TRANSITION, GH-1133: should be memory_order_acquire
const ptrdiff_t _Current = _Val._Myval2._Current.load();
_STL_VERIFY(_Current >= 0, "Invariant counter >= 0, possibly caused by preconditions violation "
"(N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_arrival_token_mask) != _Arrival_value) {
break;
}
_Val._Myval2._Current.wait(_Current, memory_order_relaxed);
}
}
void arrive_and_wait() noexcept /* strengthened */ {
// TRANSITION, GH-1133: should be memory_order_acq_rel
ptrdiff_t _Current = _Val._Myval2._Current.fetch_sub(_Barrier_value_step) - _Barrier_value_step;
const ptrdiff_t _Arrival = _Current & _Barrier_arrival_token_mask;
_STL_VERIFY(_Current >= 0, "Precondition: update is less than or equal to the expected count "
"for the current barrier phase (N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_value_mask) == 0) {
_Completion(_Current);
return;
}
for (;;) {
_Val._Myval2._Current.wait(_Current, memory_order_relaxed);
// TRANSITION, GH-1133: should be memory_order_acquire
_Current = _Val._Myval2._Current.load();
_STL_VERIFY(_Current >= 0, "Invariant counter >= 0, possibly caused by preconditions violation "
"(N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_arrival_token_mask) != _Arrival) {
break;
}
}
}
void arrive_and_drop() noexcept /* strengthened */ {
const ptrdiff_t _Rem_count =
_Val._Myval2._Total.fetch_sub(_Barrier_value_step, memory_order_relaxed) - _Barrier_value_step;
_STL_VERIFY(_Rem_count >= 0, "Precondition: The expected count for the current barrier phase "
"is greater than zero (N4950 [thread.barrier.class]/24) "
"(checked initial expected count, which is not less than the current)");
(void) arrive(1);
}
private:
void _Completion(const ptrdiff_t _Current) noexcept {
const ptrdiff_t _Rem_count = _Val._Myval2._Total.load(memory_order_relaxed);
_STL_VERIFY(_Rem_count >= 0, "Invariant: initial expected count less than zero, "
"possibly caused by preconditions violation "
"(N4950 [thread.barrier.class]/24)");
_Val._Get_first()();
const ptrdiff_t _New_phase_count = _Rem_count | ((_Current + 1) & _Barrier_arrival_token_mask);
// TRANSITION, GH-1133: should be memory_order_release
_Val._Myval2._Current.store(_New_phase_count);
_Val._Myval2._Current.notify_all();
}
struct _Counter_t {
constexpr explicit _Counter_t(ptrdiff_t _Initial) : _Current(_Initial), _Total(_Initial) {}
// wait(arrival_token&&) accepts a token from the current phase or the immediately preceding phase; this means
// we can track which phase is the current phase using 1 bit which alternates between each phase. For this
// purpose we use the low order bit of _Current.
atomic<ptrdiff_t> _Current;
atomic<ptrdiff_t> _Total;
};
_Compressed_pair<_Completion_function, _Counter_t> _Val;
};
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // ^^^ _HAS_CXX20 ^^^
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _BARRIER_
@@ -0,0 +1,239 @@
// bit standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _BIT_
#define _BIT_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
_EMIT_STL_WARNING(STL4038, "The contents of <bit> are available only with C++20 or later.");
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#include <__msvc_bit_utils.hpp>
#include <cstdlib>
#include <type_traits>
#include _STL_INTRIN_HEADER
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
_EXPORT_STD template <class _To, class _From>
requires (sizeof(_To) == sizeof(_From)) && is_trivially_copyable_v<_To> && is_trivially_copyable_v<_From>
_NODISCARD constexpr _To bit_cast(const _From& _Val) noexcept {
return __builtin_bit_cast(_To, _Val);
}
#if _HAS_CXX23
_NODISCARD constexpr unsigned short _Byteswap_ushort(const unsigned short _Val) noexcept {
if (_STD is_constant_evaluated()) {
return static_cast<unsigned short>((_Val << 8) | (_Val >> 8));
} else {
return _byteswap_ushort(_Val);
}
}
_NODISCARD constexpr unsigned long _Byteswap_ulong(const unsigned long _Val) noexcept {
if (_STD is_constant_evaluated()) {
return (_Val << 24) | ((_Val << 8) & 0x00FF'0000) | ((_Val >> 8) & 0x0000'FF00) | (_Val >> 24);
} else {
return _byteswap_ulong(_Val);
}
}
_NODISCARD constexpr unsigned long long _Byteswap_uint64(const unsigned long long _Val) noexcept {
if (_STD is_constant_evaluated()) {
return (_Val << 56) | ((_Val << 40) & 0x00FF'0000'0000'0000) | ((_Val << 24) & 0x0000'FF00'0000'0000)
| ((_Val << 8) & 0x0000'00FF'0000'0000) | ((_Val >> 8) & 0x0000'0000'FF00'0000)
| ((_Val >> 24) & 0x0000'0000'00FF'0000) | ((_Val >> 40) & 0x0000'0000'0000'FF00) | (_Val >> 56);
} else {
return _byteswap_uint64(_Val);
}
}
_EXPORT_STD template <class _Ty>
requires is_integral_v<_Ty>
_NODISCARD constexpr _Ty byteswap(const _Ty _Val) noexcept {
if constexpr (sizeof(_Ty) == 1) {
return _Val;
} else if constexpr (sizeof(_Ty) == 2) {
return static_cast<_Ty>(_Byteswap_ushort(static_cast<unsigned short>(_Val)));
} else if constexpr (sizeof(_Ty) == 4) {
return static_cast<_Ty>(_Byteswap_ulong(static_cast<unsigned long>(_Val)));
} else if constexpr (sizeof(_Ty) == 8) {
return static_cast<_Ty>(_Byteswap_uint64(static_cast<unsigned long long>(_Val)));
} else {
_STL_INTERNAL_STATIC_ASSERT(false); // unexpected size
}
}
#endif // _HAS_CXX23
template <class _Ty>
concept _Standard_unsigned_integral = _Is_standard_unsigned_integer<_Ty>;
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr int countl_zero(_Ty _Val) noexcept;
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr bool has_single_bit(const _Ty _Val) noexcept {
return _Val != 0 && (_Val & (_Val - 1)) == 0;
}
inline void _Precondition_violation_in_bit_ceil() noexcept {}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr _Ty bit_ceil(const _Ty _Val) noexcept /* strengthened */ {
if (_Val <= 1u) {
return _Ty{1};
}
const int _Num = _Unsigned_integer_digits<_Ty> - _STD countl_zero(static_cast<_Ty>(_Val - 1));
if constexpr (sizeof(_Ty) < sizeof(unsigned int)) { // for types subject to integral promotion
if (_STD is_constant_evaluated()) {
// Because N4950 [expr.shift]/1 "integral promotions are performed"
// the compiler will not generate a compile time error for
// uint8_t{1} << 8
// or
// uint16_t{1} << 16
// so we must manually enforce N4950 [bit.pow.two]/5, 8:
// "Preconditions: N is representable as a value of type T."
// "Remarks: A function call expression that violates the precondition in the Preconditions: element
// is not a core constant expression (7.7)."
if (_Num == _Unsigned_integer_digits<_Ty>) {
_Precondition_violation_in_bit_ceil();
}
}
}
return static_cast<_Ty>(_Ty{1} << _Num);
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr _Ty bit_floor(const _Ty _Val) noexcept {
if (_Val == 0) {
return 0;
}
return static_cast<_Ty>(_Ty{1} << (_Unsigned_integer_digits<_Ty> - 1 - _STD countl_zero(_Val)));
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr int bit_width(const _Ty _Val) noexcept {
return _Unsigned_integer_digits<_Ty> - _STD countl_zero(_Val);
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr _Ty rotr(_Ty _Val, int _Rotation) noexcept;
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr _Ty rotl(const _Ty _Val, const int _Rotation) noexcept {
constexpr auto _Digits = _Unsigned_integer_digits<_Ty>;
if (!_STD is_constant_evaluated()) {
if constexpr (_Digits == 64) {
return _rotl64(_Val, _Rotation);
} else if constexpr (_Digits == 32) {
return _rotl(_Val, _Rotation);
} else if constexpr (_Digits == 16) {
return _rotl16(_Val, static_cast<unsigned char>(_Rotation));
} else {
_STL_INTERNAL_STATIC_ASSERT(_Digits == 8);
return _rotl8(_Val, static_cast<unsigned char>(_Rotation));
}
}
const auto _Remainder = _Rotation % _Digits;
if (_Remainder > 0) {
return static_cast<_Ty>(
static_cast<_Ty>(_Val << _Remainder) | static_cast<_Ty>(_Val >> (_Digits - _Remainder)));
} else if (_Remainder == 0) {
return _Val;
} else { // _Remainder < 0
return _STD rotr(_Val, -_Remainder);
}
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr _Ty rotr(const _Ty _Val, const int _Rotation) noexcept {
constexpr auto _Digits = _Unsigned_integer_digits<_Ty>;
if (!_STD is_constant_evaluated()) {
if constexpr (_Digits == 64) {
return _rotr64(_Val, _Rotation);
} else if constexpr (_Digits == 32) {
return _rotr(_Val, _Rotation);
} else if constexpr (_Digits == 16) {
return _rotr16(_Val, static_cast<unsigned char>(_Rotation));
} else {
_STL_INTERNAL_STATIC_ASSERT(_Digits == 8);
return _rotr8(_Val, static_cast<unsigned char>(_Rotation));
}
}
const auto _Remainder = _Rotation % _Digits;
if (_Remainder > 0) {
return static_cast<_Ty>(
static_cast<_Ty>(_Val >> _Remainder) | static_cast<_Ty>(_Val << (_Digits - _Remainder)));
} else if (_Remainder == 0) {
return _Val;
} else { // _Remainder < 0
return _STD rotl(_Val, -_Remainder);
}
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr int countl_zero(const _Ty _Val) noexcept {
#if _HAS_COUNTL_ZERO_INTRINSICS
#if (defined(_M_IX86) && !defined(_M_HYBRID_X86_ARM64)) || (defined(_M_X64) && !defined(_M_ARM64EC))
if (!_STD is_constant_evaluated()) {
return _Checked_x86_x64_countl_zero(_Val);
}
#elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64)
if (!_STD is_constant_evaluated()) {
return _Checked_arm_arm64_countl_zero(_Val);
}
#endif // defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_HYBRID_X86_ARM64)
#endif // _HAS_COUNTL_ZERO_INTRINSICS
return _Countl_zero_fallback(_Val);
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr int countl_one(const _Ty _Val) noexcept {
return _STD countl_zero(static_cast<_Ty>(~_Val));
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr int countr_zero(const _Ty _Val) noexcept {
return _Countr_zero(_Val);
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr int countr_one(const _Ty _Val) noexcept {
return _Countr_zero(static_cast<_Ty>(~_Val));
}
_EXPORT_STD template <_Standard_unsigned_integral _Ty>
_NODISCARD constexpr int popcount(const _Ty _Val) noexcept {
return _Popcount(_Val);
}
_EXPORT_STD enum class endian { little = 0, big = 1, native = little };
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _HAS_CXX20
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _BIT_
@@ -0,0 +1,689 @@
// bitset standard header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _BITSET_
#define _BITSET_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <__msvc_bit_utils.hpp>
#include <iosfwd>
#include <xstring>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
#ifndef _STD_BITSET_TO_STREAM_STACK_RESERVATION
#define _STD_BITSET_TO_STREAM_STACK_RESERVATION 128
#endif // !defined(_STD_BITSET_TO_STREAM_STACK_RESERVATION)
#if _USE_STD_VECTOR_ALGORITHMS
// These bitset functions sometimes assume that the bit array has zero padding to a multiple of 2 or 4 bytes.
// The assumptions hold true even for the vNext suggestion to use smaller types for small bitsets (see GH-1498)
// due to vectorization thresholds.
extern "C" {
__declspec(noalias) void __stdcall __std_bitset_to_string_1(
char* _Dest, const void* _Src, size_t _Size_bits, char _Elem0, char _Elem1) noexcept;
__declspec(noalias) void __stdcall __std_bitset_to_string_2(
wchar_t* _Dest, const void* _Src, size_t _Size_bits, wchar_t _Elem0, wchar_t _Elem1) noexcept;
__declspec(noalias) bool __stdcall __std_bitset_from_string_1(void* _Dest, const char* _Src, size_t _Size_bytes,
size_t _Size_bits, size_t _Size_chars, char _Elem0, char _Elem1) noexcept;
__declspec(noalias) bool __stdcall __std_bitset_from_string_2(void* _Dest, const wchar_t* _Src, size_t _Size_bytes,
size_t _Size_bits, size_t _Size_chars, wchar_t _Elem0, wchar_t _Elem1) noexcept;
} // extern "C"
#endif // _USE_STD_VECTOR_ALGORITHMS
_STD_BEGIN
template <class _Elem, size_t _Bits, bool _Dynamic = (_Bits * sizeof(_Elem) > _STD_BITSET_TO_STREAM_STACK_RESERVATION)>
struct _Buffer_for_bitset {
_Buffer_for_bitset() noexcept = default;
_Buffer_for_bitset(const _Buffer_for_bitset&) = delete;
_Buffer_for_bitset& operator=(const _Buffer_for_bitset&) = delete;
~_Buffer_for_bitset() {
delete[] _Buf;
}
void _Allocate() {
_Buf = new _Elem[_Bits];
}
_Elem* _Buf = nullptr;
};
template <class _Elem, size_t _Bits>
struct _Buffer_for_bitset<_Elem, _Bits, false> {
_Buffer_for_bitset() noexcept { /* intentionally not initializing _Buf */ }
_Buffer_for_bitset(const _Buffer_for_bitset&) = delete;
_Buffer_for_bitset& operator=(const _Buffer_for_bitset&) = delete;
void _Allocate() noexcept {}
_Elem _Buf[(_Bits != 0) ? _Bits : 1];
};
_EXPORT_STD template <size_t _Bits>
class bitset { // store fixed-length sequence of Boolean elements
private:
#pragma warning(push)
#pragma warning(disable : 4296) // expression is always true (/Wall)
using _Ty = conditional_t<_Bits <= sizeof(unsigned long) * CHAR_BIT, unsigned long, unsigned long long>;
#pragma warning(pop)
public:
class reference { // proxy for an element
friend bitset;
public:
_CONSTEXPR23 reference(const reference&) = default;
_CONSTEXPR23 ~reference() noexcept {} // TRANSITION, ABI
_CONSTEXPR23 reference& operator=(const bool _Val) noexcept {
_Pbitset->_Set_unchecked(_Mypos, _Val);
return *this;
}
_CONSTEXPR23 reference& operator=(const reference& _Bitref) noexcept {
_Pbitset->_Set_unchecked(_Mypos, static_cast<bool>(_Bitref));
return *this;
}
_NODISCARD _CONSTEXPR23 bool operator~() const noexcept {
return !_Pbitset->_Subscript(_Mypos);
}
_CONSTEXPR23 operator bool() const noexcept {
return _Pbitset->_Subscript(_Mypos);
}
_CONSTEXPR23 reference& flip() noexcept {
_Pbitset->_Flip_unchecked(_Mypos);
return *this;
}
private:
_CONSTEXPR23 reference(bitset<_Bits>& _Bitset, const size_t _Pos) noexcept : _Pbitset(&_Bitset), _Mypos(_Pos) {}
bitset<_Bits>* _Pbitset;
size_t _Mypos; // position of element in bitset
};
private:
constexpr bool _Subscript(size_t _Pos) const noexcept {
return (_Array[_Pos / _Bitsperword] & (_Ty{1} << _Pos % _Bitsperword)) != 0;
}
static constexpr bool _Need_mask = _Bits < CHAR_BIT * sizeof(unsigned long long);
static constexpr unsigned long long _Mask = (1ULL << (_Need_mask ? _Bits : 0)) - 1ULL;
public:
_NODISCARD constexpr bool operator[](const size_t _Pos) const noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_BITSET || _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(_Pos < _Bits, "bitset subscript out of range");
#endif
return _Subscript(_Pos);
}
_NODISCARD _CONSTEXPR23 reference operator[](const size_t _Pos) noexcept /* strengthened */ {
#if _MSVC_STL_HARDENING_BITSET || _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(_Pos < _Bits, "bitset subscript out of range");
#endif
return reference(*this, _Pos);
}
constexpr bitset() noexcept : _Array() {} // construct with all false values
constexpr bitset(unsigned long long _Val) noexcept : _Array{static_cast<_Ty>(_Need_mask ? _Val & _Mask : _Val)} {}
private:
template <class _Traits, class _Elem>
_CONSTEXPR23 void _Construct(const _Elem* const _Ptr, size_t _Count, const _Elem _Elem0, const _Elem _Elem1) {
#if _USE_STD_VECTOR_ALGORITHMS
constexpr size_t _Bitset_from_string_vector_threshold = 16;
if constexpr (_Bits >= _Bitset_from_string_vector_threshold
&& _Is_implementation_handled_char_traits<_Traits> && sizeof(_Elem) <= 2) {
if (!_STD _Is_constant_evaluated()) {
bool _Result;
if constexpr (sizeof(_Elem) == 1) {
_Result = __std_bitset_from_string_1(_Array, reinterpret_cast<const char*>(_Ptr), sizeof(_Array),
_Bits, _Count, static_cast<char>(_Elem0), static_cast<char>(_Elem1));
} else {
_STL_INTERNAL_STATIC_ASSERT(sizeof(_Elem) == 2);
_Result = __std_bitset_from_string_2(_Array, reinterpret_cast<const wchar_t*>(_Ptr), sizeof(_Array),
_Bits, _Count, static_cast<wchar_t>(_Elem0), static_cast<wchar_t>(_Elem1));
}
if (!_Result) {
_Xinv();
}
return;
}
}
#endif // _USE_STD_VECTOR_ALGORITHMS
if (_Count > _Bits) {
for (size_t _Idx = _Bits; _Idx < _Count; ++_Idx) {
const auto _Ch = _Ptr[_Idx];
if (!_Traits::eq(_Elem1, _Ch) && !_Traits::eq(_Elem0, _Ch)) {
_Xinv();
}
}
_Count = _Bits;
}
size_t _Wpos = 0;
if (_Count != 0) {
size_t _Bits_used_in_word = 0;
auto _Last = _Ptr + _Count;
_Ty _This_word = 0;
do {
--_Last;
const auto _Ch = *_Last;
_This_word |= static_cast<_Ty>(_Traits::eq(_Elem1, _Ch)) << _Bits_used_in_word;
if (!_Traits::eq(_Elem1, _Ch) && !_Traits::eq(_Elem0, _Ch)) {
_Xinv();
}
if (++_Bits_used_in_word == _Bitsperword) {
_Array[_Wpos] = _This_word;
++_Wpos;
_This_word = 0;
_Bits_used_in_word = 0;
}
} while (_Ptr != _Last);
if (_Bits_used_in_word != 0) {
_Array[_Wpos] = _This_word;
++_Wpos;
}
}
for (; _Wpos <= _Words; ++_Wpos) {
_Array[_Wpos] = 0;
}
}
public:
template <class _Elem, class _Traits, class _Alloc>
_CONSTEXPR23 explicit bitset(const basic_string<_Elem, _Traits, _Alloc>& _Str,
typename basic_string<_Elem, _Traits, _Alloc>::size_type _Pos = 0,
typename basic_string<_Elem, _Traits, _Alloc>::size_type _Count = basic_string<_Elem, _Traits, _Alloc>::npos,
_Elem _Elem0 = static_cast<_Elem>('0'), _Elem _Elem1 = static_cast<_Elem>('1')) {
// construct from [_Pos, _Pos + _Count) elements in string
if (_Str.size() < _Pos) {
_Xran(); // _Pos off end
}
if (_Str.size() - _Pos < _Count) {
_Count = _Str.size() - _Pos; // trim _Count to size
}
_Construct<_Traits>(_Str.data() + _Pos, _Count, _Elem0, _Elem1);
}
template <class _Elem>
_CONSTEXPR23 explicit bitset(const _Elem* _Ntcts,
typename basic_string<_Elem>::size_type _Count = basic_string<_Elem>::npos,
_Elem _Elem0 = static_cast<_Elem>('0'), _Elem _Elem1 = static_cast<_Elem>('1')) {
if (_Count == basic_string<_Elem>::npos) {
_Count = char_traits<_Elem>::length(_Ntcts);
}
_Construct<char_traits<_Elem>>(_Ntcts, _Count, _Elem0, _Elem1);
}
_CONSTEXPR23 bitset& operator&=(const bitset& _Right) noexcept {
for (size_t _Wpos = 0; _Wpos <= _Words; ++_Wpos) {
_Array[_Wpos] &= _Right._Array[_Wpos];
}
return *this;
}
_CONSTEXPR23 bitset& operator|=(const bitset& _Right) noexcept {
for (size_t _Wpos = 0; _Wpos <= _Words; ++_Wpos) {
_Array[_Wpos] |= _Right._Array[_Wpos];
}
return *this;
}
_CONSTEXPR23 bitset& operator^=(const bitset& _Right) noexcept {
for (size_t _Wpos = 0; _Wpos <= _Words; ++_Wpos) {
_Array[_Wpos] ^= _Right._Array[_Wpos];
}
return *this;
}
_CONSTEXPR23 bitset& operator<<=(size_t _Pos) noexcept { // shift left by _Pos, first by words then by bits
const auto _Wordshift = static_cast<ptrdiff_t>(_Pos / _Bitsperword);
if (_Wordshift != 0) {
for (ptrdiff_t _Wpos = _Words; 0 <= _Wpos; --_Wpos) {
_Array[_Wpos] = _Wordshift <= _Wpos ? _Array[_Wpos - _Wordshift] : 0;
}
}
if ((_Pos %= _Bitsperword) != 0) { // 0 < _Pos < _Bitsperword, shift by bits
for (ptrdiff_t _Wpos = _Words; 0 < _Wpos; --_Wpos) {
_Array[_Wpos] = (_Array[_Wpos] << _Pos) | (_Array[_Wpos - 1] >> (_Bitsperword - _Pos));
}
_Array[0] <<= _Pos;
}
_Trim();
return *this;
}
_CONSTEXPR23 bitset& operator>>=(size_t _Pos) noexcept { // shift right by _Pos, first by words then by bits
const auto _Wordshift = static_cast<ptrdiff_t>(_Pos / _Bitsperword);
if (_Wordshift != 0) {
for (ptrdiff_t _Wpos = 0; _Wpos <= _Words; ++_Wpos) {
_Array[_Wpos] = _Wordshift <= _Words - _Wpos ? _Array[_Wpos + _Wordshift] : 0;
}
}
if ((_Pos %= _Bitsperword) != 0) { // 0 < _Pos < _Bitsperword, shift by bits
for (ptrdiff_t _Wpos = 0; _Wpos < _Words; ++_Wpos) {
_Array[_Wpos] = (_Array[_Wpos] >> _Pos) | (_Array[_Wpos + 1] << (_Bitsperword - _Pos));
}
_Array[_Words] >>= _Pos;
}
return *this;
}
_CONSTEXPR23 bitset& set() noexcept { // set all bits true
#if _HAS_CXX23
if (_STD is_constant_evaluated()) {
for (auto& _El : _Array) {
_El = static_cast<_Ty>(-1);
}
} else
#endif // _HAS_CXX23
{
_CSTD memset(&_Array, 0xFF, sizeof(_Array));
}
_Trim();
return *this;
}
_CONSTEXPR23 bitset& set(const size_t _Pos, bool _Val = true) { // set bit at _Pos to _Val
if (_Bits <= _Pos) {
_Xran(); // _Pos off end
}
return _Set_unchecked(_Pos, _Val);
}
_CONSTEXPR23 bitset& reset() noexcept { // set all bits false
#if _HAS_CXX23
if (_STD is_constant_evaluated()) {
for (auto& _El : _Array) {
_El = 0;
}
} else
#endif // _HAS_CXX23
{
_CSTD memset(&_Array, 0, sizeof(_Array));
}
return *this;
}
_CONSTEXPR23 bitset& reset(const size_t _Pos) { // set bit at _Pos to false
return set(_Pos, false);
}
_NODISCARD _CONSTEXPR23 bitset operator~() const noexcept { // flip all bits
bitset _Tmp = *this;
_Tmp.flip();
return _Tmp;
}
_CONSTEXPR23 bitset& flip() noexcept { // flip all bits
for (size_t _Wpos = 0; _Wpos <= _Words; ++_Wpos) {
_Array[_Wpos] = ~_Array[_Wpos];
}
_Trim();
return *this;
}
_CONSTEXPR23 bitset& flip(const size_t _Pos) { // flip bit at _Pos
if (_Bits <= _Pos) {
_Xran(); // _Pos off end
}
return _Flip_unchecked(_Pos);
}
_NODISCARD _CONSTEXPR23 unsigned long to_ulong() const noexcept(_Bits <= 32) /* strengthened */ {
constexpr bool _Bits_zero = _Bits == 0;
constexpr bool _Bits_small = _Bits <= 32;
constexpr bool _Bits_large = _Bits > 64;
if constexpr (_Bits_zero) {
return 0;
} else if constexpr (_Bits_small) {
return static_cast<unsigned long>(_Array[0]);
} else {
if constexpr (_Bits_large) {
for (size_t _Idx = 1; _Idx <= _Words; ++_Idx) {
if (_Array[_Idx] != 0) {
_Xoflo(); // fail if any high-order words are nonzero
}
}
}
if (!_STD _In_range<unsigned long>(_Array[0])) {
_Xoflo();
}
return static_cast<unsigned long>(_Array[0]);
}
}
_NODISCARD _CONSTEXPR23 unsigned long long to_ullong() const noexcept(_Bits <= 64) /* strengthened */ {
constexpr bool _Bits_zero = _Bits == 0;
constexpr bool _Bits_large = _Bits > 64;
if constexpr (_Bits_zero) {
return 0;
} else {
if constexpr (_Bits_large) {
for (size_t _Idx = 1; _Idx <= _Words; ++_Idx) {
if (_Array[_Idx] != 0) {
_Xoflo(); // fail if any high-order words are nonzero
}
}
}
return _Array[0];
}
}
template <class _Elem = char, class _Tr = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_NODISCARD _CONSTEXPR23 basic_string<_Elem, _Tr, _Alloc> to_string(
const _Elem _Elem0 = static_cast<_Elem>('0'), const _Elem _Elem1 = static_cast<_Elem>('1')) const {
// convert bitset to string
basic_string<_Elem, _Tr, _Alloc> _Str;
_Str._Resize_and_overwrite(_Bits, [this, _Elem0, _Elem1](_Elem* _Buf, size_t _Len) {
_To_string(_Buf, _Len, _Elem0, _Elem1);
return _Len;
});
return _Str;
}
_NODISCARD _CONSTEXPR23 size_t count() const noexcept { // count number of set bits
return _Select_popcount_impl<_Ty>([this](auto _Popcount_impl) {
size_t _Val = 0;
for (size_t _Wpos = 0; _Wpos <= _Words; ++_Wpos) {
_Val += _Popcount_impl(_Array[_Wpos]);
}
return _Val;
});
}
_NODISCARD constexpr size_t size() const noexcept {
return _Bits;
}
_NODISCARD _CONSTEXPR23 bool operator==(const bitset& _Right) const noexcept {
#if _HAS_CXX23
if (_STD is_constant_evaluated()) {
for (size_t _Index = 0; _Index <= _Words; ++_Index) {
if (_Array[_Index] != _Right._Array[_Index]) {
return false;
}
}
return true;
} else
#endif // _HAS_CXX23
{
return _CSTD memcmp(&_Array[0], &_Right._Array[0], sizeof(_Array)) == 0;
}
}
#if !_HAS_CXX20
_NODISCARD bool operator!=(const bitset& _Right) const noexcept {
return !(*this == _Right);
}
#endif // !_HAS_CXX20
_NODISCARD _CONSTEXPR23 bool test(const size_t _Pos) const {
if (_Bits <= _Pos) {
_Xran(); // _Pos off end
}
return _Subscript(_Pos);
}
_NODISCARD _CONSTEXPR23 bool any() const noexcept {
for (size_t _Wpos = 0; _Wpos <= _Words; ++_Wpos) {
if (_Array[_Wpos] != 0) {
return true;
}
}
return false;
}
_NODISCARD _CONSTEXPR23 bool none() const noexcept {
return !any();
}
_NODISCARD _CONSTEXPR23 bool all() const noexcept {
constexpr bool _Zero_length = _Bits == 0;
if constexpr (_Zero_length) { // must test for this, otherwise would count one full word
return true;
}
constexpr bool _No_padding = _Bits % _Bitsperword == 0;
for (size_t _Wpos = 0; _Wpos < _Words + _No_padding; ++_Wpos) {
if (_Array[_Wpos] != ~static_cast<_Ty>(0)) {
return false;
}
}
return _No_padding || _Array[_Words] == (static_cast<_Ty>(1) << (_Bits % _Bitsperword)) - 1;
}
_NODISCARD _CONSTEXPR23 bitset operator<<(const size_t _Pos) const noexcept {
bitset _Tmp = *this;
_Tmp <<= _Pos;
return _Tmp;
}
_NODISCARD _CONSTEXPR23 bitset operator>>(const size_t _Pos) const noexcept {
bitset _Tmp = *this;
_Tmp >>= _Pos;
return _Tmp;
}
_NODISCARD _Ty _Getword(size_t _Wpos) const noexcept { // nonstandard extension; get underlying word
return _Array[_Wpos];
}
template <class _Elem>
_CONSTEXPR23 void _To_string(
_Elem* const _Buf, const size_t _Len, const _Elem _Elem0, const _Elem _Elem1) const noexcept {
#if _USE_STD_VECTOR_ALGORITHMS
constexpr size_t _Bitset_to_string_vector_threshold = 32;
if constexpr (_Bits >= _Bitset_to_string_vector_threshold && is_integral_v<_Elem> && sizeof(_Elem) <= 2) {
if (!_Is_constant_evaluated()) {
if constexpr (sizeof(_Elem) == 1) {
__std_bitset_to_string_1(reinterpret_cast<char*>(_Buf), _Array, _Len, static_cast<char>(_Elem0),
static_cast<char>(_Elem1));
} else {
_STL_INTERNAL_STATIC_ASSERT(sizeof(_Elem) == 2);
__std_bitset_to_string_2(reinterpret_cast<wchar_t*>(_Buf), _Array, _Len,
static_cast<wchar_t>(_Elem0), static_cast<wchar_t>(_Elem1));
}
return;
}
}
#endif // _USE_STD_VECTOR_ALGORITHMS
for (size_t _Pos = 0; _Pos < _Len; ++_Pos) {
_Buf[_Pos] = _Subscript(_Len - 1 - _Pos) ? _Elem1 : _Elem0;
}
}
private:
friend hash<bitset<_Bits>>;
static constexpr ptrdiff_t _Bitsperword = CHAR_BIT * sizeof(_Ty);
static constexpr ptrdiff_t _Words = _Bits == 0 ? 0 : (_Bits - 1) / _Bitsperword; // NB: number of words - 1
_CONSTEXPR23 void _Trim() noexcept { // clear any trailing bits in last word
constexpr bool _Work_to_do = _Bits == 0 || _Bits % _Bitsperword != 0;
if constexpr (_Work_to_do) {
_Array[_Words] &= (_Ty{1} << _Bits % _Bitsperword) - 1;
}
}
_CONSTEXPR23 bitset& _Set_unchecked(const size_t _Pos, const bool _Val) noexcept {
// set bit at _Pos to _Val, no checking
auto& _Selected_word = _Array[_Pos / _Bitsperword];
const auto _Bit = _Ty{1} << _Pos % _Bitsperword;
if (_Val) {
_Selected_word |= _Bit;
} else {
_Selected_word &= ~_Bit;
}
return *this;
}
_CONSTEXPR23 bitset& _Flip_unchecked(const size_t _Pos) noexcept { // flip bit at _Pos, no checking
_Array[_Pos / _Bitsperword] ^= _Ty{1} << _Pos % _Bitsperword;
return *this;
}
[[noreturn]] static void _Xinv() {
_Xinvalid_argument("invalid bitset char");
}
[[noreturn]] static void _Xoflo() {
_Xoverflow_error("bitset overflow");
}
[[noreturn]] static void _Xran() {
_Xout_of_range("invalid bitset position");
}
_Ty _Array[_Words + 1];
};
_EXPORT_STD template <size_t _Bits>
_NODISCARD _CONSTEXPR23 bitset<_Bits> operator&(const bitset<_Bits>& _Left, const bitset<_Bits>& _Right) noexcept {
bitset<_Bits> _Ans = _Left;
_Ans &= _Right;
return _Ans;
}
_EXPORT_STD template <size_t _Bits>
_NODISCARD _CONSTEXPR23 bitset<_Bits> operator|(const bitset<_Bits>& _Left, const bitset<_Bits>& _Right) noexcept {
bitset<_Bits> _Ans = _Left;
_Ans |= _Right;
return _Ans;
}
_EXPORT_STD template <size_t _Bits>
_NODISCARD _CONSTEXPR23 bitset<_Bits> operator^(const bitset<_Bits>& _Left, const bitset<_Bits>& _Right) noexcept {
bitset<_Bits> _Ans = _Left;
_Ans ^= _Right;
return _Ans;
}
_EXPORT_STD template <class _Elem, class _Tr, size_t _Bits>
basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const bitset<_Bits>& _Right) {
using _Ctype = typename basic_ostream<_Elem, _Tr>::_Ctype;
const _Ctype& _Ctype_fac = _STD use_facet<_Ctype>(_Ostr.getloc());
const _Elem _Elem0 = _Ctype_fac.widen('0');
const _Elem _Elem1 = _Ctype_fac.widen('1');
_Buffer_for_bitset<_Elem, _Bits> _Buf;
_Buf._Allocate();
_Right._To_string(_Buf._Buf, _Bits, _Elem0, _Elem1);
_Ostr.write(_Buf._Buf, _Bits);
return _Ostr;
}
_EXPORT_STD template <class _Elem, class _Tr, size_t _Bits>
basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, bitset<_Bits>& _Right) {
using _Istr_t = basic_istream<_Elem, _Tr>;
using _Ctype = typename _Istr_t::_Ctype;
const _Ctype& _Ctype_fac = _STD use_facet<_Ctype>(_Istr.getloc());
const _Elem _Elem0 = _Ctype_fac.widen('0');
const _Elem _Elem1 = _Ctype_fac.widen('1');
typename _Istr_t::iostate _State = _Istr_t::goodbit;
size_t _Count = 0;
_Buffer_for_bitset<_Elem, _Bits> _Buf;
const typename _Istr_t::sentry _Ok(_Istr);
if (_Ok) { // valid stream, extract elements
_TRY_IO_BEGIN
_Buf._Allocate();
typename _Tr::int_type _Meta = _Istr.rdbuf()->sgetc();
for (; _Count < _Bits; ++_Count, _Meta = _Istr.rdbuf()->snextc()) {
// test _Meta
if (_Tr::eq_int_type(_Tr::eof(), _Meta)) { // end of file, quit
_State |= _Istr_t::eofbit;
break;
}
const _Elem _Char = _Tr::to_char_type(_Meta);
if (!_Tr::eq(_Char, _Elem0) && !_Tr::eq(_Char, _Elem1)) {
break; // invalid element
}
// valid, append '0' or '1'
_Buf._Buf[_Count] = '0' + _Tr::eq(_Char, _Elem1);
}
_CATCH_IO_(_Istr_t, _Istr)
}
constexpr bool _Has_bits = _Bits > 0;
if constexpr (_Has_bits) {
if (_Count == 0) {
_State |= _Istr_t::failbit;
}
}
_Istr.setstate(_State);
_Right = bitset<_Bits>{_Buf._Buf, _Count}; // convert string and store
return _Istr;
}
template <size_t _Bits>
struct hash<bitset<_Bits>> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = bitset<_Bits>;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const bitset<_Bits>& _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Keyval._Array);
}
};
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _BITSET_
@@ -0,0 +1,9 @@
// cassert standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// NOTE: no include guard
#include <yvals_core.h>
#include <assert.h>
@@ -0,0 +1,19 @@
//
// castguard.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Declarations of CastGuard instrumentation support functions.
//
typedef void (__cdecl* __check_guard_fp)(void*);
#ifdef __cplusplus
extern "C" {
#endif
__check_guard_fp __cdecl __castguard_set_user_handler(__check_guard_fp new_handler);
#ifdef __cplusplus
} // extern "C"
#endif
@@ -0,0 +1,29 @@
// ccomplex standard header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CCOMPLEX_
#define _CCOMPLEX_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <complex>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
using _Header_ccomplex _CXX17_DEPRECATE_C_HEADER = int;
using _Hdr_ccomplex = _Header_ccomplex;
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CCOMPLEX_
@@ -0,0 +1,44 @@
// cctype standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CCTYPE_
#define _CCTYPE_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <ctype.h>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
_EXPORT_STD using _CSTD isalnum;
_EXPORT_STD using _CSTD isalpha;
_EXPORT_STD using _CSTD iscntrl;
_EXPORT_STD using _CSTD isdigit;
_EXPORT_STD using _CSTD isgraph;
_EXPORT_STD using _CSTD islower;
_EXPORT_STD using _CSTD isprint;
_EXPORT_STD using _CSTD ispunct;
_EXPORT_STD using _CSTD isspace;
_EXPORT_STD using _CSTD isupper;
_EXPORT_STD using _CSTD isxdigit;
_EXPORT_STD using _CSTD tolower;
_EXPORT_STD using _CSTD toupper;
_EXPORT_STD using _CSTD isblank;
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CCTYPE_
@@ -0,0 +1,14 @@
// cerrno standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CERRNO_
#define _CERRNO_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <errno.h>
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CERRNO_
@@ -0,0 +1,48 @@
// cfenv standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CFENV_
#define _CFENV_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <fenv.h>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
_EXPORT_STD using _CSTD fegetround;
_EXPORT_STD using _CSTD fesetround;
#if !defined(_M_CEE) || defined(_CRTBLD)
_EXPORT_STD using _CSTD feclearexcept;
_EXPORT_STD using _CSTD fegetenv;
_EXPORT_STD using _CSTD fegetexceptflag;
_EXPORT_STD using _CSTD feholdexcept;
_EXPORT_STD using _CSTD fenv_t;
_EXPORT_STD using _CSTD fesetenv;
_EXPORT_STD using _CSTD fesetexceptflag;
_EXPORT_STD using _CSTD fetestexcept;
_EXPORT_STD using _CSTD fexcept_t;
#endif // !defined(_M_CEE) || defined(_CRTBLD)
#if !defined(_M_CEE) && !defined(_CRTBLD)
_EXPORT_STD using _CSTD feraiseexcept;
_EXPORT_STD using _CSTD feupdateenv;
#endif // !defined(_M_CEE) && !defined(_CRTBLD)
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CFENV_
@@ -0,0 +1,69 @@
//
// cfguard.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Declarations of Control Flow Guard instrumentation and support functions.
//
#pragma once
#ifndef _CFGUARD_H
#define _CFGUARD_H
#include <sal.h>
#include <vadefs.h>
#pragma warning(push)
#pragma warning(disable: _VCRUNTIME_DISABLED_WARNINGS)
#pragma pack(push, _CRT_PACKING)
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(__midl) && !defined(MIDL_PASS)
#ifdef _M_CEE
// This is a placeholder. Control Flow Guard is not implemented for /clr.
void __cdecl _guard_check_icall(_In_ uintptr_t _Target);
#else
#if defined(_M_ARM64EC)
uintptr_t __fastcall __os_arm64x_check_icall_thunk(_In_ uintptr_t _Target);
#elif defined(_M_ARM64)
void __fastcall __guard_check_icall_thunk(_In_ uintptr_t _Target);
#else
void __fastcall _guard_check_icall(_In_ uintptr_t _Target);
#endif
#if defined(_CONTROL_FLOW_GUARD) && (_CONTROL_FLOW_GUARD == 1)
#if defined(_M_ARM64EC)
#define _GUARD_CHECK_ICALL(_Target) __os_arm64x_check_icall_thunk((uintptr_t)(_Target))
#elif defined(_M_ARM64)
#define _GUARD_CHECK_ICALL(_Target) __guard_check_icall_thunk((uintptr_t)(_Target))
#else
#define _GUARD_CHECK_ICALL(_Target) _guard_check_icall((uintptr_t)(_Target))
#endif
#else
#define _GUARD_CHECK_ICALL(_Target) ((VOID)0)
#endif
#endif
int __cdecl _guard_icall_checks_enforced(void);
#endif // !defined(__midl) && !defined(MIDL_PASS)
#ifdef __cplusplus
} // extern "C"
#endif
// This is defined in the Windows 10 SDK but not in the Windows 8.1 SDK.
#if !defined DECLSPEC_GUARD_SUPPRESS
#define DECLSPEC_GUARD_SUPPRESS __declspec(guard(suppress))
#endif
#pragma pack(pop)
#pragma warning(pop) // _VCRUNTIME_DISABLED_WARNINGS
#endif // _CFGUARD_H
@@ -0,0 +1,11 @@
// cfloat standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CFLOAT_
#define _CFLOAT_
#include <yvals_core.h>
#include <float.h>
#endif // _CFLOAT_
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,38 @@
// cinttypes standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CINTTYPES_
#define _CINTTYPES_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cstdint>
#include <inttypes.h>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
_EXPORT_STD using _CSTD imaxdiv_t; // from <inttypes.h>
_EXPORT_STD using _CSTD imaxabs;
_EXPORT_STD using _CSTD imaxdiv;
_EXPORT_STD using _CSTD strtoimax;
_EXPORT_STD using _CSTD strtoumax;
_EXPORT_STD using _CSTD wcstoimax;
_EXPORT_STD using _CSTD wcstoumax;
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CINTTYPES_
@@ -0,0 +1,17 @@
// ciso646 standard header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CISO646_
#define _CISO646_
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#include <iso646.h>
using _Header_ciso646 _CXX20_REMOVE_CISO646 = int;
using _Hdr_ciso646 = _Header_ciso646;
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CISO646_
@@ -0,0 +1,900 @@
// memory stl/clr header
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _CLI_MEMORY_
#define _CLI_MEMORY_
#include <cliext/iterator>
#include <cliext/utility> // for pair
#ifdef _M_CEE_SAFE
#define _PAIR_TYPE(iter_t) cliext::pair<iter_t, iter_t> // iterator pair
#define _PAIR_TYPE2(iter1_t, iter2_t) \
cliext::pair<iter1_t, iter2_t> // iterator pair
#define _STLCLRDB_ERROR(mesg)
#define _STLCLRDB_LT(left, right) ((left) < (right))
#define _STLCLRDB_LT_PRED(pred, left, right) ((pred)(left, right))
#define _STLCLRDB_POINTER(first)
#define _STLCLRDB_ORDER(first, last)
#define _STLCLRDB_ORDER_PRED(first, last, pred)
#define _STLCLRDB_RANGE(first, last)
#else /* _M_CEE_SAFE */
#include <climits> // for CHAR_MAX, UCHAR_MAX
#include <cstddef> // for ptrdiff_t, size_t
#include <cstring> // form mem* functions
#include <new> // for placement new
#include <utility> // for std::pair
#include <xutility> // for CHAR_MAX, UCHAR_MAX, iterator debugging
#define _PAIR_TYPE(iter_t) typename cliext::_Pick_pair< \
__is_value_class(iter_t) || __is_ref_class(iter_t), \
iter_t, iter_t>::value_type
#define _PAIR_TYPE2(iter1_t, iter2_t) typename cliext::_Pick_pair< \
__is_value_class(iter1_t) || __is_ref_class(iter1_t), \
iter1_t, iter2_t>::value_type // both managed or both unmanaged
namespace cliext {
template<bool _Is_managed,
typename _Value1_t,
typename _Value2_t>
class _Pick_pair; // select managed or unmanaged type
template<typename _Value1_t,
typename _Value2_t>
class _Pick_pair<false, _Value1_t, _Value2_t>
{ // define unmanaged type
public:
typedef std::pair<_Value1_t, _Value2_t> value_type;
};
template<typename _Value1_t,
typename _Value2_t>
class _Pick_pair<true, _Value1_t, _Value2_t>
{ // define managed type
public:
typedef cliext::pair<_Value1_t, _Value2_t> value_type;
};
} // namespace cliext
#if _HAS_ITERATOR_DEBUGGING
#ifndef _STLCLRDB_REPORT
#define _STLCLRDB_REPORT(mesg, file, line) \
if (::_CrtDbgReportW(_CRT_ASSERT, file, line, NULL, L"%ls", mesg) == 1) { ::_CrtDbgBreak(); }
#endif /* _STLCLRDB_REPORT */
#define _STLCLRDB_ERROR(mesg) \
_STLCLRDB_REPORT(mesg, __FILEW__, __LINE__)
#define _STLCLRDB_LT(left, right) \
cliext::_Stlclrdb_lt(left, right, __FILEW__, __LINE__)
#define _STLCLRDB_LT_PRED(pred, left, right) \
cliext::_Stlclrdb_lt_pred(pred, left, right, __FILEW__, __LINE__)
#define _STLCLRDB_POINTER(first) \
cliext::_Stlclrdb_pointer(first, __FILEW__, __LINE__)
#define _STLCLRDB_POINTER2(first, filew, line) \
cliext::_Stlclrdb_pointer(first, filew, line)
#define _STLCLRDB_ORDER(first, last) \
cliext::_Stlclrdb_order(first, last, __FILEW__, __LINE__)
#define _STLCLRDB_ORDER_PRED(first, last, pred) \
cliext::_Stlclrdb_order(first, last, pred, __FILEW__, __LINE__)
#define _STLCLRDB_RANGE(first, last) \
cliext::_Stlclrdb_range(first, last, __FILEW__, __LINE__)
#define _STLCLRDB_RANGE2(first, last, filew, line) \
cliext::_Stlclrdb_range(first, last, filew, line)
namespace cliext {
template<class _Ty1, class _Ty2> inline
bool _Stlclrdb_lt(_Ty1% _Left, _Ty2% _Right,
const wchar_t *_File, unsigned int _Line)
{ // test if _Left < _Right and operator< is strict weak ordering
if (!(_Left < _Right))
return (false);
else if (_Right < _Left)
_STLCLRDB_REPORT(L"invalid operator<", _File, _Line);
return (true);
}
template<class _Pr, class _Ty1, class _Ty2> inline
bool _Stlclrdb_lt_pred(_Pr _Pred, _Ty1% _Left, _Ty2% _Right,
const wchar_t *_File, unsigned int _Line)
{ // test if _Pred(_Left, _Right) and _Pred is strict weak ordering
if (!_Pred(_Left, _Right))
return (false);
else if (_Pred(_Right, _Left))
_STLCLRDB_REPORT(L"invalid operator<", _File, _Line);
return (true);
}
// TEMPLATE FUNCTION _Stlclrdb_pointer
template<class _InIt> inline
void _Stlclrdb_pointer(_InIt%, const wchar_t *, unsigned int)
{ // test pointer for non-singularity, arbitrary type
}
template<class _Ty> inline
void _Stlclrdb_pointer(const _Ty *_First, const wchar_t *_File,
unsigned int _Line)
{ // test iterator for non-singularity, const pointers
if (_First == 0)
_STLCLRDB_REPORT(L"invalid null pointer", _File, _Line);
}
template<class _Ty> inline
void _Stlclrdb_pointer(_Ty *_First, const wchar_t *_File,
unsigned int _Line)
{ // test iterator for non-singularity, pointers
if (_First == 0)
_STLCLRDB_REPORT(L"invalid null pointer", _File, _Line);
}
// TEMPLATE FUNCTION _Stlclrdb_range
template<class _InIt> inline
void _Stlclrdb_range2(_InIt, _InIt,
const wchar_t *, unsigned int, input_iterator_tag)
{ // test iterator pair for valid range, arbitrary iterators
}
template<class _RanIt> inline
void _Stlclrdb_range2(_RanIt _First, _RanIt _Last,
const wchar_t *_Filew, unsigned int _Line,
random_access_iterator_tag)
{ // test iterator pair for valid range, random-access iterators
if (_First != _Last)
{ // check for non-null pointers, valid range
_STLCLRDB_POINTER2(_First, _Filew, _Line);
_STLCLRDB_POINTER2(_Last, _Filew, _Line);
if (_Last < _First)
_STLCLRDB_REPORT(L"invalid iterator range", _Filew, _Line);
}
}
template<class _InIt> inline
void _Stlclrdb_range(_InIt _First, _InIt _Last,
const wchar_t *_Filew, unsigned int _Line)
{ // test iterator pair for valid range
_Stlclrdb_range2(_First, _Last, _Filew, _Line, _Iter_category(_First));
}
// TEMPLATE FUNCTION _Stlclrdb_order
template<class _InIt> inline
void _Stlclrdb_order2(_InIt _First, _InIt _Last,
const wchar_t *_File, unsigned int _Line, input_iterator_tag)
{ // test if range is ordered by operator<, input iterators
}
template<class _FwdIt> inline
void _Stlclrdb_order2(_FwdIt _First, _FwdIt _Last,
const wchar_t *_File, unsigned int _Line, forward_iterator_tag)
{ // test if range is ordered by operator<, forward iterators
for (_FwdIt _Next = _First; _First != _Last && ++_Next != _Last; ++_First)
if (_STLCLRDB_LT(*_Next, *_First))
_STLCLRDB_REPORT(L"sequence not ordered", _File, _Line);
}
template<class _InIt> inline
void _Stlclrdb_order(_InIt _First, _InIt _Last,
const wchar_t *_File, unsigned int _Line)
{ // test is range is ordered by operator<
_STLCLRDB_RANGE2(_First, _Last, _File, _Line);
_Stlclrdb_order2(_First, _Last, _File, _Line, _Iter_category(_First));
}
// TEMPLATE FUNCTION _Stlclrdb_order WITH PRED
template<class _InIt,
class _Pr> inline
void _Stlclrdb_order2(_InIt _First, _InIt _Last, _Pr _Pred,
const wchar_t *_File, unsigned int _Line, input_iterator_tag)
{ // test if range is ordered by predicate, input iterators
}
template<class _FwdIt,
class _Pr> inline
void _Stlclrdb_order2(_FwdIt _First, _FwdIt _Last, _Pr _Pred,
const wchar_t *_File, unsigned int _Line, forward_iterator_tag)
{ // test if range is ordered by predicate, forward iterators
for (_FwdIt _Next = _First; _First != _Last && ++_Next != _Last; ++_First)
if (_STLCLRDB_LT_PRED(_Pred, *_Next, *_First))
_STLCLRDB_REPORT(L"sequence not ordered", _File, _Line);
}
template<class _InIt,
class _Pr> inline
void _Stlclrdb_order(_InIt _First, _InIt _Last, _Pr _Pred,
const wchar_t *_File, unsigned int _Line)
{ // test if range is ordered by predicate
_STLCLRDB_RANGE2(_First, _Last, _File, _Line);
_STLCLRDB_POINTER2(_Pred, _File, _Line);
_Stlclrdb_order2(_First, _Last, _Pred, _File, _Line,
_Iter_category(_First));
}
} // namespace cliext
#else /* _HAS_ITERATOR_DEBUGGING */
#define _STLCLRDB_LT(left, right) ((left) < (right))
#define _STLCLRDB_LT_PRED(pred, left, right) ((pred)(left, right))
#define _STLCLRDB_POINTER(first)
#define _STLCLRDB_ORDER(first, last)
#define _STLCLRDB_ORDER_PRED(first, last, pred)
#define _STLCLRDB_RANGE(first, last)
#endif /* _HAS_ITERATOR_DEBUGGING */
#endif /* _M_CEE_SAFE */
namespace cliext {
//
// UN/MANAGED TEMP BUFFER SELECTOR
//
template<typename _Value_t>
value class _Temp_gc_iterator;
template<typename _Value_t>
class _Temp_iterator;
#ifdef _M_CEE_SAFE
#define _TEMP_ITER(iter_t, value_t) _Temp_gc_iterator<value_t>
#else /* _M_CEE_SAFE */
#define _TEMP_ITER(iter_t, value_t) typename cliext::_Pick_tbuf< \
__is_value_class(iter_t) || __is_ref_class(iter_t), value_t>::value_type
template<bool _Is_managed,
typename _Value_t>
class _Pick_tbuf; // select managed or unmanaged type
template<typename _Value_t>
class _Pick_tbuf<false, _Value_t>
{ // define unmanaged type
public:
typedef cliext::_Temp_iterator<_Value_t> value_type;
};
template<typename _Value_t>
class _Pick_tbuf<true, _Value_t>
{ // define managed type
public:
typedef cliext::_Temp_gc_iterator<_Value_t> value_type;
};
// TEMPLATE FUNCTION get_temporary_buffer
template<class _Ty> inline
pair<_Ty *, std::ptrdiff_t>
get_temporary_buffer(std::ptrdiff_t _Count)
{ // get raw temporary buffer of up to _Count elements
_Ty *_Pbuf;
if (_Count < 0)
_Count = 0;
for (_Pbuf = 0; 0 < _Count; _Count /= 2)
try
{ // try to allocate storage
_Pbuf = (_Ty *)::operator new(_Count * sizeof (_Ty));
break;
}
catch (...)
{ // loop if new fails
}
return (pair<_Ty *, std::ptrdiff_t>(_Pbuf, _Count));
}
// TEMPLATE FUNCTION return_temporary_buffer
template<class _Ty> inline
void return_temporary_buffer(_Ty *_Pbuf)
{ // delete raw temporary buffer
::operator delete(_Pbuf);
}
// TEMPLATE CLASS _Temp_iterator
template<class _Ty>
class _Temp_iterator
{ // wrap stores to unmanaged temporary buffer as output iterator
public:
typedef _Temp_iterator<_Ty> _Mytype_t;
typedef _Ty *_Pty;
typedef output_iterator_tag iterator_category;
_Temp_iterator(std::ptrdiff_t _Count = 0)
{ // construct from desired temporary buffer size
_Buf._Begin = 0;
_Buf._Current = 0;
_Buf._Hiwater = 0;
_Buf._Size = _Count; // memorize size for lazy allocation
_Pbuf = &_Buf;
}
_Temp_iterator(const _Temp_iterator& _Right)
{ // construct from _Right (share active buffer)
_Buf._Begin = 0; // clear stored buffer, for safe destruction
_Buf._Current = 0;
_Buf._Hiwater = 0;
_Buf._Size = 0;
*this = _Right;
}
~_Temp_iterator()
{ // destroy the object
if (_Buf._Begin != 0)
{ // destroy any constructed elements in buffer
for (_Pty _Next = _Buf._Begin;
_Next != _Buf._Hiwater; ++_Next)
_Next->~_Ty();
return_temporary_buffer(_Buf._Begin);
}
}
_Temp_iterator& operator=(const _Temp_iterator& _Right)
{ // assign _Right (share active buffer)
_Pbuf = _Right._Pbuf;
return (*this);
}
_Temp_iterator& operator=(_Ty& _Val)
{ // assign or construct value into active buffer, and increment
if (_Pbuf->_Current < _Pbuf->_Hiwater)
*_Pbuf->_Current++ = _Val; // below high water mark, assign
else
{ // above high water mark, construct
_Pty _Ptr = &*_Pbuf->_Current;
::new (_Ptr) _Ty(_Val);
_Pbuf->_Hiwater = ++_Pbuf->_Current;
}
return (*this);
}
_Temp_iterator& operator*()
{ // pretend to return designated value
return (*this);
}
_Temp_iterator& operator++()
{ // pretend to preincrement
return (*this);
}
_Temp_iterator& operator++(int)
{ // pretend to postincrement
return (*this);
}
_Temp_iterator& _Init()
{ // set pointer at beginning of buffer
_Pbuf->_Current = _Pbuf->_Begin;
return (*this);
}
_Pty _First() const
{ // return pointer to beginning of buffer
return (_Pbuf->_Begin);
}
_Pty _Last() const
{ // return pointer past end of buffer contents
return (_Pbuf->_Current);
}
std::ptrdiff_t _Maxlen()
{ // return size of buffer
if (_Pbuf->_Begin == 0 && 0 < _Pbuf->_Size)
{ // allocate buffer on first size query
pair<_Pty, std::ptrdiff_t> _Pair =
get_temporary_buffer<_Ty>(_Pbuf->_Size);
_Pbuf->_Begin = _Pair.first;
_Pbuf->_Current = _Pair.first;
_Pbuf->_Hiwater = _Pair.first;
_Pbuf->_Size = _Pair.second;
}
return (_Pbuf->_Size);
}
//_STLCLR_FIELD_ACCESS:
struct _Bufpar
{ // control information for a temporary buffer
_Pty _Begin; // pointer to beginning of buffer
_Pty _Current; // pointer to next available element
_Pty _Hiwater; // pointer to first unconstructed element
std::ptrdiff_t _Size; // length of buffer
};
_Bufpar _Buf; // buffer control stored in iterator
_Bufpar *_Pbuf; // pointer to active buffer control
};
#endif /* _M_CEE_SAFE */
// TEMPLATE CLASS _Temp_gc_iterator
template<class _Ty>
value class _Temp_gc_iterator
{ // wrap stores to managed temporary buffer as output iterator
public:
typedef _Temp_gc_iterator<_Ty> _Mytype_t;
typedef cli::array<_Ty> _Myarray_t;
typedef ArrayContainer<_Ty> _Mycont_t;
typedef typename _Mycont_t::iterator iterator;
_Temp_gc_iterator(int _Count)
: _Mysize(_Count), _Mycont(nullptr), _Next(nullptr)
{ // construct from desired temporary buffer size
}
static _Ty% operator*(_Temp_gc_iterator% _Left)
{ // return designated value
return (_Left._Next->get_ref());
}
_Temp_gc_iterator operator++()
{ // preincrement
_Next->next();
return (*this);
}
iterator operator++(int)
{ // postincrement
iterator _Temp = *_Next;
_Next->next();
return (_Temp);
}
_Temp_gc_iterator _Init()
{ // set pointer at beginning of buffer
*_Next = _Mycont->begin();
return (*this);
}
iterator _First()
{ // return pointer to beginning of buffer
return (_Mycont->begin());
}
iterator _Last()
{ // return pointer past end of buffer contents
return (*_Next);
}
int _Maxlen()
{ // return size of buffer
if (_Mycont == nullptr)
{ // allocate buffer and iterator on first size query
_Mycont = gcnew _Mycont_t(_Mysize);
_Next = gcnew iterator;
}
return (_Mycont->size());
}
_STLCLR_FIELD_ACCESS:
int _Mysize; // size of desired buffer
_Mycont_t^ _Mycont; // handle for buffer
iterator^ _Next; // iterator into buffer
};
// ALGORITHM STUFF (from <algorithm>)
// TEMPLATE FUNCTION swap
template<class _Ty> inline
void swap(_Ty% _Left, _Ty% _Right)
{ // exchange values stored at _Left and _Right
_Ty _Tmp = _Left;
_Left = _Right, _Right = _Tmp;
}
// TEMPLATE FUNCTION copy
template<class _InIt,
class _OutIt> inline
_OutIt copy_unchecked(_InIt _First, _InIt _Last, _OutIt _Dest)
{ // copy [_First, _Last) to [_Dest, ...)
for (; _First != _Last; ++_Dest, ++_First)
*_Dest = *_First;
return (_Dest);
}
template<class _InIt,
class _OutIt> inline
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
{ // copy [_First, _Last) to [_Dest, ...)
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First, _Last);
if (_First != _Last)
_STLCLRDB_POINTER(_Dest);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (cliext::copy_unchecked(
_Unchecked(_First), _Unchecked(_Last),
_Unchecked(_Dest)));
}
// TEMPLATE FUNCTION copy_backward
template<class _BidIt1,
class _BidIt2> inline
_BidIt2 copy_backward_unchecked(_BidIt1 _First, _BidIt1 _Last,
_BidIt2 _Dest)
{ // copy [_First, _Last) backwards to [..., _Dest)
while (_First != _Last)
*--_Dest = *--_Last;
return (_Dest);
}
template<class _BidIt1,
class _BidIt2> inline
_BidIt2 copy_backward(_BidIt1 _First, _BidIt1 _Last, _BidIt2 _Dest)
{ // copy [_First, _Last) backwards to [..., _Dest)
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First, _Last);
if (_First != _Last)
_STLCLRDB_POINTER(_Dest);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (cliext::copy_backward_unchecked(
_Unchecked(_First), _Unchecked(_Last),
_Unchecked(_Dest)));
}
// TEMPLATE FUNCTION mismatch
template<class _InIt1,
class _InIt2> inline
_PAIR_TYPE2(_InIt1, _InIt2)
mismatch_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2)
{ // return [_First1, _Last1) and [_First2, _Last2) mismatch
for (; _First1 != _Last1 && *_First1 == *_First2; )
++_First1, ++_First2;
return (_PAIR_TYPE2(_InIt1, _InIt2)(_First1, _First2));
}
template<class _InIt1,
class _InIt2> inline
_PAIR_TYPE2(_InIt1, _InIt2)
mismatch(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2)
{ // return [_First1, _Last1) and [_First2, _Last2) mismatch
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First1, _Last1);
if (_First1 != _Last1)
_STLCLRDB_POINTER(_First2);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (cliext::mismatch_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2)));
}
// TEMPLATE FUNCTION mismatch WITH PRED
template<class _InIt1,
class _InIt2,
class _Pr> inline
_PAIR_TYPE2(_InIt1, _InIt2)
mismatch_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Pr _Pred)
{ // return [_First1, _Last1) and [_First2, _Last2) mismatch using _Pred
for (; _First1 != _Last1 && _Pred(*_First1, *_First2); )
++_First1, ++_First2;
return (_PAIR_TYPE2(_InIt1, _InIt2)(_First1, _First2));
}
template<class _InIt1,
class _InIt2,
class _Pr> inline
_PAIR_TYPE2(_InIt1, _InIt2)
mismatch(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Pr _Pred)
{ // return [_First1, _Last1) and [_First2, _Last2) mismatch using _Pred
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First1, _Last1);
if (_First1 != _Last1)
_STLCLRDB_POINTER(_First2);
_STLCLRDB_POINTER(_Pred);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (cliext::mismatch_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2), _Pred));
}
// TEMPLATE FUNCTION equal
template<class _InIt1,
class _InIt2> inline
bool equal_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2)
{ // compare [_First1, _Last1) to [First2, ...)
for (; _First1 != _Last1; ++_First1, ++_First2)
if (!(*_First1 == *_First2))
return (false);
return (true);
}
template<class _InIt1,
class _InIt2> inline
bool equal(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2)
{ // compare [_First1, _Last1) to [First2, ...)
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First1, _Last1);
if (_First1 != _Last1)
_STLCLRDB_POINTER(_First2);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (cliext::equal_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2)));
}
#ifdef _M_CEE_SAFE
#else /* _M_CEE_SAFE */
inline bool equal(const char *_First1, const char *_Last1,
const char *_First2)
{ // compare [_First1, _Last1) to [First2, ...), for chars
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First1, _Last1);
if (_First1 != _Last1)
_STLCLRDB_POINTER(_First2);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (std::memcmp(_First1, _First2, _Last1 - _First1) == 0);
}
inline bool equal(const signed char *_First1, const signed char *_Last1,
const signed char *_First2)
{ // compare [_First1, _Last1) to [First2, ...), for signed chars
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First1, _Last1);
if (_First1 != _Last1)
_STLCLRDB_POINTER(_First2);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (std::memcmp(_First1, _First2, _Last1 - _First1) == 0);
}
inline bool equal(const unsigned char *_First1, const unsigned char *_Last1,
const unsigned char *_First2)
{ // compare [_First1, _Last1) to [First2, ...), for unsigned chars
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First1, _Last1);
if (_First1 != _Last1)
_STLCLRDB_POINTER(_First2);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (std::memcmp(_First1, _First2, _Last1 - _First1) == 0);
}
#endif /* _M_CEE_SAFE */
// TEMPLATE FUNCTION equal WITH PRED
template<class _InIt1,
class _InIt2,
class _Pr> inline
bool equal_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Pr _Pred)
{ // compare [_First1, _Last1) to [First2, ...) using _Pred
for (; _First1 != _Last1; ++_First1, ++_First2)
if (!_Pred(*_First1, *_First2))
return (false);
return (true);
}
template<class _InIt1,
class _InIt2,
class _Pr> inline
bool equal(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Pr _Pred)
{ // compare [_First1, _Last1) to [First2, ...) using _Pred
#if _HAS_ITERATOR_DEBUGGING
_STLCLRDB_RANGE(_First1, _Last1);
if (_First1 != _Last1)
_STLCLRDB_POINTER(_First2);
_STLCLRDB_POINTER(_Pred);
#endif /* _HAS_ITERATOR_DEBUGGING */
return (cliext::equal_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2), _Pred));
}
// TEMPLATE FUNCTION fill
template<class _FwdIt,
class _Ty> inline
void fill_unchecked(_FwdIt _First, _FwdIt _Last, const _Ty% _Val)
{ // copy _Val through [_First, _Last)
for (; _First != _Last; ++_First)
*_First = _Val;
}
#ifdef _M_CEE_SAFE
#else /* _M_CEE_SAFE */
inline void fill_unchecked(
_Out_writes_all_(_Last - _First) char *_First,
_In_opt_ char *_Last,
int _Val)
{ // copy char _Val through [_First, _Last)
std::memset(_First, _Val, _Last - _First);
}
inline void fill_unchecked(
_Out_writes_all_(_Last - _First) signed char *_First,
_In_opt_ signed char *_Last,
int _Val)
{ // copy signed char _Val through [_First, _Last)
std::memset(_First, _Val, _Last - _First);
}
inline void fill_unchecked(
_Out_writes_all_(_Last - _First) unsigned char *_First,
_In_opt_ unsigned char *_Last,
int _Val)
{ // copy unsigned char _Val through [_First, _Last)
std::memset(_First, _Val, _Last - _First);
}
#endif /* _M_CEE_SAFE */
template<class _FwdIt,
class _Ty> inline
void fill(_FwdIt _First, _FwdIt _Last, const _Ty% _Val)
{ // copy _Val through [_First, _Last)
_STLCLRDB_RANGE(_First, _Last);
cliext::fill_unchecked(_Unchecked(_First), _Unchecked(_Last), _Val);
}
// TEMPLATE FUNCTION fill_n
template<class _OutIt,
class _Diff,
class _Ty> inline
void fill_n_unchecked(_OutIt _First, _Diff _Count, const _Ty% _Val)
{ // copy _Val _Count times through [_First, ...)
for (; 0 < _Count; --_Count, ++_First)
*_First = _Val;
}
#ifdef _M_CEE_SAFE
#else /* _M_CEE_SAFE */
inline void fill_n_unchecked(
_Out_writes_all_(_Count) char *_First,
size_t _Count,
int _Val)
{ // copy char _Val _Count times through [_First, ...)
std::memset(_First, _Val, _Count);
}
inline void fill_n_unchecked(
_Out_writes_all_(_Count) signed char *_First,
size_t _Count,
int _Val)
{ // copy signed char _Val _Count times through [_First, ...)
std::memset(_First, _Val, _Count);
}
inline void fill_n_unchecked(
_Out_writes_all_(_Count) unsigned char *_First,
size_t _Count,
int _Val)
{ // copy unsigned char _Val _Count times through [_First, ...)
std::memset(_First, _Val, _Count);
}
#endif /* _M_CEE_SAFE */
template<class _OutIt,
class _Diff,
class _Ty> inline
void fill_n(_OutIt _First, _Diff _Count, const _Ty% _Val)
{ // copy _Val _Count times through [_First, ...)
#if _HAS_ITERATOR_DEBUGGING
if (0 < _Count)
_STLCLRDB_POINTER(_First);
#endif /* _HAS_ITERATOR_DEBUGGING */
cliext::fill_n_unchecked(_Unchecked(_First), _Count, _Val);
}
// TEMPLATE FUNCTION lexicographical_compare
template<class _InIt1,
class _InIt2> inline
bool lexicographical_compare_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _InIt2 _Last2)
{ // order [_First1, _Last1) vs. [First2, Last2)
for (; _First1 != _Last1 && _First2 != _Last2; ++_First1, ++_First2)
if (_STLCLRDB_LT(*_First1, *_First2))
return (true);
else if (*_First2 < *_First1)
return (false);
return (_First1 == _Last1 && _First2 != _Last2);
}
#ifdef _M_CEE_SAFE
#else /* _M_CEE_SAFE */
inline bool lexicographical_compare_unchecked(
const unsigned char *_First1, const unsigned char *_Last1,
const unsigned char *_First2, const unsigned char *_Last2)
{ // order [_First1, _Last1) vs. [First2, Last2), for unsigned char
std::ptrdiff_t _Num1 = _Last1 - _First1;
std::ptrdiff_t _Num2 = _Last2 - _First2;
int _Ans = std::memcmp(_First1, _First2, _Num1 < _Num2 ? _Num1 : _Num2);
return (_Ans < 0 || _Ans == 0 && _Num1 < _Num2);
}
#if CHAR_MAX == UCHAR_MAX
inline bool lexicographical_compare_unchecked(
const char *_First1, const char *_Last1,
const char *_First2, const char *_Last2)
{ // order [_First1, _Last1) vs. [First2, Last2), for nonnegative char
std::ptrdiff_t _Num1 = _Last1 - _First1;
std::ptrdiff_t _Num2 = _Last2 - _First2;
int _Ans = std::memcmp(_First1, _First2, _Num1 < _Num2 ? _Num1 : _Num2);
return (_Ans < 0 || _Ans == 0 && _Num1 < _Num2);
}
#endif /* CHAR_MAX == UCHAR_MAX */
#endif /* _M_CEE_SAFE */
template<class _InIt1,
class _InIt2> inline
bool lexicographical_compare(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _InIt2 _Last2)
{ // order [_First1, _Last1) vs. [First2, Last2)
_STLCLRDB_RANGE(_First1, _Last1);
_STLCLRDB_RANGE(_First2, _Last2);
return (cliext::lexicographical_compare_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2), _Unchecked(_Last2)));
}
// TEMPLATE FUNCTION lexicographical_compare WITH PRED
template<class _InIt1,
class _InIt2,
class _Pr> inline
bool lexicographical_compare_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _InIt2 _Last2, _Pr _Pred)
{ // order [_First1, _Last1) vs. [First2, Last2) using _Pred
for (; _First1 != _Last1 && _First2 != _Last2; ++_First1, ++_First2)
if (_STLCLRDB_LT_PRED(_Pred, *_First1, *_First2))
return (true);
else if (_Pred(*_First2, *_First1))
return (false);
return (_First1 == _Last1 && _First2 != _Last2);
}
template<class _InIt1,
class _InIt2,
class _Pr> inline
bool lexicographical_compare(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _InIt2 _Last2, _Pr _Pred)
{ // order [_First1, _Last1) vs. [First2, Last2) using _Pred
_STLCLRDB_RANGE(_First1, _Last1);
_STLCLRDB_RANGE(_First2, _Last2);
_STLCLRDB_POINTER(_Pred);
return (cliext::lexicographical_compare_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2), _Unchecked(_Last2), _Pred));
}
// TEMPLATE FUNCTION max
template<class _Ty> inline
const _Ty (max)(const _Ty% _Left, const _Ty% _Right)
{ // return larger of _Left and _Right
return (_STLCLRDB_LT(_Left, _Right) ? _Right : _Left);
}
// TEMPLATE FUNCTION max WITH PRED
template<class _Ty,
class _Pr> inline
const _Ty (max)(const _Ty% _Left, const _Ty% _Right, _Pr _Pred)
{ // return larger of _Left and _Right using _Pred
return (_STLCLRDB_LT_PRED(_Pred, _Left, _Right) ? _Right : _Left);
}
// TEMPLATE FUNCTION min
template<class _Ty> inline
const _Ty (min)(const _Ty% _Left, const _Ty% _Right)
{ // return smaller of _Left and _Right
return (_STLCLRDB_LT(_Right, _Left) ? _Right : _Left);
}
// TEMPLATE FUNCTION min WITH PRED
template<class _Ty,
class _Pr> inline
const _Ty (min)(const _Ty% _Left, const _Ty% _Right, _Pr _Pred)
{ // return smaller of _Left and _Right using _Pred
return (_STLCLRDB_LT_PRED(_Pred, _Right, _Left) ? _Right : _Left);
}
} // namespace cliext
#endif /* _CLI_MEMORY_ */
@@ -0,0 +1,251 @@
// numeric stl/clr header
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _CLI_NUMERIC_
#define _CLI_NUMERIC_
#include <cliext/memory>
namespace cliext {
// TEMPLATE FUNCTION accumulate
template<class _InIt,
class _Ty> inline
_Ty accumulate_unchecked(_InIt _First, _InIt _Last, _Ty _Val)
{ // return sum of _Val and all in [_First, _Last)
for (; _First != _Last; ++_First)
_Val = _Val + *_First;
return (_Val);
}
template<class _InIt,
class _Ty> inline
_Ty accumulate(_InIt _First, _InIt _Last, _Ty _Val)
{ // return sum of _Val and all in [_First, _Last)
_STLCLRDB_RANGE(_First, _Last);
return (cliext::accumulate_unchecked(
_Unchecked(_First), _Unchecked(_Last), _Val));
}
// TEMPLATE FUNCTION accumulate WITH BINOP
template<class _InIt,
class _Ty,
class _Fn2> inline
_Ty accumulate_unchecked(_InIt _First, _InIt _Last,
_Ty _Val, _Fn2 _Func)
{ // return sum of _Val and all in [_First, _Last), using _Func
for (; _First != _Last; ++_First)
_Val = _Func(_Val, *_First);
return (_Val);
}
template<class _InIt,
class _Ty,
class _Fn2> inline
_Ty accumulate(_InIt _First, _InIt _Last,
_Ty _Val, _Fn2 _Func)
{ // return sum of _Val and all in [_First, _Last), using _Func
_STLCLRDB_RANGE(_First, _Last);
_STLCLRDB_POINTER(_Func);
return (cliext::accumulate_unchecked(
_Unchecked(_First), _Unchecked(_Last), _Val, _Func));
}
// TEMPLATE FUNCTION inner_product
template<class _InIt1,
class _InIt2,
class _Ty> inline
_Ty inner_product_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Ty _Val)
{ // return inner product of sequences
for (; _First1 != _Last1; ++_First1, ++_First2)
_Val = _Val + *_First1 * *_First2;
return (_Val);
}
template<class _InIt1,
class _InIt2,
class _Ty> inline
_Ty inner_product(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Ty _Val)
{ // return inner product of sequences
_STLCLRDB_RANGE(_First1, _Last1);
_STLCLRDB_POINTER(_First2);
return (cliext::inner_product_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2), _Val));
}
// TEMPLATE FUNCTION inner_product WITH BINOPS
template<class _InIt1,
class _InIt2,
class _Ty,
class _Fn21,
class _Fn22> inline
_Ty inner_product_unchecked(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Ty _Val, _Fn21 _Func1, _Fn22 _Func2)
{ // return inner product of sequences, using _Func1 and _Func2
for (; _First1 != _Last1; ++_First1, ++_First2)
_Val = _Func1(_Val, _Func2(*_First1, *_First2));
return (_Val);
}
template<class _InIt1,
class _InIt2,
class _Ty,
class _Fn21,
class _Fn22> inline
_Ty inner_product(_InIt1 _First1, _InIt1 _Last1,
_InIt2 _First2, _Ty _Val, _Fn21 _Func1, _Fn22 _Func2)
{ // return inner product of sequences, using _Func1 and _Func2
_STLCLRDB_RANGE(_First1, _Last1);
_STLCLRDB_POINTER(_First2);
_STLCLRDB_POINTER(_Func1);
_STLCLRDB_POINTER(_Func2);
return (cliext::inner_product_unchecked(
_Unchecked(_First1), _Unchecked(_Last1),
_Unchecked(_First2), _Val, _Func1, _Func2));
}
// TEMPLATE FUNCTION partial_sum
template<class _InIt,
class _OutIt> inline
_OutIt partial_sum_unchecked(_InIt _First, _InIt _Last,
_OutIt _Dest)
{ // compute partial sums into _Dest
typedef typename iterator_traits<_InIt>::value_type _Ty;
if (_First == _Last)
return (_Dest);
else
{ // compute nontrivial sum
_Ty _Val = *_First;
for (*_Dest = _Val; ++_First != _Last; *++_Dest = _Val)
_Val = _Val + *_First;
return (++_Dest);
}
}
template<class _InIt,
class _OutIt> inline
_OutIt partial_sum(_InIt _First, _InIt _Last,
_OutIt _Dest)
{ // compute partial sums into _Dest
_STLCLRDB_RANGE(_First, _Last);
_STLCLRDB_POINTER(_Dest);
return (cliext::partial_sum_unchecked(
_Unchecked(_First), _Unchecked(_Last),
_Unchecked(_Dest)));
}
// TEMPLATE FUNCTION partial_sum WITH BINOP
template<class _InIt,
class _OutIt,
class _Fn2> inline
_OutIt partial_sum_unchecked(_InIt _First, _InIt _Last,
_OutIt _Dest, _Fn2 _Func)
{ // compute partial sums into _Dest, using _Func
typedef typename iterator_traits<_InIt>::value_type _Ty;
if (_First == _Last)
return (_Dest);
else
{ // compute nontrivial sum
_Ty _Val = *_First;
for (*_Dest = _Val; ++_First != _Last; *++_Dest = _Val)
_Val = _Func(_Val, *_First);
return (++_Dest);
}
}
template<class _InIt,
class _OutIt,
class _Fn2> inline
_OutIt partial_sum(_InIt _First, _InIt _Last,
_OutIt _Dest, _Fn2 _Func)
{ // compute partial sums into _Dest, using _Func
_STLCLRDB_RANGE(_First, _Last);
_STLCLRDB_POINTER(_Dest);
_STLCLRDB_POINTER(_Func);
return (cliext::partial_sum_unchecked(
_Unchecked(_First), _Unchecked(_Last),
_Unchecked(_Dest), _Func));
}
// TEMPLATE FUNCTION adjacent_difference
template<class _InIt,
class _OutIt> inline
_OutIt adjacent_difference_unchecked(_InIt _First, _InIt _Last,
_OutIt _Dest)
{ // compute adjacent differences into _Dest
typedef typename iterator_traits<_InIt>::value_type _Ty;
if (_First == _Last)
return (_Dest);
else
{ // compute nontrivial difference
_Ty _Val = *_First;
for (*_Dest = _Val; ++_First != _Last; )
{ // compute another difference
_Ty _Tmp = *_First;
*++_Dest = _Tmp - _Val;
_Val = _Tmp;
}
return (++_Dest);
}
}
template<class _InIt,
class _OutIt> inline
_OutIt adjacent_difference(_InIt _First, _InIt _Last,
_OutIt _Dest)
{ // compute adjacent differences into _Dest
_STLCLRDB_RANGE(_First, _Last);
_STLCLRDB_POINTER(_Dest);
return (cliext::adjacent_difference_unchecked(
_Unchecked(_First), _Unchecked(_Last),
_Unchecked(_Dest)));
}
// TEMPLATE FUNCTION adjacent_difference WITH BINOP
template<class _InIt,
class _OutIt,
class _Fn2> inline
_OutIt adjacent_difference_unchecked(_InIt _First, _InIt _Last,
_OutIt _Dest, _Fn2 _Func)
{ // compute adjacent differences into _Dest, using _Func
typedef typename iterator_traits<_InIt>::value_type _Ty;
if (_First == _Last)
return (_Dest);
else
{ // compute nontrivial difference
_Ty _Val = *_First;
for (*_Dest = _Val; ++_First != _Last; )
{ // compute another difference
_Ty _Tmp = *_First;
*++_Dest = _Func(_Tmp, _Val);
_Val = _Tmp;
}
return (++_Dest);
}
}
template<class _InIt,
class _OutIt,
class _Fn2> inline
_OutIt adjacent_difference(_InIt _First, _InIt _Last,
_OutIt _Dest, _Fn2 _Func)
{ // compute adjacent differences into _Dest, using _Func
_STLCLRDB_RANGE(_First, _Last);
_STLCLRDB_POINTER(_Dest);
_STLCLRDB_POINTER(_Func);
return (cliext::adjacent_difference_unchecked(
_Unchecked(_First), _Unchecked(_Last),
_Unchecked(_Dest), _Func));
}
} // namespace cliext
#endif /* _CLI_NUMERIC_ */
@@ -0,0 +1,857 @@
// queue stl/clr header
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _CLI_QUEUE_
#define _CLI_QUEUE_
#include <cliext/algorithm> // for push/pop heap
#include <cliext/deque> // for default queue container
#include <cliext/functional> // for BinaryDelegate
#include <cliext/iterator>
#include <cliext/vector> // for default priority_queue container
namespace cliext {
namespace impl {
//
// TEMPLATE CLASS queue_base
//
template<typename _Value_t,
typename _Cont_t>
ref class queue_base
: public _STLCLR IQueue<_Value_t,
typename _Container_traits<_Cont_t>::generic_container_handle>
{ // FIFO queue of elements
public:
// types
typedef queue_base<_Value_t, _Cont_t> _Mytype_t;
typedef _STLCLR IQueue<_Value_t,
typename _Container_traits<_Cont_t>::generic_container_handle>
_Mycont_it;
typedef cli::array<_Value_t> _Myarray_t;
typedef int size_type;
typedef int difference_type;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
typedef _Mycont_it generic_container;
typedef value_type generic_value;
typedef typename _Dehandle<_Cont_t>::type container_type;
// basics
queue_base()
: c(gcnew container_type)
{ // default constructor
}
queue_base% operator=(queue_base% _Right)
{ // assign
assign(_Right);
return (*this);
}
operator _Mycont_it^()
{ // convert to interface
return (this);
}
// constructors
explicit queue_base(container_type% _Cont)
: c(gcnew container_type(_Cont))
{ // construct from container
}
// destructor
~queue_base()
{ // destroy the object
delete c;
}
// accessors
property value_type front_item
{ // get or set front element
value_type get()
{ // get first element
return (front());
}
void set(value_type _Val)
{ // set first element
front() = _Val;
}
};
property value_type back_item
{ // get or set back element
value_type get()
{ // get last element
return (back());
}
void set(value_type _Val)
{ // set last element
back() = _Val;
}
};
virtual reference front()
{ // get oldest element
return (((typename container_type::generic_container^)c)->front());
}
virtual reference back()
{ // get newest element
return (((typename container_type::generic_container^)c)->back());
}
virtual container_type^ get_container()
{ // return container
return (c);
}
// converters
virtual System::Object^ Clone()
{ // clone the queue
return (gcnew queue_base(*c));
}
_Myarray_t^ to_array()
{ // convert to array
return (c->to_array());
}
// size controllers
virtual size_type size()
{ // return length of sequence
return (c->size());
}
virtual bool empty()
{ // test if sequence is empty
return (size() == 0);
}
// mutators
virtual void push(value_type _Val)
{ // insert element at back end
c->push_back(_Val);
}
virtual void pop()
{ // erase element at front end
c->pop_front();
}
virtual void assign(_Mytype_t% _Right)
{ // assign
*c = *_Right.get_container();
}
_STLCLR_FIELD_ACCESS:
// data members
container_type^ c; // the underlying container
private:
virtual reference front_virtual() sealed
= _Mycont_it::front
{ // get oldest element
return (front());
}
virtual reference back_virtual() sealed
= _Mycont_it::back
{ // get newest element
return (back());
}
virtual typename _Container_traits<_Cont_t>::generic_container_handle
get_container_virtual() sealed
= _Mycont_it::get_container
{ // return container
return (get_container());
}
// size controllers
virtual size_type size_virtual() sealed
= _Mycont_it::size
{ // return length of sequence
return (size());
}
virtual bool empty_virtual() sealed
= _Mycont_it::empty
{ // test if sequence is empty
return (empty());
}
// mutators
virtual void push_virtual(value_type _Val) sealed
= _Mycont_it::push
{ // insert element at end
push(_Val);
}
virtual void pop_virtual() sealed
= _Mycont_it::pop
{ // erase element at end
pop();
}
virtual void assign_virtual(_Mycont_it^ _Right) sealed
= _Mycont_it::assign
{ // assign
assign(*(_Mytype_t^)_Right);
}
};
//
// TEMPLATE CLASS queue_select
//
template<typename _Value_t,
typename _Cont_t,
bool _Is_ref>
ref class queue_select
: public queue_base<_Value_t, _Cont_t^>
{ // FIFO queue of elements
public:
// types
typedef queue_select<_Value_t, _Cont_t, _Is_ref> _Mytype_t;
typedef queue_base<_Value_t, _Cont_t^> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
// basics
queue_select()
{ // construct with empty container
}
queue_select% operator=(queue_select% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
// constructors
explicit queue_select(container_type% _Cont)
: _Mybase_t(_Cont)
{ // construct with specified container
}
};
//
// TEMPLATE CLASS queue_select: _Value_t REF SPECIALIZATION
//
template<typename _Value_t,
typename _Cont_t>
ref class queue_select<_Value_t, _Cont_t, true>
: public queue_base<_Value_t^, _Cont_t^>
{ // FIFO queue of elements
public:
// types
typedef queue_select<_Value_t, _Cont_t, true> _Mytype_t;
typedef queue_base<_Value_t^, _Cont_t^> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
// basics
queue_select()
{ // construct with empty container
}
queue_select% operator=(queue_select% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
// constructors
explicit queue_select(container_type% _Cont)
: _Mybase_t(_Cont)
{ // construct with specified container
}
// accessors
property value_type front_item
{ // get or set front element
value_type get()
{ // get last element
return (front());
}
void set(value_type _Val)
{ // set last element
front() = _Val;
}
};
property value_type back_item
{ // get or set back element
value_type get()
{ // get last element
return (back());
}
void set(value_type _Val)
{ // set last element
back() = _Val;
}
};
virtual reference front() new
{ // get top element
return (this->c->front());
}
virtual reference back() new
{ // get top element
return (this->c->back());
}
// mutators
void push(value_type _Val)
{ // insert element at end
this->c->push_back(_Val);
}
};
} // namespace cliext::impl
//
// TEMPLATE CLASS queue
//
template<typename _Value_t,
typename _Cont_t = cliext::deque<_Value_t>^>
ref class queue
: public impl::queue_select<
_Value_t,
typename _Dehandle<_Cont_t>::type,
__is_ref_class(typename _Dehandle<_Value_t>::type)
&& !is_handle<_Value_t>::value>
{ // FIFO queue of elements
public:
// types
typedef queue<_Value_t, _Cont_t> _Mytype_t;
typedef impl::queue_select<
_Value_t,
typename _Dehandle<_Cont_t>::type,
__is_ref_class(typename _Dehandle<_Value_t>::type)
&& !is_handle<_Value_t>::value> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
// basics
queue()
{ // construct with empty container
}
queue(queue% _Right)
: _Mybase_t(*_Right.get_container())
{ // construct by copying a queue
}
queue(queue^ _Right)
: _Mybase_t(*_Right->get_container())
{ // construct by copying a queue
}
queue% operator=(queue% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
queue% operator=(queue^ _Right)
{ // assign
_Mybase_t::operator=(*_Right);
return (*this);
}
// constructors
explicit queue(container_type% _Cont)
: _Mybase_t(_Cont)
{ // construct with specified container
}
// interfaces
virtual System::Object^ Clone() override
{ // clone the vector
return (gcnew _Mytype_t(*this));
}
};
//
// TEMPLATE COMPARISONS
//
template<typename _Value_t,
typename _Cont_t> inline
bool operator==(queue<_Value_t, _Cont_t>% _Left,
queue<_Value_t, _Cont_t>% _Right)
{ // test if _Left == _Right
return (*_Left.get_container() == *_Right.get_container());
}
template<typename _Value_t,
typename _Cont_t> inline
bool operator!=(queue<_Value_t, _Cont_t>% _Left,
queue<_Value_t, _Cont_t>% _Right)
{ // test if _Left != _Right
return (!(_Left == _Right));
}
template<typename _Value_t,
typename _Cont_t> inline
bool operator<(queue<_Value_t, _Cont_t>% _Left,
queue<_Value_t, _Cont_t>% _Right)
{ // test if _Left < _Right
return (*_Left.get_container() < *_Right.get_container());
}
template<typename _Value_t,
typename _Cont_t> inline
bool operator>=(queue<_Value_t, _Cont_t>% _Left,
queue<_Value_t, _Cont_t>% _Right)
{ // test if _Left >= _Right
return (!(_Left < _Right));
}
template<typename _Value_t,
typename _Cont_t> inline
bool operator>(queue<_Value_t, _Cont_t>% _Left,
queue<_Value_t, _Cont_t>% _Right)
{ // test if _Left > _Right
return (_Right < _Left);
}
template<typename _Value_t,
typename _Cont_t> inline
bool operator<=(queue<_Value_t, _Cont_t>% _Left,
queue<_Value_t, _Cont_t>% _Right)
{ // test if _Left <= _Right
return (!(_Right < _Left));
}
//
// TEMPLATE FUNCTION _Queue_compare
//
template<typename _Key_t> inline
bool _Queue_compare(_Key_t _Left, _Key_t _Right)
{ // test if _Left < _Right
return (_Left < _Right);
}
inline bool _Queue_compare(System::String^ _Left, System::String^ _Right)
{ // test if _Left < _Right for String
return (_Left->CompareTo(_Right) < 0);
}
namespace impl {
//
// TEMPLATE CLASS priority_queue_base
//
template<typename _Value_t,
typename _Cont_t>
ref class priority_queue_base
: public _STLCLR IPriorityQueue<_Value_t,
typename _Container_traits<_Cont_t>::generic_container_handle>
{ // priority queue of elements
public:
// types
typedef priority_queue_base<_Value_t, _Cont_t> _Mytype_t;
typedef _STLCLR IPriorityQueue<_Value_t,
typename _Container_traits<_Cont_t>::generic_container_handle>
_Mycont_it;
typedef cli::array<_Value_t> _Myarray_t;
typedef int size_type;
typedef int difference_type;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
typedef _Mycont_it generic_container;
typedef value_type generic_value;
typedef typename _Dehandle<_Cont_t>::type container_type;
typedef _STLCLR BinaryDelegate<_Value_t, _Value_t, bool>
value_compare;
// basics
priority_queue_base()
: comp(gcnew value_compare(&_Queue_compare)),
c(gcnew container_type)
{ // default constructor
}
priority_queue_base% operator=(priority_queue_base% _Right)
{ // assign
assign(_Right);
return (*this);
}
operator _Mycont_it^()
{ // convert to interface
return (this);
}
// constructors
explicit priority_queue_base(value_compare^ _Pred)
: comp(_Pred),
c(gcnew container_type)
{ // construct with empty container, specified predicate
}
priority_queue_base(value_compare^ _Pred, container_type% _Cont)
: comp(_Pred),
c(gcnew container_type(_Cont))
{ // construct with specified predicate and container
}
// destructor
~priority_queue_base()
{ // destroy the object
delete c;
}
// accessors
property value_type top_item
{ // get or set top element
virtual value_type get()
{ // get highest priority element
return (top());
}
virtual void set(value_type _Val)
{ // set highest priority element ???
top() = _Val;
}
};
reference top()
{ // get highest priority element
return (((typename container_type::generic_container^)c)->front());
}
container_type^ get_container()
{ // return container
return (c);
}
value_compare^ value_comp()
{ // return object for comparing values
return (comp);
}
// converters
virtual System::Object^ Clone()
{ // clone the priority_queue
return (gcnew priority_queue_base(comp, *c));
}
_Myarray_t^ to_array()
{ // convert to array
return (c->to_array());
}
// size controllers
size_type size()
{ // return length of sequence
return (c->size());
}
bool empty()
{ // test if sequence is empty
return (size() == 0);
}
// mutators
void push(value_type _Val)
{ // insert element at back end
c->push_back(_Val);
cliext::push_heap(c->begin(), c->end(), comp);
}
void pop()
{ // erase element at front end
cliext::pop_heap(c->begin(), c->end(), comp);
c->pop_back();
}
void assign(_Mytype_t% _Right)
{ // assign
*c = *_Right.get_container();
}
_STLCLR_FIELD_ACCESS:
// data members
value_compare^ comp; // the comparator predicate for values, < or >
container_type^ c; // the underlying container
private:
virtual reference top_virtual() sealed
= _Mycont_it::top
{ // get top element
return (top());
}
virtual typename _Container_traits<_Cont_t>::generic_container_handle
get_container_virtual() sealed
= _Mycont_it::get_container
{ // return container
return (get_container());
}
virtual value_compare^ value_comp_virtual() sealed
= _Mycont_it::value_comp
{ // return object for comparing values
return (value_comp());
}
// size controllers
virtual size_type size_virtual() sealed
= _Mycont_it::size
{ // return length of sequence
return (size());
}
virtual bool empty_virtual() sealed
= _Mycont_it::empty
{ // test if sequence is empty
return (empty());
}
// mutators
virtual void push_virtual(value_type _Val) sealed
= _Mycont_it::push
{ // insert element at end
push(_Val);
}
virtual void pop_virtual() sealed
= _Mycont_it::pop
{ // erase element at end
pop();
}
virtual void assign_virtual(_Mycont_it^ _Right) sealed
= _Mycont_it::assign
{ // assign
assign(*(_Mytype_t^)_Right);
}
};
//
// TEMPLATE CLASS priority_queue_select
//
template<typename _Value_t,
typename _Cont_t,
bool _Is_ref>
ref class priority_queue_select
: public priority_queue_base<_Value_t, _Cont_t^>
{ // priority queue of elements
public:
// types
typedef priority_queue_select<_Value_t, _Cont_t, _Is_ref> _Mytype_t;
typedef priority_queue_base<_Value_t, _Cont_t^> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
typedef typename _Mybase_t::value_compare value_compare;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
// basics
priority_queue_select()
{ // construct with empty container
}
priority_queue_select% operator=(priority_queue_select% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
// constructors
priority_queue_select(value_compare^ _Pred)
: _Mybase_t(_Pred)
{ // construct with specified predicate
}
priority_queue_select(value_compare^ _Pred, container_type% _Cont)
: _Mybase_t(_Pred, _Cont)
{ // construct with specified predicate and container
}
};
//
// TEMPLATE CLASS priority_queue_select: _Value_t REF SPECIALIZATION
//
template<typename _Value_t,
typename _Cont_t>
ref class priority_queue_select<_Value_t, _Cont_t, true>
: public priority_queue_base<_Value_t^, _Cont_t^>
{ // priority queue of elements
public:
// types
typedef priority_queue_select<_Value_t, _Cont_t, true> _Mytype_t;
typedef priority_queue_base<_Value_t^, _Cont_t^> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
typedef typename _Mybase_t::value_compare value_compare;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
// basics
priority_queue_select()
{ // construct with empty container
}
priority_queue_select% operator=(priority_queue_select% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
// constructors
priority_queue_select(value_compare^ _Pred)
: _Mybase_t(_Pred)
{ // construct with specified predicate
}
priority_queue_select(value_compare^ _Pred, container_type% _Cont)
: _Mybase_t(_Pred, _Cont)
{ // construct with specified predicate and container
}
// accessors
property value_type top_item
{ // get or set top element
value_type get()
{ // get last element
return (top());
}
void set(value_type _Val)
{ // set last element
top() = _Val;
}
};
virtual reference top() new
{ // get top element
return (this->c->front());
}
// mutators
void push(value_type _Val)
{ // insert element at end
this->c->push_back(_Val);
cliext::push_heap(this->c->begin(), this->c->end(), this->comp);
}
};
} // namespace cliext::impl
//
// TEMPLATE CLASS priority_queue
//
template<typename _Value_t,
typename _Cont_t = cliext::vector<_Value_t> >
ref class priority_queue
: public impl::priority_queue_select<
_Value_t,
typename _Dehandle<_Cont_t>::type,
__is_ref_class(typename _Dehandle<_Value_t>::type)
&& !is_handle<_Value_t>::value>
{ // priority queue of elements
public:
// types
typedef priority_queue<_Value_t, _Cont_t> _Mytype_t;
typedef impl::priority_queue_select<
_Value_t,
typename _Dehandle<_Cont_t>::type,
__is_ref_class(typename _Dehandle<_Value_t>::type)
&& !is_handle<_Value_t>::value> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
typedef typename _Mybase_t::value_compare value_compare;
// basics
priority_queue()
{ // construct with empty container
}
priority_queue(priority_queue% _Right)
: _Mybase_t(_Right.value_comp(), *_Right.get_container())
{ // construct by copying a priority_queue
}
priority_queue(priority_queue^ _Right)
: _Mybase_t(_Right->value_comp(), *_Right->get_container())
{ // construct by copying a priority_queue
}
priority_queue% operator=(priority_queue% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
priority_queue% operator=(priority_queue^ _Right)
{ // assign
_Mybase_t::operator=(*_Right);
return (*this);
}
// constructors
explicit priority_queue(value_compare^ _Pred)
: _Mybase_t(_Pred)
{ // construct with empty container, specified predicate
}
priority_queue(value_compare^ _Pred, container_type% _Cont)
: _Mybase_t(_Pred, _Cont)
{ // construct with specified predicate and container
cliext::make_heap(this->c->begin(), this->c->end(), this->comp);
}
template<typename _Iter>
priority_queue(_Iter _First, _Iter _Last)
{ // construct by copying [_First, _Last), default comparator
this->c->insert(this->c->end(), _First, _Last);
cliext::make_heap(this->c->begin(), this->c->end(), this->comp);
}
template<typename _Iter>
priority_queue(_Iter _First, _Iter _Last, value_compare^ _Pred)
: _Mybase_t(_Pred)
{ // construct by copying [_First, _Last), specified comparator
this->c->insert(this->c->end(), _First, _Last);
cliext::make_heap(this->c->begin(), this->c->end(), this->comp);
}
template<typename _Iter>
priority_queue(_Iter _First, _Iter _Last, value_compare^ _Pred,
container_type% _Cont)
: _Mybase_t(_Pred, _Cont)
{ // construct by copying [_First, _Last), container, and comparator
this->c->insert(this->c->end(), _First, _Last);
cliext::make_heap(this->c->begin(), this->c->end(), this->comp);
}
// interfaces
virtual System::Object^ Clone() override
{ // clone the vector
return (gcnew _Mytype_t(*this));
}
};
} // namespace cliext
#endif // _CLI_QUEUE_
@@ -0,0 +1,395 @@
// stack stl/clr header
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _CLI_STACK_
#define _CLI_STACK_
#include <cliext/deque> // for default stack container
#include <cliext/iterator>
namespace cliext {
namespace impl {
//
// TEMPLATE CLASS stack_base
//
template<typename _Value_t,
typename _Cont_t>
ref class stack_base
: public _STLCLR IStack<_Value_t,
typename _Container_traits<_Cont_t>::generic_container_handle>
{ // LIFO queue of elements
public:
// types
typedef stack_base<_Value_t, _Cont_t> _Mytype_t;
typedef _STLCLR IStack<_Value_t,
typename _Container_traits<_Cont_t>::generic_container_handle> _Mycont_it;
typedef cli::array<_Value_t> _Myarray_t;
typedef int size_type;
typedef int difference_type;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
typedef _Mycont_it generic_container;
typedef value_type generic_value;
typedef typename _Dehandle<_Cont_t>::type container_type;
// basics
stack_base()
: c(gcnew container_type)
{ // default constructor
}
stack_base% operator=(stack_base% _Right)
{ // assign
assign(_Right);
return (*this);
}
operator _Mycont_it^()
{ // convert to interface
return (this);
}
// constructors
stack_base(container_type% _Cont)
: c(gcnew container_type(_Cont))
{ // construct from container
}
// destructor
~stack_base()
{ // destroy the object
delete c;
}
// accessors
property value_type top_item
{ // get or set top element
virtual value_type get()
{ // get last element
return (top());
}
virtual void set(value_type _Val)
{ // set last element
top() = _Val;
}
};
reference top()
{ // get top element
return (((typename container_type::generic_container^)c)->back());
}
container_type^ get_container()
{ // return container
return (c);
}
// converters
virtual System::Object^ Clone()
{ // clone the stack
return (gcnew stack_base(*c));
}
_Myarray_t^ to_array()
{ // convert to array
return (c->to_array());
}
// size controllers
size_type size()
{ // return length of sequence
return (c->size());
}
bool empty()
{ // test if sequence is empty
return (size() == 0);
}
// mutators
void push(value_type _Val)
{ // insert element at end
c->push_back(_Val);
}
void pop()
{ // erase element at end
c->pop_back();
}
void assign(_Mytype_t% _Right)
{ // assign
*c = _Right.get_container();
}
_STLCLR_FIELD_ACCESS:
// data members
container_type^ c; // the underlying container
private:
virtual reference top_virtual() sealed
= _Mycont_it::top
{ // get top element
return (top());
}
virtual typename _Container_traits<_Cont_t>::generic_container_handle
get_container_virtual() sealed
= _Mycont_it::get_container
{ // return container
return (get_container());
}
// size controllers
virtual size_type size_virtual() sealed
= _Mycont_it::size
{ // return length of sequence
return (size());
}
virtual bool empty_virtual() sealed
= _Mycont_it::empty
{ // test if sequence is empty
return (empty());
}
// mutators
virtual void push_virtual(value_type _Val) sealed
= _Mycont_it::push
{ // insert element at end
push(_Val);
}
virtual void pop_virtual() sealed
= _Mycont_it::pop
{ // erase element at end
pop();
}
virtual void assign_virtual(_Mycont_it^ _Right) sealed
= _Mycont_it::assign
{ // assign
assign(*(_Mytype_t^)_Right);
}
};
//
// TEMPLATE CLASS stack_select
//
template<typename _Value_t,
typename _Cont_t,
bool _Is_ref>
ref class stack_select
: public stack_base<_Value_t, _Cont_t^>
{ // LIFO queue of elements
public:
// types
typedef stack_select<_Value_t, _Cont_t, _Is_ref> _Mytype_t;
typedef stack_base<_Value_t, _Cont_t^> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
// basics
stack_select()
{ // construct with empty container
}
stack_select% operator=(stack_select% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
// constructors
explicit stack_select(container_type% _Cont)
: _Mybase_t(_Cont)
{ // construct with specified container
}
};
//
// TEMPLATE CLASS stack_select: _Value_t REF SPECIALIZATION
//
template<typename _Value_t,
typename _Cont_t>
ref class stack_select<_Value_t, _Cont_t, true>
: public stack_base<_Value_t^, _Cont_t^>
{ // LIFO queue of elements
public:
// types
typedef stack_select<_Value_t, _Cont_t, true> _Mytype_t;
typedef stack_base<_Value_t^, _Cont_t^> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
typedef _Value_t value_type;
typedef value_type% reference;
typedef value_type% const_reference;
// basics
stack_select()
{ // construct with empty container
}
stack_select% operator=(stack_select% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
// constructors
explicit stack_select(container_type% _Cont)
: _Mybase_t(_Cont)
{ // construct with specified container
}
// accessors
property value_type top_item
{ // get or set top element
value_type get()
{ // get last element
return (top());
}
void set(value_type _Val)
{ // set last element
top() = _Val;
}
};
reference top() new
{ // get top element
return (this->c->back());
}
// mutators
void push(value_type _Val)
{ // insert element at end
this->c->push_back(_Val);
}
};
} // namespace cliext::impl
//
// TEMPLATE CLASS stack
//
template<typename _Value_t,
typename _Cont_t = cliext::deque<_Value_t> >
ref class stack
: public impl::stack_select<
_Value_t,
typename _Dehandle<_Cont_t>::type,
__is_ref_class(typename _Dehandle<_Value_t>::type)
&& !is_handle<_Value_t>::value>
{ // LIFO queue of elements
public:
// types
typedef stack<_Value_t, _Cont_t> _Mytype_t;
typedef impl::stack_select<
_Value_t,
typename _Dehandle<_Cont_t>::type,
__is_ref_class(typename _Dehandle<_Value_t>::type)
&& !is_handle<_Value_t>::value> _Mybase_t;
typedef typename _Mybase_t::container_type container_type;
// basics
stack()
{ // construct with empty container
}
stack(stack% _Right)
: _Mybase_t(*_Right.get_container())
{ // construct by copying a stack
}
stack(stack^ _Right)
: _Mybase_t(*_Right->get_container())
{ // construct by copying a stack
}
stack% operator=(stack% _Right)
{ // assign
_Mybase_t::operator=(_Right);
return (*this);
}
stack% operator=(stack^ _Right)
{ // assign
_Mybase_t::operator=(*_Right);
return (*this);
}
// constructors
explicit stack(container_type% _Cont)
: _Mybase_t(_Cont)
{ // construct with specified container
}
// interfaces
virtual System::Object^ Clone() override
{ // clone the vector
return (gcnew _Mytype_t(*this));
}
};
//
// TEMPLATE COMPARISONS
//
template<typename _Value_t,
typename _Cont_t>
bool operator==(stack<_Value_t, _Cont_t>% _Left,
stack<_Value_t, _Cont_t>% _Right)
{ // test if _Left == _Right
return (*_Left.get_container() == *_Right.get_container());
}
template<typename _Value_t,
typename _Cont_t>
bool operator!=(stack<_Value_t, _Cont_t>% _Left,
stack<_Value_t, _Cont_t>% _Right)
{ // test if _Left != _Right
return (!(_Left == _Right));
}
template<typename _Value_t,
typename _Cont_t>
bool operator<(stack<_Value_t, _Cont_t>% _Left,
stack<_Value_t, _Cont_t>% _Right)
{ // test if _Left < _Right
return (*_Left.get_container() < *_Right.get_container());
}
template<typename _Value_t,
typename _Cont_t>
bool operator>=(stack<_Value_t, _Cont_t>% _Left,
stack<_Value_t, _Cont_t>% _Right)
{ // test if _Left >= _Right
return (!(_Left < _Right));
}
template<typename _Value_t,
typename _Cont_t>
bool operator>(stack<_Value_t, _Cont_t>% _Left,
stack<_Value_t, _Cont_t>% _Right)
{ // test if _Left > _Right
return (_Right < _Left);
}
template<typename _Value_t,
typename _Cont_t>
bool operator<=(stack<_Value_t, _Cont_t>% _Left,
stack<_Value_t, _Cont_t>% _Right)
{ // test if _Left <= _Right
return (!(_Right < _Left));
}
} // namespace cliext
#endif // _CLI_STACK_
@@ -0,0 +1,505 @@
// utility stl/clr header
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _CLI_UTILITY_
#define _CLI_UTILITY_
#include <cliext/xutility>
namespace cliext {
//
// TEMPLATE REF CLASS pair
//
template<typename _Value1_t,
typename _Value2_t>
ref class pair
{ // store a pair of values
public:
typedef pair<_Value1_t, _Value2_t> _Mytype_t;
typedef typename _Value1_t first_type;
typedef typename _Value2_t second_type;
// basics
pair()
{ // construct default
}
pair(pair% _Right)
: first(_Right.first), second(_Right.second)
{ // construct by copying _Right
}
pair(pair^ _Right)
: first(_Right->first), second(_Right->second)
{ // construct by copying _Right
}
pair% operator=(pair% _Right)
{ // assign
first = _Right.first;
second = _Right.second;
return (*this);
}
pair% operator=(pair^ _Right)
{ // assign
first = _Right->first;
second = _Right->second;
return (*this);
}
// constructors
pair(first_type _Val1)
: first(_Val1)
{ // construct from first value only
}
pair(first_type _Val1, second_type _Val2)
: first(_Val1), second(_Val2)
{ // construct from specified values
}
template<typename _Pair_t>
pair(_Pair_t% _Right)
: first(_Right.first), second(_Right.second)
{ // construct from pair type
}
template<typename _Pair_t>
pair(_Pair_t^ _Right)
: first(_Right->first), second(_Right->second)
{ // construct from pair type
}
template<template <class, class> class _Pair_t, typename _OtherFirst_t, typename _OtherSecond_t>
operator _Pair_t<_OtherFirst_t, _OtherSecond_t>()
{ // convert to compatible pair
_Pair_t<_OtherFirst_t, _OtherSecond_t> _Newpair((_OtherFirst_t)first,(_OtherSecond_t)second);
return (_Newpair);
}
// mutators
void swap(pair% _Right)
{ // exchange contents with _Right
if ((System::Object^)this != %_Right)
{ // worth swapping, do it
_Value1_t _Tfirst = first;
_Value2_t _Tsecond = second;
first = _Right.first;
_Right.first = _Tfirst;
second = _Right.second;
_Right.second = _Tsecond;
}
}
first_type first; // first stored value
second_type second; // second stored value
};
//
// TEMPLATE OPERATIONS
//
template<class _Ty1,
class _Ty2> inline
void swap(pair<_Ty1, _Ty2>% _Left, pair<_Ty1, _Ty2>% _Right)
{ // swap _Left and _Right pairs
_Left.swap(_Right);
}
template<class _Ty1,
class _Ty2> inline
bool operator==(pair<_Ty1, _Ty2>% _Left,
pair<_Ty1, _Ty2>% _Right)
{ // test for pair equality
return (_Left.first == _Right.first && _Left.second == _Right.second);
}
template<class _Ty1,
class _Ty2> inline
bool operator!=(pair<_Ty1, _Ty2>% _Left,
pair<_Ty1, _Ty2>% _Right)
{ // test for pair inequality
return (!(_Left == _Right));
}
template<class _Ty1,
class _Ty2> inline
bool operator<(pair<_Ty1, _Ty2>% _Left,
pair<_Ty1, _Ty2>% _Right)
{ // test if _Left < _Right for pairs
return (_Left.first < _Right.first ||
!(_Right.first < _Left.first) && _Left.second < _Right.second);
}
template<class _Ty1,
class _Ty2> inline
bool operator>(pair<_Ty1, _Ty2>% _Left,
pair<_Ty1, _Ty2>% _Right)
{ // test if _Left > _Right for pairs
return (_Right < _Left);
}
template<class _Ty1,
class _Ty2> inline
bool operator<=(pair<_Ty1, _Ty2>% _Left,
pair<_Ty1, _Ty2>% _Right)
{ // test if _Left <= _Right for pairs
return (!(_Right < _Left));
}
template<class _Ty1,
class _Ty2> inline
bool operator>=(pair<_Ty1, _Ty2>% _Left,
pair<_Ty1, _Ty2>% _Right)
{ // test if _Left >= _Right for pairs
return (!(_Left < _Right));
}
template<class _Ty1,
class _Ty2> inline
pair<_Ty1, _Ty2> make_pair(_Ty1 _Val1, _Ty2 _Val2)
{ // return pair composed from arguments
return (pair<_Ty1, _Ty2>(_Val1, _Val2));
}
//
// TEMPLATE VALUE CLASS light_pair
//
template<typename _Value1_t,
typename _Value2_t>
value class light_pair
{ // store a pair of values
public:
typedef light_pair<_Value1_t, _Value2_t> _Mytype_t;
typedef typename _Value1_t first_type;
typedef typename _Value2_t second_type;
// constructors
light_pair(first_type _Val1)
: first(_Val1)
{ // construct from first value only
}
light_pair(first_type _Val1, second_type _Val2)
: first(_Val1), second(_Val2)
{ // construct from specified values
}
template<typename _Pair_t>
light_pair(_Pair_t% _Right)
: _First(_Right.first), _Second(_Right.second)
{ // construct from ref_pair
}
template<template <class, class> class _Pair_t, typename _OtherFirst_t, typename _OtherSecond_t>
operator _Pair_t<_OtherFirst_t, _OtherSecond_t>()
{ // convert to compatible pair
_Pair_t<_OtherFirst_t, _OtherSecond_t> _Newpair((_OtherFirst_t)first,(_OtherSecond_t)second);
return (_Newpair);
}
// mutators
void swap(light_pair% _Right)
{ // exchange contents with _Right
if ((System::Object^)this != %_Right)
{ // worth swapping, do it
_Value1_t _Tfirst = first;
_Value2_t _Tsecond = second;
first = _Right.first;
_Right.first = _Tfirst;
second = _Right.second;
_Right.second = _Tsecond;
}
}
first_type first; // first stored value
second_type second; // second stored value
};
//
// TEMPLATE REF CLASS select_pair
//
template<typename _Value1_t,
typename _Value2_t,
bool _Is_ref =
__is_ref_class(typename _Dehandle<_Value1_t>::type)
&& !is_handle<_Value1_t>::value
&& __is_ref_class(typename _Dehandle<_Value2_t>::type)
&& !is_handle<_Value2_t>::value>
ref class select_pair
{ // select pair
public:
typedef pair<_Value1_t, _Value2_t> type;
};
template<typename _Value1_t,
typename _Value2_t>
ref class select_pair<_Value1_t, _Value2_t, false>
{ // select light_pair
public:
typedef light_pair<_Value1_t, _Value2_t> type;
};
//
// System::IComparable TEMPLATE COMPARISONS
//
template<typename _Value_t>
bool operator==(System::IComparable<_Value_t>^ _Left,
System::IComparable<_Value_t>^ _Right)
{ // test if _Left == _Right
return (_Left->CompareTo(_Right) == 0);
}
template<typename _Value_t>
bool operator!=(System::IComparable<_Value_t>^ _Left,
System::IComparable<_Value_t>^ _Right)
{ // test if _Left != _Right
return (!(_Left == _Right));
}
template<typename _Value_t>
bool operator<(System::IComparable<_Value_t>^ _Left,
System::IComparable<_Value_t>^ _Right)
{ // test if _Left < _Right
return (_Left->CompareTo(_Right) < 0);
}
template<typename _Value_t>
bool operator>=(System::IComparable<_Value_t>^ _Left,
System::IComparable<_Value_t>^ _Right)
{ // test if _Left >= _Right
return (!(_Left < _Right));
}
template<typename _Value_t>
bool operator>(System::IComparable<_Value_t>^ _Left,
System::IComparable<_Value_t>^ _Right)
{ // test if _Left > _Right
return (_Right < _Left);
}
template<typename _Value_t>
bool operator<=(System::IComparable<_Value_t>^ _Left,
System::IComparable<_Value_t>^ _Right)
{ // test if _Left <= _Right
return (!(_Right < _Left));
}
template<typename _Value_t>
bool operator==(System::IComparable<_Value_t>% _Left,
System::IComparable<_Value_t>% _Right)
{ // test if _Left == _Right
return (_Left.CompareTo((_Value_t)%(System::Object%)_Right) == 0);
}
template<typename _Value_t>
bool operator!=(System::IComparable<_Value_t>% _Left,
System::IComparable<_Value_t>% _Right)
{ // test if _Left != _Right
return (!(_Left == _Right));
}
template<typename _Value_t>
bool operator<(System::IComparable<_Value_t>% _Left,
System::IComparable<_Value_t>% _Right)
{ // test if _Left < _Right
return (_Left.CompareTo((_Value_t)%(System::Object%)_Right) < 0);
}
template<typename _Value_t>
bool operator>=(System::IComparable<_Value_t>% _Left,
System::IComparable<_Value_t>% _Right)
{ // test if _Left >= _Right
return (!(_Left < _Right));
}
template<typename _Value_t>
bool operator>(System::IComparable<_Value_t>% _Left,
System::IComparable<_Value_t>% _Right)
{ // test if _Left > _Right
return (_Right < _Left);
}
template<typename _Value_t>
bool operator<=(System::IComparable<_Value_t>% _Left,
System::IComparable<_Value_t>% _Right)
{ // test if _Left <= _Right
return (!(_Right < _Left));
}
inline bool operator==(System::IComparable^ _Left,
System::IComparable^ _Right)
{ // test if _Left == _Right
return (_Left->CompareTo(_Right) == 0);
}
inline bool operator!=(System::IComparable^ _Left,
System::IComparable^ _Right)
{ // test if _Left != _Right
return (!(_Left == _Right));
}
inline bool operator<(System::IComparable^ _Left,
System::IComparable^ _Right)
{ // test if _Left < _Right
return (_Left->CompareTo(_Right) < 0);
}
inline bool operator>=(System::IComparable^ _Left,
System::IComparable^ _Right)
{ // test if _Left >= _Right
return (!(_Left < _Right));
}
inline bool operator>(System::IComparable^ _Left,
System::IComparable^ _Right)
{ // test if _Left > _Right
return (_Right < _Left);
}
inline bool operator<=(System::IComparable^ _Left,
System::IComparable^ _Right)
{ // test if _Left <= _Right
return (!(_Right < _Left));
}
inline bool operator==(System::IComparable% _Left,
System::IComparable% _Right)
{ // test if _Left == _Right
return (_Left.CompareTo(%(System::Object%)_Right) == 0);
}
inline bool operator!=(System::IComparable% _Left,
System::IComparable% _Right)
{ // test if _Left != _Right
return (!(_Left == _Right));
}
inline bool operator<(System::IComparable% _Left,
System::IComparable% _Right)
{ // test if _Left < _Right
return (_Left.CompareTo(%(System::Object%)_Right) < 0);
}
inline bool operator>=(System::IComparable% _Left,
System::IComparable% _Right)
{ // test if _Left >= _Right
return (!(_Left < _Right));
}
inline bool operator>(System::IComparable% _Left,
System::IComparable% _Right)
{ // test if _Left > _Right
return (_Right < _Left);
}
inline bool operator<=(System::IComparable% _Left,
System::IComparable% _Right)
{ // test if _Left <= _Right
return (!(_Right < _Left));
}
} // namespace cliext
using cliext::operator==;
using cliext::operator!=;
using cliext::operator<;
using cliext::operator>=;
using cliext::operator>;
using cliext::operator<=;
namespace Microsoft {
namespace VisualC {
namespace StlClr {
//
// TEMPLATE OPERATIONS FOR GenericPair
//
template<class _Ty1,
class _Ty2> inline
void swap(_STLCLR GenericPair<_Ty1, _Ty2>% _Left,
_STLCLR GenericPair<_Ty1, _Ty2>% _Right)
{ // swap _Left and _Right GenericPairs
_Left.swap(_Right);
}
template<class _Ty1,
class _Ty2> inline
bool operator==(_STLCLR GenericPair<_Ty1, _Ty2>% _Left,
_STLCLR GenericPair<_Ty1, _Ty2>% _Right)
{ // test for GenericPair equality
return (_Left.first == _Right.first && _Left.second == _Right.second);
}
template<class _Ty1,
class _Ty2> inline
bool operator==(_STLCLR GenericPair<_Ty1, _Ty2>^ _Left,
_STLCLR GenericPair<_Ty1, _Ty2>^ _Right)
{ // test for GenericPair equality
return (_Left->first == _Right->first
&& _Left->second == _Right->second);
}
template<class _Ty1,
class _Ty2> inline
bool operator!=(_STLCLR GenericPair<_Ty1, _Ty2>% _Left,
_STLCLR GenericPair<_Ty1, _Ty2>% _Right)
{ // test for GenericPair inequality
return (!(_Left == _Right));
}
template<class _Ty1,
class _Ty2> inline
bool operator<(_STLCLR GenericPair<_Ty1, _Ty2>% _Left,
_STLCLR GenericPair<_Ty1, _Ty2>% _Right)
{ // test if _Left < _Right for GenericPairs
return (_Left.first < _Right.first ||
!(_Right.first < _Left.first) && _Left.second < _Right.second);
}
template<class _Ty1,
class _Ty2> inline
bool operator<(_STLCLR GenericPair<_Ty1, _Ty2>^ _Left,
_STLCLR GenericPair<_Ty1, _Ty2>^ _Right)
{ // test if _Left < _Right for GenericPairs
return (_Left->first < _Right->first ||
!(_Right->first < _Left->first) && _Left->second < _Right->second);
}
template<class _Ty1,
class _Ty2> inline
bool operator>(_STLCLR GenericPair<_Ty1, _Ty2>% _Left,
_STLCLR GenericPair<_Ty1, _Ty2>% _Right)
{ // test if _Left > _Right for GenericPairs
return (_Right < _Left);
}
template<class _Ty1,
class _Ty2> inline
bool operator<=(_STLCLR GenericPair<_Ty1, _Ty2>% _Left,
_STLCLR GenericPair<_Ty1, _Ty2>% _Right)
{ // test if _Left <= _Right for GenericPairs
return (!(_Right < _Left));
}
template<class _Ty1,
class _Ty2> inline
bool operator>=(_STLCLR GenericPair<_Ty1, _Ty2>% _Left,
_STLCLR GenericPair<_Ty1, _Ty2>% _Right)
{ // test if _Left >= _Right for GenericPairs
return (!(_Left < _Right));
}
template<class _Ty1,
class _Ty2> inline
_STLCLR GenericPair<_Ty1, _Ty2>
make_generic_pair(_Ty1 _Val1, _Ty2 _Val2)
{ // return GenericPair composed from arguments
return (_STLCLR GenericPair<_Ty1, _Ty2>(_Val1, _Val2));
}
} // namespace StlClr
} // namespace VisualC
} // namespace Microsoft
#endif // _CLI_UTILITY_
@@ -0,0 +1,738 @@
// xutility stl/clr header
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _CLI_XUTILITY_
#define _CLI_XUTILITY_
#ifndef __cplusplus_cli
#error STL/CLR can be used only in code compiled /clr, clr:pure, or /clr:safe
#endif /* __cplusplus_cli */
#if !defined _CRT_WINDOWS && !defined(UNDOCKED_WINDOWS_UCRT)
#using <Microsoft.VisualC.STLCLR.dll>
#endif
#ifdef _M_CEE_SAFE
#else /* _M_CEE_SAFE */
#include <cstddef> // for ptrdiff_t, size_t
#include <xutility> // for iterator tags
#endif /* _M_CEE_SAFE */
#define _STLCLR_FIELD_ACCESS internal
#define _STLCLR Microsoft::VisualC::StlClr::
#define MAX_CONTAINER_SIZE ((int)((unsigned int)(-1) >> 1))
namespace cliext {
//
// TEMPLATE METAPROGRAMMING AIDS
//
//
// TEMPLATE VALUE CLASS is_handle
//
template<typename _Value_t>
value class is_handle
{ // identify non-handle type
public:
static const bool value = false;
};
template<typename _Value_t>
value class is_handle<_Value_t^>
{ // identify handle type
public:
static const bool value = true;
};
//
// TEMPLATE VALUE CLASS _Container_traits
//
template<typename _Cont_t>
value class _Container_traits
{ // define types associated with a container
public:
typedef typename _Cont_t::generic_container generic_container;
typedef typename _Cont_t::generic_container^ generic_container_handle;
};
template<typename _Cont_t>
value class _Container_traits<_Cont_t^>
{ // define type associated with a container handle
public:
typedef typename _Cont_t::generic_container generic_container;
typedef typename _Cont_t::generic_container^ generic_container_handle;
};
//
// TEMPLATE VALUE CLASS _Dehandle
//
template<typename _Value_t>
value class _Dehandle
{ // define non-handle type
public:
typedef _Value_t type;
};
template<typename _Value_t>
value class _Dehandle<_Value_t^>
{ // define type with handle removed
public:
typedef _Value_t type;
};
//
// TEMPLATE CLASS _Cont_make_value
//
template<typename _Value_t,
bool _Is_ref>
ref class _Cont_make_value
{ // make a non-ref value
public:
static _Value_t make_value(_Value_t% _Val)
{ // just return value
return (_Val);
}
static void unmake_value(_Value_t%)
{ // just do nothing
}
};
template<typename _Value_t>
ref class _Cont_make_value<_Value_t, true>
{ // make a ref value
public:
static _Value_t make_value(_Value_t% _Val)
{ // return copy of value
return (gcnew typename _Dehandle<_Value_t>::type(_Val));
}
static void unmake_value(_Value_t% _Val)
{ // delete object designated by handle value
delete _Val;
}
};
//
// TEMPLATE VALUE CLASS _Generic_type
//
template<typename _Value_t,
bool isref = !is_handle<_Value_t>::value && __is_ref_class(_Value_t)>
value class _Generic_type;
template<typename _Value_t>
value class _Generic_type<_Value_t, false>
{ // define a non-ref type
public:
typedef _Value_t type;
};
template<typename _Value_t>
value class _Generic_type<_Value_t, true>
{ // define a ref type
public:
typedef _Value_t^ type;
};
//
// TEMPLATE FUNCTION _Handle_alloc
//
template<typename Mycont> inline
Mycont^ _Handle_alloc(Mycont^)
{ // allocate a container, given its handle type
return (gcnew Mycont);
}
//
// TEMPLATE CLASS _Fix_handle
//
#define _FIX_HANDLE(to, from, val) \
cliext::_Fix_handle<to, from>::_Cvt(from(val))
template<typename _To_t,
typename _From_t>
ref class _Fix_handle
{ // add or remove handle as needed, default version
public:
static _To_t _Cvt(_From_t _Val)
{ // convert _Val
return (_To_t(_Val));
}
};
template<typename _To_t,
typename _From_t>
ref class _Fix_handle<_To_t^, _From_t>
{ // add or remove handle as needed, add version
public:
static _To_t^ _Cvt(_From_t _Val)
{ // convert _Val
return (gcnew _To_t(_Val));
}
};
template<typename _To_t,
typename _From_t>
ref class _Fix_handle<_To_t, _From_t^>
{ // add or remove handle as needed, remove version
public:
static _To_t _Cvt(_From_t^ _Val)
{ // convert _Val
return (*_Val);
}
};
template<typename _To_t,
typename _From_t>
ref class _Fix_handle<_To_t^, _From_t^>
{ // add or remove handle as needed, handles version
public:
static _To_t^ _Cvt(_From_t^ _Val)
{ // convert _Val
return (_Val);
}
};
//
// ITERATOR TAGS
//
ref class input_iterator_tag
{ // identifying tag for input iterators
public:
typedef input_iterator_tag _Mytype_t;
input_iterator_tag()
{ // default constructor
}
input_iterator_tag(input_iterator_tag%)
{ // copy constructor
}
};
ref class output_iterator_tag
{ // identifying tag for output iterators
public:
typedef output_iterator_tag _Mytype_t;
output_iterator_tag()
{ // default constructor
}
output_iterator_tag(output_iterator_tag%)
{ // copy constructor
}
};
ref class forward_iterator_tag
: public input_iterator_tag
{ // identifying tag for forward iterators
public:
typedef forward_iterator_tag _Mytype_t;
forward_iterator_tag()
{ // default constructor
}
forward_iterator_tag(forward_iterator_tag%)
{ // copy constructor
}
};
ref class bidirectional_iterator_tag
: public forward_iterator_tag
{ // identifying tag for bidirectional iterators
public:
typedef bidirectional_iterator_tag _Mytype_t;
bidirectional_iterator_tag()
{ // default constructor
}
bidirectional_iterator_tag(bidirectional_iterator_tag%)
{ // copy constructor
}
};
ref class random_access_iterator_tag
: public bidirectional_iterator_tag
{ // identifying tag for random-access iterators
public:
typedef random_access_iterator_tag _Mytype_t;
random_access_iterator_tag()
{ // default constructor
}
random_access_iterator_tag(random_access_iterator_tag%)
{ // copy constructor
}
};
ref class _Int_iterator_tag
{ // identifying tag for integer types, not an iterator
public:
typedef _Int_iterator_tag _Mytype_t;
_Int_iterator_tag()
{ // default constructor
}
_Int_iterator_tag(_Int_iterator_tag%)
{ // copy constructor
}
};
//
// REF CLASS _Map_iter_cat
//
template<typename _Cat>
ref class _Map_iter_cat
{ // map to argument
public:
typedef _Cat iterator_category;
};
#ifdef _M_CEE_SAFE
#else /* _M_CEE_SAFE */
template<>
ref class _Map_iter_cat<std::input_iterator_tag>
{ // map to managed tag
public:
typedef input_iterator_tag iterator_category;
};
template<>
ref class _Map_iter_cat<std::output_iterator_tag>
{ // map to managed tag
public:
typedef output_iterator_tag iterator_category;
};
template<>
ref class _Map_iter_cat<std::forward_iterator_tag>
{ // map to managed tag
public:
typedef forward_iterator_tag iterator_category;
};
template<>
ref class _Map_iter_cat<std::bidirectional_iterator_tag>
{ // map to managed tag
public:
typedef bidirectional_iterator_tag iterator_category;
};
template<>
ref class _Map_iter_cat<std::random_access_iterator_tag>
{ // map to managed tag
public:
typedef random_access_iterator_tag iterator_category;
};
#endif /* _M_CEE_SAFE */
//
// TEMPLATE CLASS iterator_traits
//
template<class _Iter_t>
value class iterator_traits
{ // get traits from iterator _Iter
public:
typedef typename _Map_iter_cat<
typename _Iter_t::iterator_category>::iterator_category
iterator_category;
typedef typename _Iter_t::value_type value_type;
typedef typename _Iter_t::difference_type difference_type;
typedef difference_type distance_type; // retained
typedef typename _Iter_t::pointer pointer;
typedef typename _Iter_t::reference reference;
};
template<typename _Iter_t>
value class iterator_traits<_Iter_t^>
{ // get traits from managed pointer
public:
typedef typename _Iter_t::iterator_category iterator_category;
typedef typename _Iter_t::value_type value_type;
typedef typename _Iter_t::difference_type difference_type;
typedef difference_type distance_type; // retained
typedef typename _Iter_t::pointer pointer;
typedef typename _Iter_t::reference reference;
};
#ifdef _M_CEE_SAFE
#else /* _M_CEE_SAFE */
template<class _Ty>
value class iterator_traits<_Ty *>
{ // get traits from pointer
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef std::ptrdiff_t difference_type;
typedef std::ptrdiff_t distance_type; // retained
typedef _Ty *pointer;
typedef _Ty& reference;
};
template<class _Ty>
value class iterator_traits<const _Ty *>
{ // get traits from const pointer
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef std::ptrdiff_t difference_type;
typedef std::ptrdiff_t distance_type; // retained
typedef const _Ty *pointer;
typedef const _Ty& reference;
};
#endif /* _M_CEE_SAFE */
//
// PARTIAL SPECIALIZATIONS OF iterator_traits
//
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::IInputIterator<_Ty>>
{ // get traits from generic interface
public:
typedef input_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::IOutputIterator<_Ty>>
{ // get traits from generic interface
public:
typedef output_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::IForwardIterator<_Ty>>
{ // get traits from generic interface
public:
typedef forward_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::IBidirectionalIterator<_Ty>>
{ // get traits from generic interface
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::IRandomAccessIterator<_Ty>>
{ // get traits from generic interface
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ReverseBidirectionalIterator<_Ty>>
{ // get traits from generic interface
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ConstReverseBidirectionalIterator<_Ty>>
{ // get traits from generic interface
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ReverseRandomAccessIterator<_Ty>>
{ // get traits from generic interface
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ConstReverseRandomAccessIterator<_Ty>>
{ // get traits from generic interface
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ContainerBidirectionalIterator<_Ty>>
{ // get traits from generic interface
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ConstContainerBidirectionalIterator<_Ty>>
{ // get traits from generic interface
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ContainerRandomAccessIterator<_Ty>>
{ // get traits from generic interface
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<class _Ty>
value class iterator_traits<
_STLCLR Generic::ConstContainerRandomAccessIterator<_Ty>>
{ // get traits from generic interface
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef int difference_type;
typedef int distance_type; // retained
typedef typename _Ty% pointer;
typedef typename _Ty% reference;
};
template<>
value class iterator_traits<bool>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<char>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<signed char>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<unsigned char>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<wchar_t>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<short>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<unsigned short>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<int>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<unsigned int>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<long>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<unsigned long>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<__int64>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
template<>
value class iterator_traits<unsigned __int64>
{ // get traits from integer type
public:
typedef _Int_iterator_tag iterator_category;
};
//
// TEMPLATE FUNCTION _Iter_category
//
template<class _Iter_t> inline
typename iterator_traits<_Iter_t>::iterator_category
_Iter_category(_Iter_t)
{ // return category from iterator argument
typename iterator_traits<_Iter_t>::iterator_category _Cat;
return (_Cat);
}
//
// TEMPLATE FUNCTION advance
//
template<typename _InIt_t,
typename _Diff_t> inline
void _Iter_advance(_InIt_t% _Where, _Diff_t _Off,
input_iterator_tag)
{ // increment iterator by offset, input iterators
for (; 0 < _Off; --_Off)
++_Where;
}
template<typename _BidIt_t,
typename _Diff_t> inline
void _Iter_advance(_BidIt_t% _Where, _Diff_t _Off,
bidirectional_iterator_tag)
{ // increment iterator by offset, bidirectional iterators
for (; 0 < _Off; --_Off)
++_Where;
for (; _Off < 0; ++_Off)
--_Where;
}
template<typename _RanIt_t,
typename _Diff_t> inline
void _Iter_advance(_RanIt_t% _Where, _Diff_t _Off,
random_access_iterator_tag)
{ // increment iterator by offset, random-access iterators
_Where += _Off;
}
template<typename _InIt_t,
typename _Diff_t> inline
void advance(_InIt_t% _Where, _Diff_t _Off)
{ // increment iterator by _Off, arbitrary iterators
_Iter_advance(_Where, _Off, _Iter_category(_Where));
}
//
// TEMPLATE FUNCTIONS distance and _Iter_distance
//
template<typename _InIt_t,
typename _Diff_t> inline
void _Iter_distance2(_InIt_t _First, _InIt_t _Last, _Diff_t% _Off,
input_iterator_tag)
{ // add to _Off distance between input iterators
for (; _First != _Last; ++_First)
++_Off;
}
template<typename _RanIt_t,
typename _Diff_t> inline
void _Iter_distance2(_RanIt_t _First, _RanIt_t _Last, _Diff_t% _Off,
random_access_iterator_tag)
{ // add to _Off distance between random-access iterators
_Off += (_Diff_t)(_Last - _First);
}
template<typename _InIt_t> inline
int distance(_InIt_t _First, _InIt_t _Last)
{ // return distance between iterators
int _Off = 0;
_Iter_distance2(_First, _Last, _Off, _Iter_category(_First));
return (_Off);
}
template<typename _InIt_t,
typename _Diff_t> inline
void _Iter_distance(_InIt_t _First, _InIt_t _Last, _Diff_t% _Off)
{ // add to _Off distance between iterators
_Iter_distance2(_First, _Last, _Off, _Iter_category(_First));
}
} // namespace cliext
#endif // _CLI_XUTILITY_
@@ -0,0 +1,14 @@
// climits standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CLIMITS_
#define _CLIMITS_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <limits.h>
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CLIMITS_
@@ -0,0 +1,32 @@
// clocale standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CLOCALE_
#define _CLOCALE_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <locale.h>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
_EXPORT_STD using _CSTD lconv;
_EXPORT_STD using _CSTD localeconv;
_EXPORT_STD using _CSTD setlocale;
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CLOCALE_
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,692 @@
// codecvt standard header
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CODECVT_
#define _CODECVT_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <cwchar>
#include <locale>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
_INLINE_VAR constexpr int _Little_first = 1;
_INLINE_VAR constexpr int _Big_first = 2;
_EXPORT_STD enum _CXX17_DEPRECATE_CODECVT_HEADER codecvt_mode {
consume_header = 4,
generate_header = 2,
little_endian = 1
};
using _Statype = _CSTD mbstate_t;
_STL_DISABLE_DEPRECATED_WARNING
_EXPORT_STD template <class _Elem, unsigned long _Mymax = 0x10ffff, codecvt_mode _Mymode = codecvt_mode{}>
class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf8 : public codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and UTF-8 byte sequences
public:
using _Mybase = codecvt<_Elem, char, _Statype>;
using result = typename _Mybase::result;
using _Byte = char;
using intern_type = _Elem;
using extern_type = _Byte;
using state_type = _Statype;
explicit codecvt_utf8(size_t _Refs = 0) : _Mybase(_Refs) {}
__CLR_OR_THIS_CALL ~codecvt_utf8() noexcept override {}
protected:
result __CLR_OR_THIS_CALL do_in(_Statype& _State, const _Byte* _First1, const _Byte* _Last1, const _Byte*& _Mid1,
_Elem* _First2, _Elem* _Last2, _Elem*& _Mid2) const override {
// convert bytes [_First1, _Last1) to [_First2, _Last2)
char* _Pstate = reinterpret_cast<char*>(&_State);
_Mid1 = _First1;
_Mid2 = _First2;
while (_Mid1 != _Last1 && _Mid2 != _Last2) { // convert a multibyte sequence
unsigned long _By = static_cast<unsigned char>(*_Mid1);
unsigned long _Ch;
int _Nextra;
if (_By < 0x80u) {
_Ch = _By;
_Nextra = 0;
} else if (_By < 0xc0u) { // 0x80-0xbf not first byte
++_Mid1;
return _Mybase::error;
} else if (_By < 0xe0u) {
_Ch = _By & 0x1f;
_Nextra = 1;
} else if (_By < 0xf0u) {
_Ch = _By & 0x0f;
_Nextra = 2;
} else if (_By < 0xf8u) {
_Ch = _By & 0x07;
_Nextra = 3;
} else {
_Ch = _By & 0x03;
_Nextra = _By < 0xfc ? 4 : 5;
}
if (_Nextra == 0) {
++_Mid1;
} else if (_Last1 - _Mid1 < _Nextra + 1) {
break; // not enough input
} else {
for (++_Mid1; 0 < _Nextra; --_Nextra, ++_Mid1) {
if ((_By = static_cast<unsigned char>(*_Mid1)) < 0x80u || 0xc0u <= _By) {
return _Mybase::error; // not continuation byte
} else {
_Ch = _Ch << 6 | (_By & 0x3f);
}
}
}
if (*_Pstate == 0) { // first time, maybe look for and consume header
*_Pstate = 1;
constexpr bool _Consuming = (_Mymode & consume_header) != 0;
if constexpr (_Consuming) {
if (_Ch == 0xfeff) { // drop header and retry
const result _Ans = do_in(_State, _Mid1, _Last1, _Mid1, _First2, _Last2, _Mid2);
if (_Ans == _Mybase::partial) { // roll back header determination
*_Pstate = 0;
_Mid1 = _First1;
}
return _Ans;
}
}
}
if (_Mymax < _Ch) {
return _Mybase::error; // code too large
}
*_Mid2++ = static_cast<_Elem>(_Ch);
}
return _First1 == _Mid1 ? _Mybase::partial : _Mybase::ok;
}
result __CLR_OR_THIS_CALL do_out(_Statype& _State, const _Elem* _First1, const _Elem* _Last1, const _Elem*& _Mid1,
_Byte* _First2, _Byte* _Last2, _Byte*& _Mid2) const override {
// convert [_First1, _Last1) to bytes [_First2, _Last2)
char* _Pstate = reinterpret_cast<char*>(&_State);
_Mid1 = _First1;
_Mid2 = _First2;
while (_Mid1 != _Last1 && _Mid2 != _Last2) { // convert and put a wide char
_Byte _By;
int _Nextra;
unsigned long _Ch = static_cast<unsigned long>(*_Mid1);
if (_Mymax < _Ch) {
return _Mybase::error;
}
if (_Ch < 0x0080u) {
_By = static_cast<_Byte>(_Ch);
_Nextra = 0;
} else if (_Ch < 0x0800u) {
_By = static_cast<_Byte>(0xc0 | _Ch >> 6);
_Nextra = 1;
} else if (_Ch < 0x00010000u) {
_By = static_cast<_Byte>(0xe0 | _Ch >> 12);
_Nextra = 2;
} else if (_Ch < 0x00200000u) {
_By = static_cast<_Byte>(0xf0 | _Ch >> 18);
_Nextra = 3;
} else if (_Ch < 0x04000000u) {
_By = static_cast<_Byte>(0xf8 | _Ch >> 24);
_Nextra = 4;
} else {
_By = static_cast<_Byte>(0xfc | (_Ch >> 30 & 0x03));
_Nextra = 5;
}
if (*_Pstate == 0) { // first time, maybe generate header
*_Pstate = 1;
constexpr bool _Generating = (_Mymode & generate_header) != 0;
if constexpr (_Generating) {
if (_Last2 - _Mid2 < 3 + 1 + _Nextra) {
return _Mybase::partial; // not enough room for both
}
// prepend header
*_Mid2++ = '\xef';
*_Mid2++ = '\xbb';
*_Mid2++ = '\xbf';
}
}
if (_Last2 - _Mid2 < 1 + _Nextra) {
break; // not enough room for output
}
++_Mid1;
for (*_Mid2++ = _By; 0 < _Nextra;) {
*_Mid2++ = static_cast<_Byte>((_Ch >> 6 * --_Nextra & 0x3f) | 0x80);
}
}
return _First1 == _Mid1 ? _Mybase::partial : _Mybase::ok;
}
result __CLR_OR_THIS_CALL do_unshift(_Statype&, _Byte* _First2, _Byte*, _Byte*& _Mid2) const override {
// generate bytes to return to default shift state
_Mid2 = _First2;
return _Mybase::noconv;
}
friend int _Codecvt_do_length<>(const codecvt_utf8&, _Statype&, const _Byte*, const _Byte*, size_t);
int __CLR_OR_THIS_CALL do_length(
_Statype& _State, const _Byte* _First1, const _Byte* _Last1, size_t _Count) const noexcept override {
return _Codecvt_do_length(*this, _State, _First1, _Last1, _Count);
}
bool __CLR_OR_THIS_CALL do_always_noconv() const noexcept override {
// return true if conversions never change input
return false;
}
int __CLR_OR_THIS_CALL do_max_length() const noexcept override {
// return maximum length required for a conversion
if constexpr ((_Mymode & (consume_header | generate_header)) != 0) {
return 9;
} else {
return 6;
}
}
int __CLR_OR_THIS_CALL do_encoding() const noexcept override {
// return length of code sequence (from codecvt)
if constexpr ((_Mymode & (consume_header | generate_header)) != 0) {
return -1; // -1 => state dependent
} else {
return 0; // 0 => varying length
}
}
};
_EXPORT_STD template <class _Elem, unsigned long _Mymax = 0x10ffff, codecvt_mode _Mymode = codecvt_mode{}>
class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf16 : public codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and UTF-16 multibyte sequences
private:
enum { _Bytes_per_word = 2 };
public:
using _Mybase = codecvt<_Elem, char, _Statype>;
using result = typename _Mybase::result;
using _Byte = char;
using intern_type = _Elem;
using extern_type = _Byte;
using state_type = _Statype;
explicit codecvt_utf16(size_t _Refs = 0) : _Mybase(_Refs) {}
__CLR_OR_THIS_CALL ~codecvt_utf16() noexcept override {}
protected:
result __CLR_OR_THIS_CALL do_in(_Statype& _State, const _Byte* _First1, const _Byte* _Last1, const _Byte*& _Mid1,
_Elem* _First2, _Elem* _Last2, _Elem*& _Mid2) const override {
// convert bytes [_First1, _Last1) to [_First2, _Last2)
char* _Pstate = reinterpret_cast<char*>(&_State);
_Mid1 = _First1;
_Mid2 = _First2;
while (_Bytes_per_word <= _Last1 - _Mid1 && _Mid2 != _Last2) { // convert a multibyte sequence
const auto _Ptr = reinterpret_cast<const unsigned char*>(_Mid1);
unsigned long _Ch;
unsigned short _Ch0;
unsigned short _Ch1;
if (*_Pstate == _Little_first) {
_Ch0 = static_cast<unsigned short>(_Ptr[1] << 8 | _Ptr[0]);
} else if (*_Pstate == _Big_first) {
_Ch0 = static_cast<unsigned short>(_Ptr[0] << 8 | _Ptr[1]);
} else { // no header seen yet, try preferred mode
constexpr bool _Prefer_LE = (_Mymode & little_endian) != 0;
constexpr char _Default_endian = _Prefer_LE ? _Little_first : _Big_first;
if constexpr (_Prefer_LE) {
_Ch0 = static_cast<unsigned short>(_Ptr[1] << 8 | _Ptr[0]);
} else {
_Ch0 = static_cast<unsigned short>(_Ptr[0] << 8 | _Ptr[1]);
}
*_Pstate = _Default_endian;
constexpr bool _Consuming = (_Mymode & consume_header) != 0;
if constexpr (_Consuming) {
if (_Ch0 == 0xfffeu) {
*_Pstate = 3 - _Default_endian;
}
if (_Ch0 == 0xfffeu || _Ch0 == 0xfeffu) { // consume header, fixate on endianness, and retry
_Mid1 += _Bytes_per_word;
result _Ans = do_in(_State, _Mid1, _Last1, _Mid1, _First2, _Last2, _Mid2);
if (_Ans == _Mybase::partial) { // not enough bytes, roll back header
*_Pstate = 0;
_Mid1 = _First1;
}
return _Ans;
}
}
}
if (_Ch0 < 0xd800u || 0xdc00u <= _Ch0) { // one word, consume bytes
_Mid1 += _Bytes_per_word;
_Ch = _Ch0;
} else if (_Last1 - _Mid1 < 2 * _Bytes_per_word) {
break;
} else { // get second word
if (*_Pstate == _Little_first) {
_Ch1 = static_cast<unsigned short>(_Ptr[3] << 8 | _Ptr[2]);
} else {
_Ch1 = static_cast<unsigned short>(_Ptr[2] << 8 | _Ptr[3]);
}
if (_Ch1 < 0xdc00u || 0xe000u <= _Ch1) {
return _Mybase::error;
}
_Mid1 += 2 * _Bytes_per_word;
_Ch = static_cast<unsigned long>(_Ch0 - 0xd800 + 0x0040) << 10 | (_Ch1 - 0xdc00);
}
if (_Mymax < _Ch) {
return _Mybase::error; // code too large
}
*_Mid2++ = static_cast<_Elem>(_Ch);
}
return _First1 == _Mid1 ? _Mybase::partial : _Mybase::ok;
}
result __CLR_OR_THIS_CALL do_out(_Statype& _State, const _Elem* _First1, const _Elem* _Last1, const _Elem*& _Mid1,
_Byte* _First2, _Byte* _Last2, _Byte*& _Mid2) const override {
// convert [_First1, _Last1) to bytes [_First2, _Last2)
char* _Pstate = reinterpret_cast<char*>(&_State);
_Mid1 = _First1;
_Mid2 = _First2;
if (*_Pstate == 0) { // determine endianness once, maybe generate header
if constexpr ((_Mymode & little_endian) != 0) {
*_Pstate = _Little_first;
} else {
*_Pstate = _Big_first;
}
constexpr bool _Generating = (_Mymode & generate_header) != 0;
if constexpr (_Generating) {
if (_Last2 - _Mid2 < 3 * _Bytes_per_word) {
return _Mybase::partial; // not enough room for all
}
if (*_Pstate == _Little_first) { // put header LS byte first
*_Mid2++ = '\xff';
*_Mid2++ = '\xfe';
} else { // put header MS byte first
*_Mid2++ = '\xfe';
*_Mid2++ = '\xff';
}
}
}
while (_Mid1 != _Last1 && _Bytes_per_word <= _Last2 - _Mid2) { // convert and put a wide char
bool _Extra = false;
unsigned long _Ch = static_cast<unsigned long>(*_Mid1++);
if ((_Mymax < 0x10ffffu ? _Mymax : 0x10ffffu) < _Ch) {
return _Mybase::error; // value too large
}
if (_Ch <= 0xffffu) { // one word, can't be code for first of two
if (0xd800u <= _Ch && _Ch < 0xdc00u) {
return _Mybase::error;
}
} else if (_Last2 - _Mid2 < 2 * _Bytes_per_word) { // not enough room for two-word output, back up
--_Mid1;
return _Mybase::partial;
} else {
_Extra = true;
}
if (*_Pstate == _Little_first) {
if (_Extra) { // put a pair of words LS byte first
unsigned short _Ch0 =
static_cast<unsigned short>(0xd800 | static_cast<unsigned short>(_Ch >> 10) - 0x0040);
*_Mid2++ = static_cast<_Byte>(_Ch0);
*_Mid2++ = static_cast<_Byte>(_Ch0 >> 8);
_Ch0 = static_cast<unsigned short>(0xdc00 | (static_cast<unsigned short>(_Ch) & 0x03ff));
*_Mid2++ = static_cast<_Byte>(_Ch0);
*_Mid2++ = static_cast<_Byte>(_Ch0 >> 8);
} else { // put a single word LS byte first
*_Mid2++ = static_cast<_Byte>(_Ch);
*_Mid2++ = static_cast<_Byte>(_Ch >> 8);
}
} else {
if (_Extra) { // put a pair of words MS byte first
unsigned short _Ch0 =
static_cast<unsigned short>(0xd800 | static_cast<unsigned short>(_Ch >> 10) - 0x0040);
*_Mid2++ = static_cast<_Byte>(_Ch0 >> 8);
*_Mid2++ = static_cast<_Byte>(_Ch0);
_Ch0 = static_cast<unsigned short>(0xdc00 | (static_cast<unsigned short>(_Ch) & 0x03ff));
*_Mid2++ = static_cast<_Byte>(_Ch0 >> 8);
*_Mid2++ = static_cast<_Byte>(_Ch0);
} else { // put a single word MS byte first
*_Mid2++ = static_cast<_Byte>(_Ch >> 8);
*_Mid2++ = static_cast<_Byte>(_Ch);
}
}
}
return _First1 == _Mid1 ? _Mybase::partial : _Mybase::ok;
}
result __CLR_OR_THIS_CALL do_unshift(_Statype&, _Byte* _First2, _Byte*, _Byte*& _Mid2) const override {
// generate bytes to return to default shift state
_Mid2 = _First2;
return _Mybase::noconv;
}
friend int _Codecvt_do_length<>(const codecvt_utf16&, _Statype&, const _Byte*, const _Byte*, size_t);
int __CLR_OR_THIS_CALL do_length(
_Statype& _State, const _Byte* _First1, const _Byte* _Last1, size_t _Count) const noexcept override {
return _Codecvt_do_length(*this, _State, _First1, _Last1, _Count);
}
bool __CLR_OR_THIS_CALL do_always_noconv() const noexcept override {
// return true if conversions never change input
return false;
}
int __CLR_OR_THIS_CALL do_max_length() const noexcept override {
// return maximum length required for a conversion
if constexpr ((_Mymode & (consume_header | generate_header)) != 0) {
return 3 * _Bytes_per_word;
} else {
return 6 * _Bytes_per_word;
}
}
int __CLR_OR_THIS_CALL do_encoding() const noexcept override {
// return length of code sequence (from codecvt)
if constexpr ((_Mymode & (consume_header | generate_header)) != 0) {
return -1; // -1 => state dependent
} else {
return 0; // 0 => varying length
}
}
};
_EXPORT_STD template <class _Elem, unsigned long _Mymax = 0x10ffff, codecvt_mode _Mymode = codecvt_mode{}>
class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf8_utf16
: public codecvt<_Elem, char, _Statype> { // facet for converting between UTF-16 _Elem and UTF-8 byte sequences
public:
using _Mybase = codecvt<_Elem, char, _Statype>;
using result = typename _Mybase::result;
using _Byte = char;
using intern_type = _Elem;
using extern_type = _Byte;
using state_type = _Statype;
static_assert(sizeof(unsigned short) <= sizeof(state_type), "state_type too small");
explicit codecvt_utf8_utf16(size_t _Refs = 0) : _Mybase(_Refs) {}
__CLR_OR_THIS_CALL ~codecvt_utf8_utf16() noexcept override {}
protected:
result __CLR_OR_THIS_CALL do_in(_Statype& _State, const _Byte* _First1, const _Byte* _Last1, const _Byte*& _Mid1,
_Elem* _First2, _Elem* _Last2, _Elem*& _Mid2) const override {
// convert bytes [_First1, _Last1) to [_First2, _Last2)
unsigned short* _Pstate = reinterpret_cast<unsigned short*>(&_State);
_Mid1 = _First1;
_Mid2 = _First2;
while (_Mid1 != _Last1 && _Mid2 != _Last2) { // convert a multibyte sequence
unsigned long _By = static_cast<unsigned char>(*_Mid1);
unsigned long _Ch;
int _Nextra;
int _Nskip;
if (*_Pstate > 1u) {
if (_By < 0x80u || 0xc0u <= _By) {
return _Mybase::error; // not continuation byte
}
// deliver second half of two-word value
++_Mid1;
*_Mid2++ = static_cast<_Elem>(*_Pstate | (_By & 0x3f));
*_Pstate = 1;
continue;
}
if (_By < 0x80u) {
_Ch = _By;
_Nextra = 0;
} else if (_By < 0xc0u) { // 0x80-0xbf not first byte
++_Mid1;
return _Mybase::error;
} else if (_By < 0xe0u) {
_Ch = _By & 0x1f;
_Nextra = 1;
} else if (_By < 0xf0u) {
_Ch = _By & 0x0f;
_Nextra = 2;
} else if (_By < 0xf8u) {
_Ch = _By & 0x07;
_Nextra = 3;
} else {
_Ch = _By & 0x03;
_Nextra = _By < 0xfc ? 4 : 5;
}
_Nskip = _Nextra < 3 ? 0 : 1; // leave a byte for 2nd word
_First1 = _Mid1; // roll back point
if (_Nextra == 0) {
++_Mid1;
} else if (_Last1 - _Mid1 < _Nextra + 1 - _Nskip) {
break; // not enough input
} else {
for (++_Mid1; _Nskip < _Nextra; --_Nextra, ++_Mid1) {
if ((_By = static_cast<unsigned char>(*_Mid1)) < 0x80u || 0xc0u <= _By) {
return _Mybase::error; // not continuation byte
}
_Ch = _Ch << 6 | (_By & 0x3f);
}
}
if (0 < _Nskip) {
_Ch <<= 6; // get last byte on next call
}
if ((_Mymax < 0x10ffffu ? _Mymax : 0x10ffffu) < _Ch) {
return _Mybase::error; // value too large
}
if (0xffffu < _Ch) { // deliver first half of two-word value, save second word
unsigned short _Ch0 = static_cast<unsigned short>(0xd800 | (_Ch >> 10) - 0x0040);
*_Mid2++ = static_cast<_Elem>(_Ch0);
*_Pstate = static_cast<unsigned short>(0xdc00 | (_Ch & 0x03ff));
continue;
}
if (_Nskip != 0) {
if (_Mid1 == _Last1) { // not enough bytes, noncanonical value
_Mid1 = _First1;
break;
}
if ((_By = static_cast<unsigned char>(*_Mid1++)) < 0x80u || 0xc0u <= _By) {
return _Mybase::error; // not continuation byte
}
_Ch |= _By & 0x3f; // complete noncanonical value
}
if (*_Pstate == 0u) { // first time, maybe look for and consume header
*_Pstate = 1;
constexpr bool _Consuming = (_Mymode & consume_header) != 0;
if constexpr (_Consuming) {
if (_Ch == 0xfeffu) { // drop header and retry
result _Ans = do_in(_State, _Mid1, _Last1, _Mid1, _First2, _Last2, _Mid2);
if (_Ans == _Mybase::partial) { // roll back header determination
*_Pstate = 0;
_Mid1 = _First1;
}
return _Ans;
}
}
}
*_Mid2++ = static_cast<_Elem>(_Ch);
}
return _First1 == _Mid1 ? _Mybase::partial : _Mybase::ok;
}
result __CLR_OR_THIS_CALL do_out(_Statype& _State, const _Elem* _First1, const _Elem* _Last1, const _Elem*& _Mid1,
_Byte* _First2, _Byte* _Last2, _Byte*& _Mid2) const override {
// convert [_First1, _Last1) to bytes [_First2, _Last2)
unsigned short* _Pstate = reinterpret_cast<unsigned short*>(&_State);
_Mid1 = _First1;
_Mid2 = _First2;
while (_Mid1 != _Last1 && _Mid2 != _Last2) { // convert and put a wide char
unsigned long _Ch;
unsigned short _Ch1 = static_cast<unsigned short>(*_Mid1);
bool _Save = false;
if (1u < *_Pstate) { // get saved MS 11 bits from *_Pstate
if (_Ch1 < 0xdc00u || 0xe000u <= _Ch1) {
return _Mybase::error; // bad second word
}
_Ch = static_cast<unsigned long>((*_Pstate << 10) | (_Ch1 - 0xdc00));
} else if (0xd800u <= _Ch1 && _Ch1 < 0xdc00u) { // get new first word
_Ch = static_cast<unsigned long>((_Ch1 - 0xd800 + 0x0040) << 10);
_Save = true; // put only first byte, rest with second word
} else {
_Ch = _Ch1; // not first word, just put it
}
_Byte _By;
int _Nextra;
if (_Ch < 0x0080u) {
_By = static_cast<_Byte>(_Ch);
_Nextra = 0;
} else if (_Ch < 0x0800u) {
_By = static_cast<_Byte>(0xc0 | _Ch >> 6);
_Nextra = 1;
} else if (_Ch < 0x10000u) {
_By = static_cast<_Byte>(0xe0 | _Ch >> 12);
_Nextra = 2;
} else {
_By = static_cast<_Byte>(0xf0 | _Ch >> 18);
_Nextra = 3;
}
int _Nput = _Nextra < 3 ? _Nextra + 1 : _Save ? 1 : 3;
if (_Last2 - _Mid2 < _Nput) {
break; // not enough room, even without header
}
if constexpr ((_Mymode & generate_header) != 0) { // header to put
if (*_Pstate == 0u) {
if (_Last2 - _Mid2 < 3 + _Nput) {
break; // not enough room for header + output
}
// prepend header
*_Mid2++ = '\xef';
*_Mid2++ = '\xbb';
*_Mid2++ = '\xbf';
}
}
++_Mid1;
if (_Save || _Nextra < 3) { // put first byte of sequence, if not already put
*_Mid2++ = _By;
--_Nput;
}
for (; 0 < _Nput; --_Nput) {
*_Mid2++ = static_cast<_Byte>((_Ch >> 6 * --_Nextra & 0x3f) | 0x80);
}
*_Pstate = static_cast<unsigned short>(_Save ? _Ch >> 10 : 1);
}
return _First1 == _Mid1 ? _Mybase::partial : _Mybase::ok;
}
result __CLR_OR_THIS_CALL do_unshift(_Statype&, _Byte* _First2, _Byte*, _Byte*& _Mid2) const override {
// generate bytes to return to default shift state
_Mid2 = _First2;
return _Mybase::noconv;
}
friend int _Codecvt_do_length<>(const codecvt_utf8_utf16&, _Statype&, const _Byte*, const _Byte*, size_t);
int __CLR_OR_THIS_CALL do_length(
_Statype& _State, const _Byte* _First1, const _Byte* _Last1, size_t _Count) const noexcept override {
return _Codecvt_do_length(*this, _State, _First1, _Last1, _Count);
}
bool __CLR_OR_THIS_CALL do_always_noconv() const noexcept override {
// return true if conversions never change input
return false;
}
int __CLR_OR_THIS_CALL do_max_length() const noexcept override {
// return maximum length required for a conversion
if constexpr ((_Mymode & consume_header) != 0) {
return 9; // header + max input
} else if constexpr ((_Mymode & generate_header) != 0) {
return 7; // header + max output
} else {
return 6; // 6-byte max input sequence, no 3-byte header
}
}
int __CLR_OR_THIS_CALL do_encoding() const noexcept override {
// return length of code sequence (from codecvt)
return 0; // 0 => varying length
}
};
_STL_RESTORE_DEPRECATED_WARNING
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CODECVT_
@@ -0,0 +1,518 @@
/***
* comdef.h - Native C++ compiler COM support - main definitions header
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
****/
#pragma once
#if !defined(_INC_COMDEF)
#define _INC_COMDEF
#if !defined(RC_INVOKED)
#ifndef __cplusplus
#error Native Compiler support only available in C++ compiler
#endif
#ifdef _M_CEE_PURE
#error comdef.h header cannot be included under /clr:safe or /clr:pure
#endif
#ifdef WINAPI_FAMILY
#include <winapifamily.h>
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define _COMDEF_NOT_WINAPI_FAMILY_DESKTOP_APP
#endif /* !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#if defined WINAPI_FAMILY_PHONE_APP && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
#define _COMDEF_WINAPI_FAMILY_PHONE_APP
#endif /* defined WINAPI_FAMILY_PHONE_APP && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) */
#endif /* WINAPI_FAMILY */
#ifndef _COMDEF_WINAPI_FAMILY_PHONE_APP
#include <Ole2.h>
#include <comutil.h>
#endif /* _COMDEF_WINAPI_FAMILY_PHONE_APP */
#pragma warning(push)
#pragma warning(disable: 4244)
#ifdef _COMDEF_NOT_WINAPI_FAMILY_DESKTOP_APP
#include <roerrorapi.h>
#include <new.h>
#include <wchar.h>
inline void __stdcall _com_issue_error(HRESULT hr);
class _com_error
{
protected:
static wchar_t* AllocateString(const wchar_t* message)
{
wchar_t* value = nullptr;
if (message != nullptr)
{
auto length = ::wcslen(message) + 1; // add 1 for null terminator
value = new (std::nothrow) wchar_t[length];
if (value == nullptr)
{
_com_issue_error(E_OUTOFMEMORY);
}
::wmemcpy(value, message, length);
}
return value;
}
public:
_com_error(HRESULT hr, const wchar_t* message) : m_hr(hr), m_message(nullptr)
{
m_message = AllocateString(message);
}
_com_error(const _com_error& other)
{
m_hr = other.m_hr;
m_message = AllocateString(other.m_message);
}
_com_error(_com_error&& other)
{
m_hr = other.m_hr;
m_message = other.m_message;
other.m_message = nullptr;
}
~_com_error() throw()
{
delete [] m_message;
}
_com_error& operator=(const _com_error& other)
{
if (this != &other)
{
m_hr = other.m_hr;
delete [] m_message;
m_message = AllocateString(other.m_message);
}
return *this;
}
_com_error& operator=(_com_error&& other)
{
if (this != &other)
{
m_hr = other.m_hr;
delete [] m_message;
m_message = other.m_message;
other.m_message = nullptr;
}
return *this;
}
HRESULT Error() const throw()
{
return m_hr;
}
const wchar_t* ErrorMessage() const throw()
{
if (m_message == nullptr)
{
wchar_t buffer[4096];
if (::FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM,
nullptr,
m_hr,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
buffer,
_countof(buffer),
nullptr))
{
m_message = AllocateString(buffer);
}
}
return m_message;
}
protected:
HRESULT m_hr;
mutable wchar_t* m_message;
};
inline void __declspec(noreturn) __stdcall _com_raise_error(HRESULT hr, const wchar_t* message)
{
size_t length = (message == nullptr) ? 0 : ::wcslen(message);
if (UINT_MAX < length)
{
length = 0;
}
::Windows::Foundation::Diagnostics::OriginateError(hr, static_cast<unsigned int>(length), message);
throw _com_error(hr, message);
}
typedef void (__stdcall *__errorPfnType)(HRESULT hr, const wchar_t* message);
// throw exceptions by default
__declspec(selectany) __errorPfnType __errorPfn = &_com_raise_error;
inline void __stdcall _com_issue_errorex(HRESULT hr, const wchar_t* message)
{
__errorPfn(hr, message);
}
inline void __stdcall _com_issue_error(HRESULT hr)
{
__errorPfn(hr, nullptr);
}
inline void __stdcall _set_com_error_handler(void (__stdcall *pHandler)(HRESULT, const wchar_t*))
{
__errorPfn = pHandler;
}
#else
#include <OleCtl.h>
#ifdef _NATIVE_WCHAR_T_DEFINED
#if defined(_GUARDED_CRT)
# ifdef _DEBUG
# pragma comment(lib, "comsuppwgd.lib")
# else
# pragma comment(lib, "comsuppwg.lib")
# endif
#else
# ifdef _DEBUG
# pragma comment(lib, "comsuppwd.lib")
# else
# pragma comment(lib, "comsuppw.lib")
# endif
#endif
#else
#if defined(_GUARDED_CRT)
# ifdef _DEBUG
# pragma comment(lib, "comsuppgd.lib")
# else
# pragma comment(lib, "comsuppg.lib")
# endif
#else
# ifdef _DEBUG
# pragma comment(lib, "comsuppd.lib")
# else
# pragma comment(lib, "comsupp.lib")
# endif
#endif
#endif
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "ole32.lib")
#pragma comment(lib, "oleaut32.lib")
class _com_error;
void __declspec(noreturn) __stdcall
_com_raise_error(HRESULT hr, IErrorInfo* perrinfo = 0) ;
void __stdcall
_set_com_error_handler(void (__stdcall *pHandler)(HRESULT hr, IErrorInfo* perrinfo));
void __stdcall
_com_issue_error(HRESULT) ;
void __stdcall
_com_issue_errorex(HRESULT, IUnknown*, REFIID) ;
HRESULT __stdcall
_com_dispatch_propget(IDispatch*, DISPID, VARTYPE, void*) ;
HRESULT __cdecl
_com_dispatch_propput(IDispatch*, DISPID, VARTYPE, ...) ;
HRESULT __cdecl
_com_dispatch_method(IDispatch*, DISPID, WORD, VARTYPE, void*,
const wchar_t*, ...) ;
HRESULT __stdcall
_com_dispatch_raw_propget(IDispatch*, DISPID, VARTYPE, void*) throw();
HRESULT __cdecl
_com_dispatch_raw_propput(IDispatch*, DISPID, VARTYPE, ...) throw();
HRESULT __cdecl
_com_dispatch_raw_method(IDispatch*, DISPID, WORD, VARTYPE, void*,
const wchar_t*, ...) throw();
class _com_error {
public:
// Constructors
//
_com_error(HRESULT hr,
IErrorInfo* perrinfo = NULL,
bool fAddRef = false) throw();
_com_error(const _com_error& that) throw();
// Destructor
//
virtual ~_com_error() noexcept;
// Assignment operator
//
_com_error& operator=(const _com_error& that) throw();
// Accessors
//
HRESULT Error() const throw();
WORD WCode() const throw();
IErrorInfo * ErrorInfo() const throw();
// IErrorInfo method accessors
//
_bstr_t Description() const ;
DWORD HelpContext() const throw();
_bstr_t HelpFile() const ;
_bstr_t Source() const ;
GUID GUID() const throw();
// FormatMessage accessors
//
const TCHAR * ErrorMessage() const throw();
// EXCEPINFO.wCode <-> HRESULT mappers
//
static HRESULT WCodeToHRESULT(WORD wCode) throw();
static WORD HRESULTToWCode(HRESULT hr) throw();
private:
enum {
WCODE_HRESULT_FIRST = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x200),
WCODE_HRESULT_LAST = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF+1, 0) - 1
};
const HRESULT m_hresult;
IErrorInfo * m_perrinfo;
mutable TCHAR * m_pszMsg;
};
inline _com_error::_com_error(HRESULT hr,
IErrorInfo* perrinfo,
bool fAddRef) throw()
: m_hresult(hr), m_perrinfo(perrinfo), m_pszMsg(NULL)
{
if (m_perrinfo != NULL && fAddRef) {
m_perrinfo->AddRef();
}
}
inline _com_error::_com_error(const _com_error& that) throw()
: m_hresult(that.m_hresult), m_perrinfo(that.m_perrinfo), m_pszMsg(NULL)
{
if (m_perrinfo != NULL) {
m_perrinfo->AddRef();
}
}
inline _com_error::~_com_error() noexcept
{
if (m_perrinfo != NULL) {
m_perrinfo->Release();
}
if (m_pszMsg != NULL) {
LocalFree((HLOCAL)m_pszMsg);
}
}
inline _com_error& _com_error::operator=(const _com_error& that) throw()
{
if (this != &that) {
this->_com_error::~_com_error();
this->_com_error::_com_error(that);
}
return *this;
}
inline HRESULT _com_error::Error() const throw()
{
return m_hresult;
}
inline WORD _com_error::WCode() const throw()
{
return HRESULTToWCode(m_hresult);
}
inline IErrorInfo * _com_error::ErrorInfo() const throw()
{
if (m_perrinfo != NULL) {
m_perrinfo->AddRef();
}
return m_perrinfo;
}
inline _bstr_t _com_error::Description() const
{
BSTR bstr = NULL;
if (m_perrinfo != NULL) {
if (FAILED(m_perrinfo->GetDescription(&bstr))) {
bstr = NULL;
}
}
return _bstr_t(bstr, false);
}
inline DWORD _com_error::HelpContext() const throw()
{
DWORD dwHelpContext = 0;
if (m_perrinfo != NULL) {
if (FAILED(m_perrinfo->GetHelpContext(&dwHelpContext))) {
dwHelpContext = 0;
}
}
return dwHelpContext;
}
inline _bstr_t _com_error::HelpFile() const
{
BSTR bstr = NULL;
if (m_perrinfo != NULL) {
if (FAILED(m_perrinfo->GetHelpFile(&bstr))) {
bstr = NULL;
}
}
return _bstr_t(bstr, false);
}
inline _bstr_t _com_error::Source() const
{
BSTR bstr = NULL;
if (m_perrinfo != NULL) {
if (FAILED(m_perrinfo->GetSource(&bstr))) {
bstr = NULL;
}
}
return _bstr_t(bstr, false);
}
inline _GUID _com_error::GUID() const throw()
{
_GUID guid{};
if (m_perrinfo != NULL) {
if (FAILED(m_perrinfo->GetGUID(&guid))) {
guid = _GUID{};
}
}
return guid;
}
inline const TCHAR * _com_error::ErrorMessage() const throw()
{
if (m_pszMsg == NULL) {
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|
FORMAT_MESSAGE_FROM_SYSTEM|
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
m_hresult,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR)&m_pszMsg,
0,
NULL);
if (m_pszMsg != NULL) {
#ifdef UNICODE
size_t const nLen = wcslen(m_pszMsg);
#else
size_t const nLen = strlen(m_pszMsg);
#endif
if (nLen > 1 && m_pszMsg[nLen - 1] == '\n') {
m_pszMsg[nLen - 1] = 0;
if (m_pszMsg[nLen - 2] == '\r') {
m_pszMsg[nLen - 2] = 0;
}
}
}
else {
m_pszMsg = (LPTSTR)LocalAlloc(0, 32 * sizeof(TCHAR));
if (m_pszMsg != NULL) {
WORD wCode = WCode();
if (wCode != 0) {
_COM_PRINTF_S_1(m_pszMsg, 32, TEXT("IDispatch error #%d"), (int)wCode);
}
else {
_COM_PRINTF_S_1(m_pszMsg, 32, TEXT("Unknown error 0x%0lX"), m_hresult);
}
}
}
}
return m_pszMsg;
}
inline HRESULT _com_error::WCodeToHRESULT(WORD wCode) throw()
{
return wCode >= 0xFE00 ? WCODE_HRESULT_LAST : WCODE_HRESULT_FIRST + wCode;
}
inline WORD _com_error::HRESULTToWCode(HRESULT hr) throw()
{
return (hr >= WCODE_HRESULT_FIRST && hr <= WCODE_HRESULT_LAST)
? WORD(hr - WCODE_HRESULT_FIRST)
: 0;
}
//
// give missing types from dependent type libraries a chance
//
typedef int __missing_type__;
#if !defined(_COM_SMARTPTR)
#if !defined(_INC_COMIP)
#include <comip.h>
#endif
#define _COM_SMARTPTR _com_ptr_t
#define _COM_SMARTPTR_LEVEL2 _com_IIID
#endif
#if defined(_COM_SMARTPTR)
#if !defined(_COM_SMARTPTR_TYPEDEF)
#if defined(_COM_SMARTPTR_LEVEL2)
#define _COM_SMARTPTR_TYPEDEF(Interface, IID) \
typedef _COM_SMARTPTR<_COM_SMARTPTR_LEVEL2<Interface, &IID> > \
Interface ## Ptr
#else
#define _COM_SMARTPTR_TYPEDEF(Interface, IID) \
typedef _COM_SMARTPTR<Interface, &IID> \
Interface ## Ptr
#endif
#endif
#endif
#if !defined(_COM_NO_STANDARD_GUIDS_)
#if !defined(_ATL_MODULES)
// hard-coded smart pointer defs
#if defined(__IFontDisp_INTERFACE_DEFINED__)
__if_not_exists(Font)
{
struct Font : IFontDisp {};
}
_COM_SMARTPTR_TYPEDEF(Font, __uuidof(IDispatch));
#endif
#if defined(__IFontEventsDisp_INTERFACE_DEFINED__)
__if_not_exists(FontEvents)
{
struct FontEvents : IFontEventsDisp {};
}
_COM_SMARTPTR_TYPEDEF(FontEvents, __uuidof(IDispatch));
#endif
#if defined(__IPictureDisp_INTERFACE_DEFINED__)
__if_not_exists(Picture)
{
struct Picture : IPictureDisp {};
}
_COM_SMARTPTR_TYPEDEF(Picture, __uuidof(IDispatch));
#endif
#endif // !defined(_ATL_MODULES)
#include "comdefsp.h"
#endif /* !defined(_COM_NO_STANDARD_GUIDS_) */
#endif /* _COMDEF_NOT_WINAPI_FAMILY_DESKTOP_APP */
#pragma warning(pop)
#endif /* RC_INVOKED */
#endif /* _INC_COMDEF */
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,851 @@
// compare standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _COMPARE_
#define _COMPARE_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
_EMIT_STL_WARNING(STL4038, "The contents of <compare> are available only with C++20 or later.");
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#include <concepts>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
void _Literal_zero_is_expected();
struct _Literal_zero {
template <class _Ty>
requires is_same_v<_Ty, int>
consteval _Literal_zero(_Ty _Zero) noexcept {
// Can't use _STL_VERIFY because this is a core header
if (_Zero != 0) {
_Literal_zero_is_expected();
}
}
};
using _Compare_t = signed char;
// These "pretty" enumerator names are safe since they reuse names of user-facing entities.
enum class _Compare_eq : _Compare_t { equal = 0, equivalent = equal };
enum class _Compare_ord : _Compare_t { less = -1, greater = 1 };
enum class _Compare_ncmp : _Compare_t { unordered = -128 };
_EXPORT_STD struct partial_ordering {
static const partial_ordering less;
static const partial_ordering equivalent;
static const partial_ordering greater;
static const partial_ordering unordered;
_NODISCARD friend constexpr bool operator==(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == 0;
}
_NODISCARD friend constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default;
_NODISCARD friend constexpr bool operator<(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == static_cast<_Compare_t>(_Compare_ord::less);
}
_NODISCARD friend constexpr bool operator>(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value > 0;
}
_NODISCARD friend constexpr bool operator<=(const partial_ordering _Val, _Literal_zero) noexcept {
// The stored value is either less (0xff), equivalent (0x00), greater (0x01), or unordered (0x80).
// Subtracting from 0 produces either 0x01, 0x00, 0xff, or 0x80. The result is greater than or equal to 0
// if and only if the initial value was less or equivalent, for which we want to return true.
return static_cast<signed char>(0 - static_cast<unsigned int>(_Val._Value)) >= 0;
}
_NODISCARD friend constexpr bool operator>=(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value >= 0;
}
_NODISCARD friend constexpr bool operator<(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val > 0;
}
_NODISCARD friend constexpr bool operator>(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val < 0;
}
_NODISCARD friend constexpr bool operator<=(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val >= 0;
}
_NODISCARD friend constexpr bool operator>=(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val <= 0;
}
_NODISCARD friend constexpr partial_ordering operator<=>(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val;
}
_NODISCARD friend constexpr partial_ordering operator<=>(_Literal_zero, const partial_ordering _Val) noexcept {
// The stored value is either less (0xff), equivalent (0x00), greater (0x01), or unordered (0x80).
// Subtracting from 0 produces either 0x01, 0x00, 0xff, or 0x80. Note that the effect is to
// exchange less for greater (and vice versa), while leaving equivalent and unordered unchanged.
return {static_cast<_Compare_t>(0 - static_cast<unsigned int>(_Val._Value))};
}
_Compare_t _Value;
};
inline constexpr partial_ordering partial_ordering::less{static_cast<_Compare_t>(_Compare_ord::less)};
inline constexpr partial_ordering partial_ordering::equivalent{static_cast<_Compare_t>(_Compare_eq::equivalent)};
inline constexpr partial_ordering partial_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)};
inline constexpr partial_ordering partial_ordering::unordered{static_cast<_Compare_t>(_Compare_ncmp::unordered)};
_EXPORT_STD struct weak_ordering {
static const weak_ordering less;
static const weak_ordering equivalent;
static const weak_ordering greater;
constexpr operator partial_ordering() const noexcept {
return {static_cast<_Compare_t>(_Value)};
}
_NODISCARD friend constexpr bool operator==(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == 0;
}
_NODISCARD friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default;
_NODISCARD friend constexpr bool operator<(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value < 0;
}
_NODISCARD friend constexpr bool operator>(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value > 0;
}
_NODISCARD friend constexpr bool operator<=(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value <= 0;
}
_NODISCARD friend constexpr bool operator>=(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value >= 0;
}
_NODISCARD friend constexpr bool operator<(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val > 0;
}
_NODISCARD friend constexpr bool operator>(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val < 0;
}
_NODISCARD friend constexpr bool operator<=(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val >= 0;
}
_NODISCARD friend constexpr bool operator>=(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val <= 0;
}
_NODISCARD friend constexpr weak_ordering operator<=>(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val;
}
_NODISCARD friend constexpr weak_ordering operator<=>(_Literal_zero, const weak_ordering _Val) noexcept {
return {static_cast<_Compare_t>(-_Val._Value)};
}
_Compare_t _Value;
};
inline constexpr weak_ordering weak_ordering::less{static_cast<_Compare_t>(_Compare_ord::less)};
inline constexpr weak_ordering weak_ordering::equivalent{static_cast<_Compare_t>(_Compare_eq::equivalent)};
inline constexpr weak_ordering weak_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)};
_EXPORT_STD struct strong_ordering {
static const strong_ordering less;
static const strong_ordering equal;
static const strong_ordering equivalent;
static const strong_ordering greater;
constexpr operator partial_ordering() const noexcept {
return {static_cast<_Compare_t>(_Value)};
}
constexpr operator weak_ordering() const noexcept {
return {static_cast<_Compare_t>(_Value)};
}
_NODISCARD friend constexpr bool operator==(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == 0;
}
_NODISCARD friend constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default;
_NODISCARD friend constexpr bool operator<(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value < 0;
}
_NODISCARD friend constexpr bool operator>(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value > 0;
}
_NODISCARD friend constexpr bool operator<=(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value <= 0;
}
_NODISCARD friend constexpr bool operator>=(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value >= 0;
}
_NODISCARD friend constexpr bool operator<(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val > 0;
}
_NODISCARD friend constexpr bool operator>(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val < 0;
}
_NODISCARD friend constexpr bool operator<=(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val >= 0;
}
_NODISCARD friend constexpr bool operator>=(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val <= 0;
}
_NODISCARD friend constexpr strong_ordering operator<=>(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val;
}
_NODISCARD friend constexpr strong_ordering operator<=>(_Literal_zero, const strong_ordering _Val) noexcept {
return {static_cast<_Compare_t>(-_Val._Value)};
}
_Compare_t _Value;
};
inline constexpr strong_ordering strong_ordering::less{static_cast<_Compare_t>(_Compare_ord::less)};
inline constexpr strong_ordering strong_ordering::equal{static_cast<_Compare_t>(_Compare_eq::equal)};
inline constexpr strong_ordering strong_ordering::equivalent{static_cast<_Compare_t>(_Compare_eq::equivalent)};
inline constexpr strong_ordering strong_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)};
_EXPORT_STD _NODISCARD constexpr bool is_eq(const partial_ordering _Comp) noexcept {
return _Comp == 0;
}
_EXPORT_STD _NODISCARD constexpr bool is_neq(const partial_ordering _Comp) noexcept {
return _Comp != 0;
}
_EXPORT_STD _NODISCARD constexpr bool is_lt(const partial_ordering _Comp) noexcept {
return _Comp < 0;
}
_EXPORT_STD _NODISCARD constexpr bool is_lteq(const partial_ordering _Comp) noexcept {
return _Comp <= 0;
}
_EXPORT_STD _NODISCARD constexpr bool is_gt(const partial_ordering _Comp) noexcept {
return _Comp > 0;
}
_EXPORT_STD _NODISCARD constexpr bool is_gteq(const partial_ordering _Comp) noexcept {
return _Comp >= 0;
}
enum _Comparison_category : unsigned char {
_Comparison_category_none = 1,
_Comparison_category_partial = 2,
_Comparison_category_weak = 4,
_Comparison_category_strong = 0,
};
template <class... _Types>
constexpr unsigned char _Classify_category =
_Comparison_category{(_Classify_category<_Types> | ... | _Comparison_category_strong)};
template <class _Ty>
constexpr unsigned char _Classify_category<_Ty> = _Comparison_category_none;
template <>
inline constexpr unsigned char _Classify_category<partial_ordering> = _Comparison_category_partial;
template <>
inline constexpr unsigned char _Classify_category<weak_ordering> = _Comparison_category_weak;
template <>
inline constexpr unsigned char _Classify_category<strong_ordering> = _Comparison_category_strong;
_EXPORT_STD template <class... _Types>
using common_comparison_category_t =
conditional_t<((_Classify_category<_Types...> & _Comparison_category_none) != 0), void,
conditional_t<((_Classify_category<_Types...> & _Comparison_category_partial) != 0), partial_ordering,
conditional_t<((_Classify_category<_Types...> & _Comparison_category_weak) != 0), weak_ordering,
strong_ordering>>>;
_EXPORT_STD template <class... _Types>
struct common_comparison_category {
using type = common_comparison_category_t<_Types...>;
};
template <class _Ty, class _Cat>
concept _Compares_as = same_as<common_comparison_category_t<_Ty, _Cat>, _Cat>;
_EXPORT_STD template <class _Ty, class _Cat = partial_ordering>
concept three_way_comparable = _Half_equality_comparable<_Ty, _Ty> && _Half_ordered<_Ty, _Ty>
&& requires(const remove_reference_t<_Ty>& __a, const remove_reference_t<_Ty>& __b) {
{ __a <=> __b } -> _Compares_as<_Cat>;
};
_EXPORT_STD template <class _Ty1, class _Ty2, class _Cat = partial_ordering>
concept three_way_comparable_with =
three_way_comparable<_Ty1, _Cat> && three_way_comparable<_Ty2, _Cat>
#if _HAS_CXX23
&& _Comparison_common_type_with<_Ty1, _Ty2>
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
&& common_reference_with<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>
#endif // ^^^ !_HAS_CXX23 ^^^
&& three_way_comparable<common_reference_t<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>, _Cat>
&& _Weakly_equality_comparable_with<_Ty1, _Ty2> && _Partially_ordered_with<_Ty1, _Ty2>
&& requires(const remove_reference_t<_Ty1>& __t, const remove_reference_t<_Ty2>& __u) {
{ __t <=> __u } -> _Compares_as<_Cat>;
{ __u <=> __t } -> _Compares_as<_Cat>;
};
_EXPORT_STD template <class _Ty1, class _Ty2 = _Ty1>
using compare_three_way_result_t =
decltype(_STD declval<const remove_reference_t<_Ty1>&>() <=> _STD declval<const remove_reference_t<_Ty2>&>());
_EXPORT_STD template <class _Ty1, class _Ty2 = _Ty1>
struct compare_three_way_result {};
template <class _Ty1, class _Ty2>
requires requires { typename compare_three_way_result_t<_Ty1, _Ty2>; }
struct compare_three_way_result<_Ty1, _Ty2> {
using type = compare_three_way_result_t<_Ty1, _Ty2>;
};
_EXPORT_STD struct compare_three_way {
template <class _Ty1, class _Ty2>
requires three_way_comparable_with<_Ty1, _Ty2>
_NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const
noexcept(noexcept(_STD forward<_Ty1>(_Left) <=> _STD forward<_Ty2>(_Right))) /* strengthened */ {
return _STD forward<_Ty1>(_Left) <=> _STD forward<_Ty2>(_Right);
}
using is_transparent = int;
};
struct _Synth_three_way {
template <class _Ty1, class _Ty2>
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
const _Ty1& _Left, const _Ty2& _Right) _CONST_CALL_OPERATOR
requires requires {
{ _Left < _Right } -> _Boolean_testable;
{ _Right < _Left } -> _Boolean_testable;
}
{
if constexpr (three_way_comparable_with<_Ty1, _Ty2>) {
return _Left <=> _Right;
} else {
if (_Left < _Right) {
return weak_ordering::less;
} else if (_Right < _Left) {
return weak_ordering::greater;
} else {
return weak_ordering::equivalent;
}
}
}
};
template <class _Ty1, class _Ty2 = _Ty1>
using _Synth_three_way_result = decltype(_Synth_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()));
// Note: The following CPOs are passing arguments as lvalues; see GH-1374.
namespace _Strong_order {
#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1681199
void strong_order() = delete; // Block unqualified name lookup
#else // ^^^ no workaround / workaround vvv
void strong_order();
#endif // ^^^ workaround ^^^
template <class _Ty1, class _Ty2>
concept _Has_ADL = requires(_Ty1& _Left, _Ty2& _Right) {
static_cast<strong_ordering>(strong_order(_Left, _Right)); // intentional ADL
};
template <class _Ty1, class _Ty2>
concept _Can_compare_three_way =
requires(_Ty1& _Left, _Ty2& _Right) { static_cast<strong_ordering>(compare_three_way{}(_Left, _Right)); };
class _Cpo {
private:
enum class _St { _None, _Adl, _Floating, _Three };
template <class _Ty1, class _Ty2>
_NODISCARD static consteval _Choice_t<_St> _Choose() noexcept {
if constexpr (!same_as<decay_t<_Ty1>, decay_t<_Ty2>>) {
return {_St::_None};
} else if constexpr (_Has_ADL<_Ty1, _Ty2>) {
return {_St::_Adl, noexcept(static_cast<strong_ordering>(
strong_order(_STD declval<_Ty1&>(), _STD declval<_Ty2&>())))}; // intentional ADL
} else if constexpr (floating_point<decay_t<_Ty1>>) {
return {_St::_Floating, true};
} else if constexpr (_Can_compare_three_way<_Ty1, _Ty2>) {
return {_St::_Three, noexcept(static_cast<strong_ordering>(
compare_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>())))};
} else {
return {_St::_None};
}
}
template <class _Ty1, class _Ty2>
static constexpr _Choice_t<_St> _Choice = _Choose<_Ty1, _Ty2>();
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD _STATIC_CALL_OPERATOR constexpr strong_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Adl) {
return static_cast<strong_ordering>(strong_order(_Left, _Right)); // intentional ADL
} else if constexpr (_Strat == _St::_Floating) {
using _Floating_type = decay_t<_Ty1>;
using _Traits = _Floating_type_traits<_Floating_type>;
using _Uint_type = _Traits::_Uint_type;
using _Sint_type = make_signed_t<_Uint_type>;
const auto _Left_uint = _Bit_cast<_Uint_type>(_Left);
const auto _Right_uint = _Bit_cast<_Uint_type>(_Right);
// 1. Ultra-fast path: equal representations are equal.
if (_Left_uint == _Right_uint) {
return strong_ordering::equal;
}
// 2. Examine the sign bits.
const _Uint_type _Left_shifted_sign = _Left_uint & _Traits::_Shifted_sign_mask;
const _Uint_type _Right_shifted_sign = _Right_uint & _Traits::_Shifted_sign_mask;
// 3. Interpret floating-point bit patterns as sign magnitude representations of integers,
// and then transform them into ones' complement representation.
// (Ones' complement representations of positive zero and negative zero are different.)
const _Uint_type _Left_sign = _Left_shifted_sign >> _Traits::_Sign_shift;
const _Uint_type _Right_sign = _Right_shifted_sign >> _Traits::_Sign_shift;
const _Uint_type _Left_xor = _Left_shifted_sign - _Left_sign;
const _Uint_type _Right_xor = _Right_shifted_sign - _Right_sign;
const _Uint_type _Left_ones_complement_uint = _Left_uint ^ _Left_xor;
const _Uint_type _Right_ones_complement_uint = _Right_uint ^ _Right_xor;
const auto _Left_ones_complement = static_cast<_Sint_type>(_Left_ones_complement_uint);
const auto _Right_ones_complement = static_cast<_Sint_type>(_Right_ones_complement_uint);
// 4. Perform the final comparison.
return _Left_ones_complement <=> _Right_ones_complement;
} else if constexpr (_Strat == _St::_Three) {
return static_cast<strong_ordering>(compare_three_way{}(_Left, _Right));
} else {
_STL_INTERNAL_STATIC_ASSERT(false); // unexpected strategy
}
}
};
} // namespace _Strong_order
inline namespace _Cpos {
_EXPORT_STD inline constexpr _Strong_order::_Cpo strong_order;
}
namespace _Weak_order {
#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1681199
void weak_order() = delete; // Block unqualified name lookup
#else // ^^^ no workaround / workaround vvv
void weak_order();
#endif // ^^^ workaround ^^^
template <class _Ty1, class _Ty2>
concept _Has_ADL = requires(_Ty1& _Left, _Ty2& _Right) {
static_cast<weak_ordering>(weak_order(_Left, _Right)); // intentional ADL
};
template <class _Ty1, class _Ty2>
concept _Can_compare_three_way =
requires(_Ty1& _Left, _Ty2& _Right) { static_cast<weak_ordering>(compare_three_way{}(_Left, _Right)); };
// Throughput optimization: attempting to use _STD strong_order will always select ADL strong_order here.
#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1681199
void strong_order() = delete; // Block unqualified name lookup
#else // ^^^ no workaround / workaround vvv
void strong_order();
#endif // ^^^ workaround ^^^
class _Cpo {
private:
enum class _St { _None, _Adl, _Floating, _Three, _Strong };
template <class _Ty1, class _Ty2>
_NODISCARD static consteval _Choice_t<_St> _Choose() noexcept {
if constexpr (!same_as<decay_t<_Ty1>, decay_t<_Ty2>>) {
return {_St::_None};
} else if constexpr (_Has_ADL<_Ty1, _Ty2>) {
return {_St::_Adl, noexcept(static_cast<weak_ordering>(
weak_order(_STD declval<_Ty1&>(), _STD declval<_Ty2&>())))}; // intentional ADL
} else if constexpr (floating_point<decay_t<_Ty1>>) {
return {_St::_Floating, true};
} else if constexpr (_Can_compare_three_way<_Ty1, _Ty2>) {
return {_St::_Three, noexcept(static_cast<weak_ordering>(
compare_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>())))};
} else if constexpr (_Strong_order::_Has_ADL<_Ty1, _Ty2>) {
// throughput optimization (see above):
return {_St::_Strong, noexcept(static_cast<weak_ordering>(static_cast<strong_ordering>(strong_order(
_STD declval<_Ty1&>(), _STD declval<_Ty2&>()))))}; // intentional ADL
} else {
return {_St::_None};
}
}
template <class _Ty1, class _Ty2>
static constexpr _Choice_t<_St> _Choice = _Choose<_Ty1, _Ty2>();
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD _STATIC_CALL_OPERATOR constexpr weak_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Adl) {
return static_cast<weak_ordering>(weak_order(_Left, _Right)); // intentional ADL
} else if constexpr (_Strat == _St::_Floating) {
using _Floating_type = decay_t<_Ty1>;
using _Traits = _Floating_type_traits<_Floating_type>;
using _Uint_type = _Traits::_Uint_type;
using _Sint_type = make_signed_t<_Uint_type>;
auto _Left_uint = _Bit_cast<_Uint_type>(_Left);
auto _Right_uint = _Bit_cast<_Uint_type>(_Right);
// 1. Ultra-fast path: equal representations are equivalent.
if (_Left_uint == _Right_uint) {
return weak_ordering::equivalent;
}
// 2. Examine the sign bits.
const _Uint_type _Left_shifted_sign = _Left_uint & _Traits::_Shifted_sign_mask;
const _Uint_type _Right_shifted_sign = _Right_uint & _Traits::_Shifted_sign_mask;
// 3. Fold all NaN values together.
// (The fact that _Infinity_plus_one represents a signaling NaN is irrelevant here.)
constexpr _Uint_type _Infinity_plus_one = _Traits::_Shifted_exponent_mask + 1;
const _Uint_type _Left_magnitude = _Left_uint & ~_Traits::_Shifted_sign_mask;
const _Uint_type _Right_magnitude = _Right_uint & ~_Traits::_Shifted_sign_mask;
if (_Left_magnitude > _Infinity_plus_one) {
_Left_uint = _Left_shifted_sign | _Infinity_plus_one;
}
if (_Right_magnitude > _Infinity_plus_one) {
_Right_uint = _Right_shifted_sign | _Infinity_plus_one;
}
// 4. Interpret floating-point bit patterns as sign magnitude representations of integers,
// and then transform them into two's complement representation.
// (Two's complement representations of positive zero and negative zero are the same.)
const _Uint_type _Left_sign = _Left_shifted_sign >> _Traits::_Sign_shift;
const _Uint_type _Right_sign = _Right_shifted_sign >> _Traits::_Sign_shift;
const _Uint_type _Left_xor = _Left_shifted_sign - _Left_sign;
const _Uint_type _Right_xor = _Right_shifted_sign - _Right_sign;
const _Uint_type _Left_twos_complement_uint = (_Left_uint ^ _Left_xor) + _Left_sign;
const _Uint_type _Right_twos_complement_uint = (_Right_uint ^ _Right_xor) + _Right_sign;
const auto _Left_twos_complement = static_cast<_Sint_type>(_Left_twos_complement_uint);
const auto _Right_twos_complement = static_cast<_Sint_type>(_Right_twos_complement_uint);
// 5. Perform the final comparison.
return static_cast<weak_ordering>(_Left_twos_complement <=> _Right_twos_complement);
} else if constexpr (_Strat == _St::_Three) {
return static_cast<weak_ordering>(compare_three_way{}(_Left, _Right));
} else if constexpr (_Strat == _St::_Strong) {
// throughput optimization (see above):
return static_cast<weak_ordering>(
static_cast<strong_ordering>(strong_order(_Left, _Right))); // intentional ADL
} else {
_STL_INTERNAL_STATIC_ASSERT(false); // unexpected strategy
}
}
};
} // namespace _Weak_order
inline namespace _Cpos {
_EXPORT_STD inline constexpr _Weak_order::_Cpo weak_order;
}
namespace _Partial_order {
#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1681199
void partial_order() = delete; // Block unqualified name lookup
#else // ^^^ no workaround / workaround vvv
void partial_order();
#endif // ^^^ workaround ^^^
template <class _Ty1, class _Ty2>
concept _Has_ADL = requires(_Ty1& _Left, _Ty2& _Right) {
static_cast<partial_ordering>(partial_order(_Left, _Right)); // intentional ADL
};
template <class _Ty1, class _Ty2>
concept _Can_compare_three_way =
requires(_Ty1& _Left, _Ty2& _Right) { static_cast<partial_ordering>(compare_three_way{}(_Left, _Right)); };
// Throughput optimization: attempting to use _STD weak_order
// will attempt to select ADL weak_order, followed by ADL strong_order, here.
#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1681199
void weak_order() = delete; // Block unqualified name lookup
void strong_order() = delete; // Block unqualified name lookup
#else // ^^^ no workaround / workaround vvv
void weak_order();
void strong_order();
#endif // ^^^ workaround ^^^
class _Cpo {
private:
enum class _St { _None, _Adl, _Three, _Weak, _Strong };
template <class _Ty1, class _Ty2>
_NODISCARD static consteval _Choice_t<_St> _Choose() noexcept {
if constexpr (!same_as<decay_t<_Ty1>, decay_t<_Ty2>>) {
return {_St::_None};
} else if constexpr (_Has_ADL<_Ty1, _Ty2>) {
return {_St::_Adl, noexcept(static_cast<partial_ordering>(partial_order(
_STD declval<_Ty1&>(), _STD declval<_Ty2&>())))}; // intentional ADL
} else if constexpr (_Can_compare_three_way<_Ty1, _Ty2>) {
return {_St::_Three, noexcept(static_cast<partial_ordering>(
compare_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>())))};
} else if constexpr (_Weak_order::_Has_ADL<_Ty1, _Ty2>) {
// throughput optimization (see above):
return {_St::_Weak, noexcept(static_cast<partial_ordering>(static_cast<weak_ordering>(
weak_order(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()))))}; // intentional ADL
} else if constexpr (_Strong_order::_Has_ADL<_Ty1, _Ty2>) {
// throughput optimization (see above):
return {_St::_Strong, noexcept(static_cast<partial_ordering>(static_cast<strong_ordering>(strong_order(
_STD declval<_Ty1&>(), _STD declval<_Ty2&>()))))}; // intentional ADL
} else {
return {_St::_None};
}
}
template <class _Ty1, class _Ty2>
static constexpr _Choice_t<_St> _Choice = _Choose<_Ty1, _Ty2>();
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD _STATIC_CALL_OPERATOR constexpr partial_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Adl) {
return static_cast<partial_ordering>(/* ADL */ partial_order(_Left, _Right));
} else if constexpr (_Strat == _St::_Three) {
return static_cast<partial_ordering>(compare_three_way{}(_Left, _Right));
} else if constexpr (_Strat == _St::_Weak) {
// throughput optimization (see above):
return static_cast<partial_ordering>(
static_cast<weak_ordering>(weak_order(_Left, _Right))); // intentional ADL
} else if constexpr (_Strat == _St::_Strong) {
// throughput optimization (see above):
return static_cast<partial_ordering>(
static_cast<strong_ordering>(strong_order(_Left, _Right))); // intentional ADL
} else {
_STL_INTERNAL_STATIC_ASSERT(false); // unexpected strategy
}
}
};
} // namespace _Partial_order
inline namespace _Cpos {
_EXPORT_STD inline constexpr _Partial_order::_Cpo partial_order;
}
template <class _Ty1, class _Ty2>
concept _Can_fallback_eq_lt = requires(_Ty1& _Left, _Ty2& _Right) {
{ _Left == _Right } -> _Boolean_testable;
{ _Left < _Right } -> _Boolean_testable;
};
template <class _Ty1, class _Ty2>
concept _Can_strong_order = requires(_Ty1& _Left, _Ty2& _Right) { _STD strong_order(_Left, _Right); };
namespace _Compare_strong_order_fallback {
class _Cpo {
private:
enum class _St { _None, _Strong, _Fallback };
template <class _Ty1, class _Ty2>
_NODISCARD static consteval _Choice_t<_St> _Choose() noexcept {
if constexpr (!same_as<decay_t<_Ty1>, decay_t<_Ty2>>) {
return {_St::_None};
} else if constexpr (_Can_strong_order<_Ty1, _Ty2>) {
return {_St::_Strong, noexcept(_STD strong_order(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()))};
} else if constexpr (_Can_fallback_eq_lt<_Ty1, _Ty2>) {
return {_St::_Fallback,
noexcept(_STD declval<_Ty1&>() == _STD declval<_Ty2&>() ? strong_ordering::equal
: _STD declval<_Ty1&>() < _STD declval<_Ty2&>() ? strong_ordering::less
: strong_ordering::greater)};
} else {
return {_St::_None};
}
}
template <class _Ty1, class _Ty2>
static constexpr _Choice_t<_St> _Choice = _Choose<_Ty1, _Ty2>();
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD _STATIC_CALL_OPERATOR constexpr strong_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Strong) {
return _STD strong_order(_Left, _Right);
} else if constexpr (_Strat == _St::_Fallback) {
return _Left == _Right ? strong_ordering::equal
: _Left < _Right ? strong_ordering::less
: strong_ordering::greater;
} else {
_STL_INTERNAL_STATIC_ASSERT(false); // unexpected strategy
}
}
};
} // namespace _Compare_strong_order_fallback
inline namespace _Cpos {
_EXPORT_STD inline constexpr _Compare_strong_order_fallback::_Cpo compare_strong_order_fallback;
}
template <class _Ty1, class _Ty2>
concept _Can_weak_order = requires(_Ty1& _Left, _Ty2& _Right) { _STD weak_order(_Left, _Right); };
namespace _Compare_weak_order_fallback {
class _Cpo {
private:
enum class _St { _None, _Weak, _Fallback };
template <class _Ty1, class _Ty2>
_NODISCARD static consteval _Choice_t<_St> _Choose() noexcept {
if constexpr (!same_as<decay_t<_Ty1>, decay_t<_Ty2>>) {
return {_St::_None};
} else if constexpr (_Can_weak_order<_Ty1, _Ty2>) {
return {_St::_Weak, noexcept(_STD weak_order(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()))};
} else if constexpr (_Can_fallback_eq_lt<_Ty1, _Ty2>) {
return {
_St::_Fallback, noexcept(_STD declval<_Ty1&>() == _STD declval<_Ty2&>() ? weak_ordering::equivalent
: _STD declval<_Ty1&>() < _STD declval<_Ty2&>() ? weak_ordering::less
: weak_ordering::greater)};
} else {
return {_St::_None};
}
}
template <class _Ty1, class _Ty2>
static constexpr _Choice_t<_St> _Choice = _Choose<_Ty1, _Ty2>();
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD _STATIC_CALL_OPERATOR constexpr weak_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Weak) {
return _STD weak_order(_Left, _Right);
} else if constexpr (_Strat == _St::_Fallback) {
return _Left == _Right ? weak_ordering::equivalent
: _Left < _Right ? weak_ordering::less
: weak_ordering::greater;
} else {
_STL_INTERNAL_STATIC_ASSERT(false); // unexpected strategy
}
}
};
} // namespace _Compare_weak_order_fallback
inline namespace _Cpos {
_EXPORT_STD inline constexpr _Compare_weak_order_fallback::_Cpo compare_weak_order_fallback;
}
template <class _Ty1, class _Ty2>
concept _Can_partial_order = requires(_Ty1& _Left, _Ty2& _Right) { _STD partial_order(_Left, _Right); };
namespace _Compare_partial_order_fallback {
template <class _Ty1, class _Ty2>
concept _Can_fallback_eq_lt_twice = requires(_Ty1& _Left, _Ty2& _Right) {
{ _Left == _Right } -> _Boolean_testable;
{ _Left < _Right } -> _Boolean_testable;
{ _Right < _Left } -> _Boolean_testable;
};
class _Cpo {
private:
enum class _St { _None, _Partial, _Fallback };
template <class _Ty1, class _Ty2>
_NODISCARD static consteval _Choice_t<_St> _Choose() noexcept {
if constexpr (!same_as<decay_t<_Ty1>, decay_t<_Ty2>>) {
return {_St::_None};
} else if constexpr (_Can_partial_order<_Ty1, _Ty2>) {
return {_St::_Partial, noexcept(_STD partial_order(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()))};
} else if constexpr (_Can_fallback_eq_lt_twice<_Ty1, _Ty2>) {
return {_St::_Fallback,
noexcept(_STD declval<_Ty1&>() == _STD declval<_Ty2&>() ? partial_ordering::equivalent
: _STD declval<_Ty1&>() < _STD declval<_Ty2&>() ? partial_ordering::less
: _STD declval<_Ty2&>() < _STD declval<_Ty1&>() ? partial_ordering::greater
: partial_ordering::unordered)};
} else {
return {_St::_None};
}
}
template <class _Ty1, class _Ty2>
static constexpr _Choice_t<_St> _Choice = _Choose<_Ty1, _Ty2>();
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD _STATIC_CALL_OPERATOR constexpr partial_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Partial) {
return _STD partial_order(_Left, _Right);
} else if constexpr (_Strat == _St::_Fallback) {
return _Left == _Right ? partial_ordering::equivalent
: _Left < _Right ? partial_ordering::less
: _Right < _Left ? partial_ordering::greater
: partial_ordering::unordered;
} else {
_STL_INTERNAL_STATIC_ASSERT(false); // unexpected strategy
}
}
};
} // namespace _Compare_partial_order_fallback
inline namespace _Cpos {
_EXPORT_STD inline constexpr _Compare_partial_order_fallback::_Cpo compare_partial_order_fallback;
}
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _HAS_CXX20
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _COMPARE_
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,286 @@
// concepts standard header (core)
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef _CONCEPTS_
#define _CONCEPTS_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
_EMIT_STL_WARNING(STL4038, "The contents of <concepts> are available only with C++20 or later.");
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#include <type_traits>
#include <vcruntime_new.h>
#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
template <class _Ty1, class _Ty2>
concept _Same_impl = // Must be a distinct concept to provide symmetric subsumption for same_as
#ifdef __clang__
__is_same(_Ty1, _Ty2);
#else // ^^^ use intrinsic / no intrinsic vvv
is_same_v<_Ty1, _Ty2>;
#endif // ^^^ no intrinsic ^^^
_EXPORT_STD template <class _Ty1, class _Ty2>
concept same_as = _Same_impl<_Ty1, _Ty2> && _Same_impl<_Ty2, _Ty1>;
_EXPORT_STD template <class _Derived, class _Base>
concept derived_from =
__is_base_of(_Base, _Derived) && __is_convertible_to(const volatile _Derived*, const volatile _Base*);
template <class _From, class _To>
concept _Implicitly_convertible_to = is_convertible_v<_From, _To>;
_EXPORT_STD template <class _Ty1, class _Ty2>
concept common_reference_with =
requires {
typename common_reference_t<_Ty1, _Ty2>;
typename common_reference_t<_Ty2, _Ty1>;
} && same_as<common_reference_t<_Ty1, _Ty2>, common_reference_t<_Ty2, _Ty1>>
&& convertible_to<_Ty1, common_reference_t<_Ty1, _Ty2>> && convertible_to<_Ty2, common_reference_t<_Ty1, _Ty2>>;
// clang-format off
_EXPORT_STD template <class _Ty1, class _Ty2>
concept common_with =
requires {
typename common_type_t<_Ty1, _Ty2>;
typename common_type_t<_Ty2, _Ty1>;
}
&& same_as<common_type_t<_Ty1, _Ty2>, common_type_t<_Ty2, _Ty1>>
&& requires {
static_cast<common_type_t<_Ty1, _Ty2>>(_STD declval<_Ty1>());
static_cast<common_type_t<_Ty1, _Ty2>>(_STD declval<_Ty2>());
}
&& common_reference_with<add_lvalue_reference_t<const _Ty1>, add_lvalue_reference_t<const _Ty2>>
&& common_reference_with<add_lvalue_reference_t<common_type_t<_Ty1, _Ty2>>,
common_reference_t<add_lvalue_reference_t<const _Ty1>, add_lvalue_reference_t<const _Ty2>>>;
// clang-format on
_EXPORT_STD template <class _Ty>
concept integral = is_integral_v<_Ty>;
_EXPORT_STD template <class _Ty>
concept signed_integral = integral<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0);
_EXPORT_STD template <class _Ty>
concept unsigned_integral = integral<_Ty> && !signed_integral<_Ty>;
_EXPORT_STD template <class _Ty>
concept floating_point = is_floating_point_v<_Ty>;
_EXPORT_STD template <class _LTy, class _RTy>
concept assignable_from = is_lvalue_reference_v<_LTy>
&& common_reference_with<const remove_reference_t<_LTy>&, const remove_reference_t<_RTy>&>
&& requires(_LTy _Left, _RTy&& _Right) {
{ _Left = static_cast<_RTy&&>(_Right) } -> same_as<_LTy>;
};
// swappable and swappable_with are defined below, since they depend on move_constructible.
_EXPORT_STD template <class _Ty>
concept destructible = __is_nothrow_destructible(_Ty);
_EXPORT_STD template <class _Ty, class... _ArgTys>
concept constructible_from = destructible<_Ty> && __is_constructible(_Ty, _ArgTys...);
_EXPORT_STD template <class _Ty>
concept default_initializable = constructible_from<_Ty> && requires {
_Ty{};
::new (static_cast<void*>(nullptr)) _Ty; // is-default-initializable<_Ty>
};
_EXPORT_STD template <class _Ty>
concept move_constructible = constructible_from<_Ty, _Ty> && convertible_to<_Ty, _Ty>;
template <class _Ty>
concept _Has_class_or_enum_type =
__is_class(remove_reference_t<_Ty>) || __is_enum(remove_reference_t<_Ty>) || __is_union(remove_reference_t<_Ty>);
namespace ranges {
namespace _Swap {
template <class _Ty>
void swap(_Ty&, _Ty&) = delete;
template <class _Ty1, class _Ty2>
concept _Use_ADL_swap =
(_Has_class_or_enum_type<_Ty1> || _Has_class_or_enum_type<_Ty2>) && requires(_Ty1&& __t, _Ty2&& __u) {
swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); // intentional ADL
};
struct _Cpo {
template <class _Ty1, class _Ty2>
requires _Use_ADL_swap<_Ty1, _Ty2>
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty1&& __t, _Ty2&& __u) _CONST_CALL_OPERATOR
noexcept(noexcept(swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)))) { // intentional ADL
swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); // intentional ADL
}
template <class _Ty>
requires (!_Use_ADL_swap<_Ty&, _Ty&> && move_constructible<_Ty> && assignable_from<_Ty&, _Ty>)
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty& __x, _Ty& __y) _CONST_CALL_OPERATOR
noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) {
_Ty __tmp(static_cast<_Ty&&>(__x));
__x = static_cast<_Ty&&>(__y);
__y = static_cast<_Ty&&>(__tmp);
}
template <class _Ty1, class _Ty2, size_t _Size>
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty1 (&__t)[_Size], _Ty2 (&__u)[_Size]) _CONST_CALL_OPERATOR
noexcept(noexcept(operator()(__t[0], __u[0])))
requires requires(_Cpo __fn) { __fn(__t[0], __u[0]); }
{
if constexpr (is_same_v<_Ty1, _Ty2> && _Is_trivially_swappable_v<_Ty1>) {
if (!_STD is_constant_evaluated()) {
_STD _Swap_trivial_arrays(__t, __u);
return;
}
}
for (size_t __i = 0; __i < _Size; ++__i) {
operator()(__t[__i], __u[__i]);
}
}
};
} // namespace _Swap
inline namespace _Cpos {
_EXPORT_STD inline constexpr _Swap::_Cpo swap;
}
} // namespace ranges
_EXPORT_STD template <class _Ty>
concept swappable = requires(_Ty& __x, _Ty& __y) { _RANGES swap(__x, __y); };
_EXPORT_STD template <class _Ty1, class _Ty2>
concept swappable_with = common_reference_with<_Ty1, _Ty2> && requires(_Ty1&& __t, _Ty2&& __u) {
_RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty1&&>(__t));
_RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty2&&>(__u));
_RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u));
_RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t));
};
_EXPORT_STD template <class _Ty>
concept copy_constructible = move_constructible<_Ty> && constructible_from<_Ty, _Ty&> && convertible_to<_Ty&, _Ty>
&& constructible_from<_Ty, const _Ty&> && convertible_to<const _Ty&, _Ty>
&& constructible_from<_Ty, const _Ty> && convertible_to<const _Ty, _Ty>;
template <class _Ty>
concept _Boolean_testable_impl = convertible_to<_Ty, bool>;
template <class _Ty>
concept _Boolean_testable = _Boolean_testable_impl<_Ty> && requires(_Ty&& __t) {
{ !static_cast<_Ty&&>(__t) } -> _Boolean_testable_impl;
};
template <class _Ty1, class _Ty2>
concept _Half_equality_comparable = requires(const remove_reference_t<_Ty1>& __x, const remove_reference_t<_Ty2>& __y) {
{ __x == __y } -> _Boolean_testable;
{ __x != __y } -> _Boolean_testable;
};
template <class _Ty1, class _Ty2>
concept _Weakly_equality_comparable_with =
_Half_equality_comparable<_Ty1, _Ty2> && _Half_equality_comparable<_Ty2, _Ty1>;
_EXPORT_STD template <class _Ty>
concept equality_comparable = _Half_equality_comparable<_Ty, _Ty>;
#if _HAS_CXX23
template <class _Ty1, class _Ty2, class _Ref = common_reference_t<const _Ty1&, const _Ty2&>>
concept _Comparison_common_type_with_impl = same_as<_Ref, common_reference_t<const _Ty2&, const _Ty1&>> && requires {
requires convertible_to<const _Ty1&, const _Ref&> || convertible_to<_Ty1, const _Ref&>;
requires convertible_to<const _Ty2&, const _Ref&> || convertible_to<_Ty2, const _Ref&>;
};
template <class _Ty1, class _Ty2>
concept _Comparison_common_type_with = _Comparison_common_type_with_impl<remove_cvref_t<_Ty1>, remove_cvref_t<_Ty2>>;
#endif // _HAS_CXX23
_EXPORT_STD template <class _Ty1, class _Ty2>
concept equality_comparable_with =
equality_comparable<_Ty1> && equality_comparable<_Ty2>
#if _HAS_CXX23
&& _Comparison_common_type_with<_Ty1, _Ty2>
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
&& common_reference_with<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>
#endif // ^^^ !_HAS_CXX23 ^^^
&& equality_comparable<common_reference_t<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>>
&& _Weakly_equality_comparable_with<_Ty1, _Ty2>;
template <class _Ty1, class _Ty2>
concept _Half_ordered = requires(const remove_reference_t<_Ty1>& __t, const remove_reference_t<_Ty2>& __u) {
{ __t < __u } -> _Boolean_testable;
{ __t > __u } -> _Boolean_testable;
{ __t <= __u } -> _Boolean_testable;
{ __t >= __u } -> _Boolean_testable;
};
template <class _Ty1, class _Ty2>
concept _Partially_ordered_with = _Half_ordered<_Ty1, _Ty2> && _Half_ordered<_Ty2, _Ty1>;
_EXPORT_STD template <class _Ty>
concept totally_ordered = equality_comparable<_Ty> && _Half_ordered<_Ty, _Ty>;
_EXPORT_STD template <class _Ty1, class _Ty2>
concept totally_ordered_with =
totally_ordered<_Ty1> && totally_ordered<_Ty2> && equality_comparable_with<_Ty1, _Ty2>
&& totally_ordered<common_reference_t<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>>
&& _Partially_ordered_with<_Ty1, _Ty2>;
_EXPORT_STD template <class _Ty>
concept movable = is_object_v<_Ty> && move_constructible<_Ty> && assignable_from<_Ty&, _Ty> && swappable<_Ty>;
_EXPORT_STD template <class _Ty>
concept copyable = copy_constructible<_Ty> && movable<_Ty> && assignable_from<_Ty&, _Ty&>
&& assignable_from<_Ty&, const _Ty&> && assignable_from<_Ty&, const _Ty>;
_EXPORT_STD template <class _Ty>
concept semiregular = copyable<_Ty> && default_initializable<_Ty>;
_EXPORT_STD template <class _Ty>
concept regular = semiregular<_Ty> && equality_comparable<_Ty>;
_EXPORT_STD template <class _FTy, class... _ArgTys>
concept invocable = requires(
_FTy&& _Fn, _ArgTys&&... _Args) { _STD invoke(static_cast<_FTy&&>(_Fn), static_cast<_ArgTys&&>(_Args)...); };
_EXPORT_STD template <class _FTy, class... _ArgTys>
concept regular_invocable = invocable<_FTy, _ArgTys...>;
_EXPORT_STD template <class _FTy, class... _ArgTys>
concept predicate = regular_invocable<_FTy, _ArgTys...> && _Boolean_testable<invoke_result_t<_FTy, _ArgTys...>>;
_EXPORT_STD template <class _FTy, class _Ty1, class _Ty2>
concept relation = predicate<_FTy, _Ty1, _Ty1> && predicate<_FTy, _Ty2, _Ty2> && predicate<_FTy, _Ty1, _Ty2>
&& predicate<_FTy, _Ty2, _Ty1>;
_EXPORT_STD template <class _FTy, class _Ty1, class _Ty2>
concept equivalence_relation = relation<_FTy, _Ty1, _Ty2>;
_EXPORT_STD template <class _FTy, class _Ty1, class _Ty2>
concept strict_weak_order = relation<_FTy, _Ty1, _Ty2>;
template <class _Ty>
struct _Choice_t {
_Ty _Strategy = _Ty{};
bool _No_throw = false;
};
_STD_END
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // _HAS_CXX20
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CONCEPTS_
File diff suppressed because it is too large. Load diff
Loaded 100 of 1320 files, more files were not shown because too many files have changed in this diff. Show more