Skip to content

Instantly share code, notes, and snippets.

@plasma-effect
plasma-effect / main.cpp
Last active November 13, 2016 14:51
ジャパニーズ結構迷惑コード(コンパイル時エラトステネス)
#include<iostream>
#include<type_traits>
#include<utility>
struct none_t
{
};
template<std::size_t I>using index_node = std::integral_constant<std::size_t, I>;
@plasma-effect
plasma-effect / main.cpp
Last active November 5, 2016 15:34
ジャパニーズとても迷惑コード(TMPでエラトステネスの篩)
#include<iostream>
#include<chrono>
#include<vector>
#include<array>
#include<set>
#include<random>
#include<queue>
struct none_t {};
template<class Lhs, class Rhs>struct tree
#include<Siv3D.hpp>
#include<chrono>
#include<vector>
#include<functional>
#include"regexpr.hpp"
namespace sch = std::chrono;
typedef sch::milliseconds base_time_t;
@plasma-effect
plasma-effect / regexpr.hpp
Last active October 14, 2016 02:35
regexpr
#pragma once
// Copyright plasma-effect 2015
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
#include<type_traits>
#include<cinttypes>
#include<typeindex>
#include<vector>
@plasma-effect
plasma-effect / Main.cpp
Created June 1, 2016 15:21
plasma.Coroutineは死にました
#include<Siv3D.hpp>
#include<boost/coroutine2/all.hpp>
#include<boost/optional.hpp>
std::vector<int> vec;
boost::optional<int> opt;
constexpr int count = 2;
std::wstring str;
const wchar_t message[] = L"新しい数字を入力するが良い";
@plasma-effect
plasma-effect / Main.cpp
Created April 26, 2016 14:23
新入生に見せるため突貫で作った弾避けゲー
#include<Siv3D.hpp>
#include<chrono>
namespace sch = std::chrono;
void Main()
{
s3d::Window::Resize(360, 480);
std::pair<s3d::Circle, bool> enemy[25 * 8]{};
constexpr int s = 4;
s3d::Circle player(180, 240, s);
@plasma-effect
plasma-effect / coroutine.hpp
Last active September 28, 2016 12:52
plasma.Coroutine
#pragma once
// Copyright plasma-effect 2016.
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
#include<utility>
#include<tuple>
#include<iterator>
@plasma-effect
plasma-effect / main.cpp
Created February 27, 2016 13:37
競プロで使ってたやつ
//ここからテンプレート
#if 1
#include<iostream>
#include<vector>
#include<list>
#include<algorithm>
#include<utility>
#include<type_traits>
#include<tuple>
#include<memory>
@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 / 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;