Skip to content

Instantly share code, notes, and snippets.

#include <iterator>
#include <tuple>
template <typename>
class IntegerRange;
namespace iota {
template <typename INT>
class IntegerIterator : public std::iterator<std::input_iterator_tag, INT> {
template <typename> friend class IntegerRange;
;; load-path追加。
(add-to-list 'load-path "~/.emacs.d/site-lisp/")
;; C-hをバックスペースにする。
(global-set-key (kbd "C-h") 'backward-delete-char-untabify)
;; C-tの挙動をC-b C-tの感じにする。
(defun my-transpose-chars()
(interactive)
(forward-char -1)
[user]
name =
email =
[core]
editor = emacs -nw --color=auto
pager = lv -c
excludesfile = ~/.gitignore-global
[color]
ui = auto
[fetch]
@hatsusato
hatsusato / manipulator.cpp
Created May 22, 2016 13:11
Manipulator in C++11 era
#include <functional>
#include <iostream>
class Manipulator {
public:
using FuncType = std::function<void(std::ostream&)>;
Manipulator(const FuncType& f) : f_(f) {}
void exec(std::ostream& os) const { f_(os); }
private:
FuncType f_;
@hatsusato
hatsusato / tuple_print.cpp
Last active May 22, 2016 17:53
Sample of manipulator in C++11 era
#include <functional>
#include <iostream>
#include <tuple>
class Manipulator {
public:
using FuncType = std::function<void(std::ostream&)>;
Manipulator(const FuncType& f) : f_(f) {}
void exec(std::ostream& os) const { f_(os); }
private:
@hatsusato
hatsusato / type_index.cpp
Last active November 30, 2016 12:23
Show exact type infomation.
#include <boost/type_index.hpp>
#include <iostream>
#define SHOW_TYPE(x) boost::typeindex::type_id_with_cvr<decltype(x)>().pretty_name()
int main() {
std::cout << SHOW_TYPE(main) << std::endl;
}
template <typename T>
struct Uncopyable {
protected:
Uncopyable() = default;
~Uncopyable() = default;
Uncopyable(const Uncopyable&) = delete;
Uncopyable& operator=(const Uncopyable&) = delete;
Uncopyable(Uncopyable&&) = default;
Uncopyable& operator=(Uncopyable&&) = default;
};
template <typename T>
struct Unmovable {
protected:
Unmovable() = default;
~Unmovable() = default;
Unmovable(const Unmovable&) = default;
Unmovable& operator=(const Unmovable&) = default;
Unmovable(Unmovable&&) = delete;
Unmovable& operator=(Unmovable&&) = delete;
};
@hatsusato
hatsusato / kmc-advent-2017.md
Last active November 25, 2023 05:46
gpg のはなし

gpg のはなし

この記事は [KMC Advent Calendar 2017][advent] の 10 日目の記事です。 昨日の記事は tron 君 ([id:tron_kmc][tron-id]) の[今年の活動を振り返る - tron-Factory 業務日誌][tron]でした。 はたち:tada:めでたい:congratulations:

はじめに

KMC 6 回生の hatsusato です。 修士 2 回生ともなると研究にかまけて KMC 活動がおろそかになっているので、この場を借りて申し訳程度に KMC 活動をしようと思います。