This file contains 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
#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...);\ |
This file contains 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
#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)); |
This file contains 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 <iostream> | |
#include <vector> | |
#include <format> | |
using namespace std; | |
void GenerateSwizzle2(const char * input_type, const vector<char> & elements) | |
{ | |
for(auto vx : elements) | |
{ |
This file contains 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
// /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 |
This file contains 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
#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 | |
{ |
This file contains 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
#ifndef VECTOR3_H_INCLUDED | |
#define VECTOR3_H_INCLUDED | |
#include <cmath> | |
struct Vector3 final | |
{ | |
float x; | |
float y; | |
float z; |
This file contains 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
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: | |
This file contains 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
function SwiftCompile() | |
{ | |
swiftc.exe -sdk $Env:SDKROOT -L $Env:SDKROOT/usr/lib/swift/windows $args | |
} | |
Set-Alias -Name swiftc SwiftCompile |
This file contains 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
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) |
This file contains 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 <cstdint> | |
#include <cstdio> | |
inline bool isUTF8Tail(uint8_t c) | |
{ | |
return 0x80 <= c && c <= 0xBF; | |
} | |
int convertUTF8CharToUTF32Char(const char * p_utf8_str, char32_t & c) | |
{ |
NewerOlder