Skip to content

Instantly share code, notes, and snippets.

@plasma-effect
plasma-effect / a.md
Last active April 4, 2019 12:25
plasma.ADTの紹介

おはようございます。@plasma_effector だよ。この記事はC++アドベントカレンダー8日目の記事です。

この記事ではC++で使える代数的データ型ライブラリplasma.ADT(の最新ver willing)の紹介をしていきます。

What is plasma.ADT

9月下旬に作り始めた代数的データ型のライブラリです。C++で簡単に「ML系言語のデータ型」っぽい型を作ることができ、さらにパターンマッチっぽいことをすることができます。

#include"adt_willing.hpp"
#include<iostream>

using namespace adt_willing;
@plasma-effect
plasma-effect / a.md
Last active April 4, 2019 12:14
進化したplasma.ADTとは

plasma.ADTがバージョンアップしました。plasma.ADTの基本についてはこちら

サンプル

#include<plasma_adt/algebraic_data_type.hpp>
#include<iostream>
#include<boost/optional/optional_io.hpp>

using namespace plasma_adt;
using namespace plasma_adt::place_holder;
using namespace plasma_adt::pattern_match;
@plasma-effect
plasma-effect / Route.txt
Last active October 1, 2018 04:00
時止め巨人の仮面ルート
Cycle 1
クロックタウン入り
おばあちゃん×2
カカシ
Stray Fairy
平原でルピー集め(81r)
魔力
81r預ける
時のオカリナ
Set: []/オカリナ/[]
@plasma-effect
plasma-effect / a.md
Created December 3, 2015 18:23
constexpr多倍長整数

皆様おはようございます。@plasma_effector です。この記事はAizuアドベントカレンダー4日目です。 #自己紹介 数学系の3回生です。何も考えず登録した後Aizuとあんま関係ないと気付きましたが気にせずやります。
普段はC++とC#でなんか作ってます。たまにTypeScriptでゲームを作ります。 #やること C++のconstexprには様々な可能性が存在します。
多倍長整数をコンパイル時に使えたらいいなぁって思ったのでconstexprな多倍長整数を作ろうって思いました。 #補足 constexprとは ※この項は普段C++使ってる方は読み飛ばしてもらって構いません
C++11で追加された定数評価に関する指定子です。gccとclangとmsvcでは使えます。

@plasma-effect
plasma-effect / main.cpp
Created October 11, 2017 14:26
Auto Sweeper
#include<iostream>
#include<functional>
#include<algorithm>
#include<array>
#include<optional>
#include<random>
#include<sstream>
#include<queue>
constexpr int width = 9;
@plasma-effect
plasma-effect / main.cpp
Last active August 4, 2017 06:49
お前またparser作る気か
#include"xpeaming.hpp"
#include<iostream>
using namespace xpeaming;
struct ab_t
{
};
struct bc_t
{
@plasma-effect
plasma-effect / parser.hpp
Created April 12, 2017 16:16
template_parser
// Copyright plasma-effect 2017.
// Distributed under the Boost Software License, Version 1.0.
// (See at http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include<vector>
#include<optional>
#include<variant>
#include<memory>
#include<string>
#pragma once
#include<optional>
#include<variant>
#include<tuple>
#include<string_view>
#include<functional>
#include<array>
#include<set>
namespace single_parse
@plasma-effect
plasma-effect / Main.cpp
Created December 6, 2016 15:17
洗濯機クソコラ生成器
#include<Siv3D.hpp>
#include<algorithm>
typedef std::pair<double, double> point;
typedef point size;
double& x(point& p)
{
return p.first;
}
double& y(point& p)
@plasma-effect
plasma-effect / main.md
Last active December 4, 2016 12:07
VS2017の新機能

辞世の句

PMPやってたらコンパイラ間の挙動の違いに飲み込まれて死んだ。大体msvcが悪い。(自由律)

はじめに

この記事はC++アドベントカレンダー4日目の記事です。
昨日はコンパイル中にコンパイルする「コンパイル時Cコンパイラ」をつくった話でした。

先日VS2017RCが出ました。VC++のコア言語とライブラリに関して新機能をチェックしていこうという記事です。全部は無理ですが。

以下プロパティの言語標準を「ISO C++ 標準の最終草案 (/std:c++latest)」にしていることを前提とします。