Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <string>
#include <locale>
#include <codecvt>
int main()
{
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
std::string u8str = u8"abcdeあいうえお🗿";
@remyroez
remyroez / dependency-injection-test.cpp
Created October 14, 2016 02:03
依存性の注入のテスト
#include <iostream>
#include <memory>
class IFoo
{
public:
virtual ~IFoo() {}
virtual int f() = 0;
};
@remyroez
remyroez / neural-network-on-matchbox.cpp
Last active October 7, 2016 06:53
マッチ箱の脳 - マッチ箱で作るNN
#include <iostream>
#include <iomanip>
#include <memory>
#include <array>
#include <cmath>
// ニューロン(マッチ箱+お菓子)
class Neuron
{
public:
@remyroez
remyroez / file0.txt
Last active September 23, 2016 05:04
MSYS2 にてコマンドライン環境をつくる: セットアップ編 ref: http://qiita.com/remyroez/items/757b7b769e9c5a2c4ae7
msys/winpty-git 1~0.2.2.365.79c9859-1
A Windows software package providing an interface similar to a Unix
pty-master for communicating with Windows console programs
@remyroez
remyroez / file2.txt
Created July 18, 2014 09:25
C++11 の make_shared を拡張する ref: http://qiita.com/remyroez/items/04968f3a2b09f4888f11
0: foo() shared f() ~foo()
1: foo(1234) shared f() ~foo()
2: foo(456) shared custom_deleter f() ~foo()
3: foo(789) shared custom_full f() ~foo()
4: foo() unique f() ~foo()
5: foo(bar) unique f() ~foo()
6: *** error ***
7: foo(42) unique custom_deleter f() ~foo()
@remyroez
remyroez / file2.txt
Created July 14, 2014 08:45
C++11 と unique_ptr でシングルトン ref: http://qiita.com/remyroez/items/fd35e6af8fbbdbdd73c4
main begin
1: device()
device foo!
2: device foo!
3: device foo!
~device()
4: invalid instance.
5: device()
6: device foo!
7: beacon()