This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import subprocess | |
import urllib.request | |
import argparse | |
from pathlib import Path | |
wasdk = { | |
"name": "Microsoft.WindowsAppSDK", | |
"version": "1.7.250127003-experimental3", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <winrt/base.h> | |
/* Assume this type: | |
runtimeclass Foo { | |
String Name; | |
UInt32 Id { get; }; | |
Foo[] GetMoreFoos(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include <iostream> | |
#include <map> | |
#include <chrono> | |
#include <unordered_map> | |
#include <array> | |
#include <string> | |
#include <functional> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://godbolt.org/z/xnd359j99 | |
#include <optional> | |
#include <mutex> | |
#include <functional> | |
template<typename T> struct default_lazy_init { | |
T operator()() const { | |
return T{}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <span> | |
#include <variant> | |
#include <memory> | |
template<typename T, int internal = 25> struct small_vector_optimization : std::span<T const> | |
{ | |
small_vector_optimization(std::span<T const> src) | |
{ | |
if (src.size() <= internal) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is replacement for std::format on systems that don't have std::locale support, | |
// but do have std::to_chars locale invariant. | |
template <typename... Args> | |
std::string myformat(std::format_string<Args...> fmt, Args&&... args) | |
{ | |
std::string output; | |
auto formatArgStore = std::make_format_args(args...); | |
auto formatArgs = std::format_args(formatArgStore); | |
std::string_view fmtString = fmt.get(); | |
int nextIndex = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tuple> | |
#include <iostream> | |
#include <algorithm> | |
#include <string_view> | |
#include <array> | |
#include <stdexcept> | |
#include <optional> | |
// This is a bijection lookup helper that given an array of pairs finds the key or | |
// the value. The keys should be sorted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <random> | |
#include <string> | |
#include <vector> | |
#include <span> | |
#include <winrt/windows.storage.streams.h> | |
#include <winrt/windows.security.cryptography.h> | |
#include <winrt/windows.security.cryptography.core.h> | |
#include <winrt/windows.security.cryptography.certificates.h> | |
namespace winrt { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <algorithm> | |
#include <iterator> | |
#include <functional> | |
// Given a container that supports "begin(c)" / "end(c)", uses std::transform plus a | |
// provided transmutor function to produce an output vector of the results. The | |
// type of the vector returned is derived from the return type of the transmutor | |
// operation. | |
template<typename Z, typename Q> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <wil/com.h> | |
// Wraps a type like IEnumIUknown and exposes it as a forward iterator, | |
// or like IEnumIDList and exposes it as a forward iterator of type TStoredType. | |
// The IEnumType must have the following methods: | |
// HRESULT Next(ULONG celt, T* rgelt, ULONG* pceltFetched) | |
template <typename IEnumType, typename TStoredType> | |
struct iterator | |
{ | |
wil::com_ptr<IEnumType> m_enum{}; |
NewerOlder