Nagarei / DxLibEx

DXライブラリC++化プロジェクト
Boost Software License 1.0
31 stars 3 forks source link

C++標準/競合ライブラリ調査 #89

Open yumetodo opened 8 years ago

yumetodo commented 8 years ago

C++標準化委員会の動きとか、DxLibの動きとか、競合ライブラリの調査をする

yumetodo commented 8 years ago

https://github.com/suken-git/sukenlib どっかの高校の部活が作ってるのかな、イベント駆動を想定した作り方をしている

yumetodo commented 8 years ago

[PDF] P0386R2: Inline Variables C++標準化委員会の文書: P0380R0-P0389R0 | 本の虫

inline変数の提案。C++17のドラフトに入っている。

inline変数は、複数の翻訳単位で定義できる。定義は同一でなければならない。inline変数は、あたかもひとつの変数のオブジェクトがあるかのように振る舞う。

inline int x ;

extern宣言して、変数定義用の翻訳単位を用意する必要がなくなる。

constexpr staticデータメンバーは暗黙にinlineとなる。名前空間スコープのconstexpr変数は暗黙にinlineにはならない。

ドラフトに入ったとのことなのでC++17にもきっと入るだろう。

つまり、現状mutexのためにプレコンパイルが必要だけど、これに対応しているコンパイラなら完全にヘッダーオンリーにできる

yumetodo commented 7 years ago

C++1z 構造化束縛 - Faith and Brave - C++で遊ぼう http://faithandbrave.hateblo.jp/entry/2016/11/25/160520

クラスの分解

構造化束縛はタプルだけでなく、クラスも分解できます。クラスは、非静的publicメンバ変数が列挙されます(public基本クラスのものを含む)。そのクラスは、無名共用体メンバを持ってはいけません。

struct Point { int x, y; };
Point f();

// xにはPoint::xの値、yにはPoint::yの値が代入される
const auto [x, y] = f();

これは強い

yumetodo commented 7 years ago

Trip report: Fall ISO C++ standards meeting (Issaquah) https://herbsutter.com/2016/11/15/trip-report-fall-iso-c-standards-meeting-issaquah/

img

yumetodo commented 7 years ago

Trip Report: C++ Standards Meeting in Issaquah, November 2016 | There's Waldo! https://botondballo.wordpress.com/2016/11/25/trip-report-c-standards-meeting-in-issaquah-november-2016/

Rejected proposals:

  • A char8_t type for UTF-8 character data, analogous to the existing char16_t and char32_t. This was previously proposed, albeit in less detail. The feedback was much the same as for the previous proposal: consult more with the Library Evolution Working Group, to see what approach for handling UTF-8 data is likely to actually gain traction.

What the Fuck!!!

ま・た・か!

yumetodo commented 7 years ago

描画オブジェクトを管理するDrawableListを作った http://qiita.com/Hatanas/items/fd0404ea1a8c46e909e3

なるほど、screenを作らずにtasklistとして保管しておくのね。面白い。

yumetodo commented 7 years ago

先に書いたinline variable、GCC7で実装されたっぽい。

C++ Standards Support in GCC - GNU Project - Free Software Foundation (FSF)

つまりGCC7ならスレッドセーフでもヘッダーオンリーにできる!

yumetodo commented 7 years ago

なるほど。