Skip to content

Instantly share code, notes, and snippets.

#define SINGLETON(klass) \
private:\
static inline klass * mpInstance = nullptr;\
public:\
template <class... Args>\
static void createInstance(Args... args) noexcept\
{\
if(mpInstance == nullptr)\
{\
mpInstance = new klass(args...);\
#if _WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <iostream>
#include <Windows.h>
int main(int argc, const char * argv[])
{
char path[MAX_PATH];
GetModuleFileNameA(nullptr, path, sizeof(path));
#include <iostream>
#include <vector>
#include <format>
using namespace std;
void GenerateSwizzle2(const char * input_type, const vector<char> & elements)
{
for(auto vx : elements)
{
// /std:c++latest /O2
struct Quaternion
{
float x;
float y;
float z;
float w;
};
constexpr const Quaternion dot(const Quaternion & s, const Quaternion & t) noexcept
#ifndef UTILITY_H_INCLUDED
#define UTILITY_H_INCLUDED
#include <cstdint>
#include <bit>
template <uint64_t N>
[[nodiscard]]
constexpr uint64_t multipleof(const uint64_t value) noexcept
{
#ifndef VECTOR3_H_INCLUDED
#define VECTOR3_H_INCLUDED
#include <cmath>
struct Vector3 final
{
float x;
float y;
float z;
name: GitHub Actions Demo
on: [push]
jobs:
build-on-linux:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: build
run: |
function SwiftCompile()
{
swiftc.exe -sdk $Env:SDKROOT -L $Env:SDKROOT/usr/lib/swift/windows $args
}
Set-Alias -Name swiftc SwiftCompile
cmake_minimum_required(VERSION 3.17.3)
# C++標準を指定
set(CMAKE_CXX_STANDARD 17)
# C++標準のサポート必須
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 拡張機能を無効化
set(CMAKE_CXX_EXTENSIONS OFF)
if(MSVC)
#include <cstdint>
#include <cstdio>
inline bool isUTF8Tail(uint8_t c)
{
return 0x80 <= c && c <= 0xBF;
}
int convertUTF8CharToUTF32Char(const char * p_utf8_str, char32_t & c)
{