Skip to content

Instantly share code, notes, and snippets.

@plasma-effect
plasma-effect / polynomial.hpp
Last active August 29, 2015 14:21
polynomial.hpp
#pragma once
// Copyright plasma-effect 2015
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
namespace plasma
{
namespace polynomial_types
{
#pragma once
#include<type_traits>
// Copyright plasma-effect 2015
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
namespace plasma
{
@plasma-effect
plasma-effect / part01.md
Last active January 6, 2016 09:45
VC++ in VS2015

ブログにソースコード貼っつけるよりgistにマークダウンで書いたほうが圧倒的に楽なことに気づいた。

2015年7月20日にVisual Studio 2015がリリースされた。当然VC++も新しくなったわけだがそのうち新しく追加された機能を出来る限り毎日記事にしようと思う。 本日はそのpart01、constexprだ。

constexprはC++11で追加された機能で、現在のC++14では更にパワーアップしているのだが、Microsoftの脳みそが2011年から進んでないのでC++11版のconstexprを紹介する。

コンパイル時において定数式はその場で計算される。定数式とは例えば以下の様なもの。

int main(){
#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<utility>
namespace plasma
@plasma-effect
plasma-effect / 0.md
Last active October 7, 2015 23:39
plasma_repository

##何これ なんとなく使えそうなコードのまとめ

##一覧 integral_sequence.hpp VS2015のmake_integer_sequenceがファッキンだったので作った memoization.hppメモ化してくれるアレを作った
plasma.ADTC++でも代数データ型ができる

#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<tuple>
namespace plasma
@plasma-effect
plasma-effect / system_lp.hpp
Last active September 1, 2015 13:42
compile time proof
#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>
namespace plasma
{
namespace proof_system
@plasma-effect
plasma-effect / Parser.fs
Last active September 19, 2015 03:28
Parsing Expression Grammar
module Parser
//Copyright (c) 2015 plasma-effect
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
#pragma once
#ifndef PLASMA_MEMOIZATION
#define PLASMA_MEMOIZATION
// Copyright plasma-effect 2015
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
#include<vector>
#include<tuple>
@plasma-effect
plasma-effect / algebraic_data_type.hpp
Last active October 7, 2015 17:11
algebraic_data_type
#pragma once
#ifndef PLASMA_ALGEBRAIC_DATA_TYPE
#define PLASMA_ALGEBRAIC_DATA_TYPE
// Copyright plasma-effect 2015
// Distributed under the Boost Software License, Version 1.0.
// (See http://www.boost.org/LICENSE_1_0.txt)
#include<tuple>
#include<memory>