皆様おはようございます。@plasma_effector です。この記事はAizuアドベントカレンダー4日目です。
#自己紹介
数学系の3回生です。何も考えず登録した後Aizuとあんま関係ないと気付きましたが気にせずやります。
普段はC++とC#でなんか作ってます。たまにTypeScriptでゲームを作ります。
#やること
C++のconstexprには様々な可能性が存在します。
多倍長整数をコンパイル時に使えたらいいなぁって思ったのでconstexprな多倍長整数を作ろうって思いました。
#補足 constexprとは
※この項は普段C++使ってる方は読み飛ばしてもらって構いません
C++11で追加された定数評価に関する指定子です。gccとclangとmsvcでは使えます。
皆さんおはようございます。この記事はポエムアドベントカレンダー3日目です。
この記事では全ての変数をchar*型で扱うことの利点、またchar*型で扱うデモンストレーションを行っていきます。
#変数がchar*型であるということの利点について考える C++において変数がchar*型であるということを否定的に捉える人もいるかと思います。 特にTMPなどの静的言語を使ってきた人にとっては、char*しかないということが不安材料として目に映ることが多いのではないかと思います。
けれども、char*しかないということは、本当に素晴らしいことです。 char*しかないことによって、たくさんの面倒から開放されるからです。
This file contains hidden or 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
#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<tuple> | |
#include<utility> | |
#include<memory> | |
#include<type_traits> |
This file contains hidden or 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
#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<tuple> | |
#include<utility> | |
#include<list> | |
#include<memory> | |
#include<vector> |
This file contains hidden or 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
module Memoization | |
module Detail = | |
type Optional<'a> = None | Value of 'a | |
let GetData<'T, 'U when 'T:equality> (target: 'T) (dic: System.Collections.Generic.List<('T*'U)>)= | |
let mutable ret = None | |
for (x, y) in dic do if x=target then ret<-Value(y) else () | |
ret | |
type Memoization<'T,'U when 'T:equality>()= |
This file contains hidden or 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
#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> |
This file contains hidden or 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
#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> |
This file contains hidden or 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
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: |
This file contains hidden or 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
#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 |
This file contains hidden or 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
#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 |