- ubuntu 14.04 LTS
- g++ 4.8.4
- gdb 7.7
- python 3.4
- Boost C++ Libraries 1.59.0
This file contains 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
#include <type_traits> | |
#include <functional> | |
using namespace std; | |
template <typename T, typename Ignore = void> | |
struct has_hash { | |
static const bool value = false; | |
}; |
gist をコマンドラインから利用しやすくするツール。 ファイルの新規投稿や、投稿したファイルをローカルにクローンできる。
This file contains 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
// 定数により switch で振る舞いを切り替える | |
// パラメータが登録されていない定数の場合は assert を実行 | |
#include <iostream> | |
#include <cassert> | |
using namespace std; | |
enum class color { | |
red, | |
green, |
This file contains 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
#include <boost/variant.hpp> | |
#include <boost/mpl/for_each.hpp> | |
#include <boost/mpl/find.hpp> | |
#include <type_traits> | |
#include <iostream> | |
using namespace boost; | |
using namespace boost::mpl; | |
// variant が格納できる型に T 型が含まれているか返すメタ関数 |
This file contains 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
#include <iostream> | |
#include <sstream> | |
using namespace std; | |
int main() { | |
istringstream is("01234"); | |
is.ignore(3); | |
istreambuf_iterator<char> begin(is); |
This file contains 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
#include <iostream> | |
#include <type_traits> | |
using namespace std; | |
template <typename T, typename Ignore = void> | |
struct value_getter { | |
static const int value = 0; | |
}; |