Skip to content

Instantly share code, notes, and snippets.

@plasma-effect
plasma-effect / main.md
Created November 27, 2016 12:12
light_adt

plasma.ADTにlight_adt.hppを追加した。使い方は以下の通り。

#include<iostream>
#include<string>
#include"light_adt.hpp"

using namespace plasma_adt;
struct list :data_type<list, int, tuple<int, list>>
{
	templatelist(T&amp;&amp; arg) :data_type(std::forward(arg))
@plasma-effect
plasma-effect / main
Created November 15, 2016 14:51
ジャパニーズなかなか迷惑コード(TMPエラトステネス)
#include<iostream>
#include<type_traits>
#include<utility>
#include<functional>
namespace eratosthenes
{
template<std::size_t I, class Sequence>struct add;
template<std::size_t I, std::size_t... Is>struct add<I, std::index_sequence<Is...>>
{
#pragma once
#ifndef PLASMA_REGEXPR_
#define PLASMA_REGEXPR_
#include<string>
#include<array>
#include<vector>
#include<memory>
#include<typeindex>
#include<boost/utility/string_view.hpp>
@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
@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 / 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>
#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 / main.md
Created December 2, 2015 15:01
文字列プログラミングのススメ

皆さんおはようございます。この記事はポエムアドベントカレンダー3日目です。

この記事では全ての変数をchar*型で扱うことの利点、またchar*型で扱うデモンストレーションを行っていきます。

#変数がchar*型であるということの利点について考える C++において変数がchar*型であるということを否定的に捉える人もいるかと思います。 特にTMPなどの静的言語を使ってきた人にとっては、char*しかないということが不安材料として目に映ることが多いのではないかと思います。

けれども、char*しかないということは、本当に素晴らしいことです。 char*しかないことによって、たくさんの面倒から開放されるからです。

@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"新しい数字を入力するが良い";