Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Net;
using System.Threading.Tasks;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Runtime.Intrinsics;
using System.Threading;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Collections.Concurrent;
#include <Windows.h>
#include <stdio.h>
int main() {
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
printf("GetConsoleCP: %u\n", GetConsoleCP());
printf("GetConsoleOutputCP: %u\n", GetConsoleOutputCP());
template<typename T, typename Deleter>
class unique_resource {
public:
explicit unique_resource(T handle = T{}) noexcept : m_handle{ handle }
{
}
unique_resource(unique_resource&& resource) noexcept : m_handle{ resource.m_handle }
{
resource.m_handle = T{};