cpprefjp / site Goto Github PK
View Code? Open in Web Editor NEWcpprefjpサイトのMarkdownソース
Home Page: https://cpprefjp.github.io/
cpprefjpサイトのMarkdownソース
Home Page: https://cpprefjp.github.io/
md: [/article.md[(/article.md), check_site
---- Updated At 2013-05-12 07:16:27.243186 ----
md: /article.md, check_site
---- Closed by andare ----
現状、<map>
ヘッダのリファレンスが、std::map
のみを扱う形式になっているので、<unordered_set>
/<unordered_map>
ヘッダを参考に、std::map
とstd::multimap
両方を扱う階層形式に直します。
count()
とinsert()
以外のメンバ関数は挙動が同じだと思うので、基本的にはmultimap
はクラスページのみを作成し、メンバ関数についてはmap
のものを指すようにすればOKだと思います。
<unordered_map>
ヘッダのタスクです。
unordered_map
のコンテナの変更に関する以下のメンバ関数のリファレンスを作成お願いします。
自動更新に失敗しました。
以下の『ファイル』を更新し、『チェックサイト』のページを開いてもエラーが出ないことを確認して下さい。
次の自動実行は [2013-05-16 02:04:22+0900] に行われます。
---- Closed by andare ----
修正が確認されたので Close します。
たとえば以下のページで、ソースの "231" がそのまま表示されています。
https://sites.google.com/site/cpprefjp/reference/random/minstd_rand0
---- Updated At 2013-05-12 06:23:37.198965 ----
reference/stack/stack.md
reference/random.md
---- Updated At 2013-05-12 06:24:32.884024 ----
reference/stack/stack.md
reference/random.md
自動更新に失敗しました。
以下の『ファイル』を更新し、『チェックサイト』のページを開いてもエラーが出ないことを確認して下さい。
次の自動実行は [2013-05-31 14:57:10+0900] に行われます。
---- Closed by andare ----
修正が確認されたので Close します。
<list>
ヘッダのタスクです。以下のメンバ関数のリファレンスを作成お願いします。
コンテナの変更
cpprefjpのリファレンス作成作業も、全52ヘッダ中27ヘッダまで完了し、だいぶ終わりが見えてきました。このあたりで、残りどんなものがあるのかと、今後の方針(予定)を考えてみようと思います。
ある程度話がまとまったところで、このチケットを私の方でクローズします。
【優先順位が高い残作業】
残作業を全部を列挙するとたいへんなので、優先順位が高そうなものを挙げます。
この2つはその他に、multiset、multimapに対応する作業が残っています。このタスクはチケット化してあるので、どなたか対応していただけると助かります。#22 と #23 です。
ここまでやれば、コンテナライブラリの全リファレンスが完了します。
【今後の方針案】
ライブラリのリファレンス作成作業にある程度区切りが着いた段階から、言語機能の簡易紹介みたいなものを、やっていきたいと考えています。C++11とC++14の機能ですね。
これは入門書のような体系的なものではなく、規格書のような詳細仕様でもない、ブログ記事のような、機能ごとの短い紹介に止めようかと考えています。
【課題】
タスクをどのように割り振ろうか、というのが課題です。
現在は、各人が興味を持っているところを、タスク管理なしに作業していますが、完成に向けて助けあっていけるような何かがほしいなーと思っています。
タスク消化状況の可視化、「大変なので手伝ってください/このタスクを引き取ってください」のようなヘルプをお願いしやすいようにする等、このあたりで何かいい案があれば教えてください。
【このチケットで話し合うことまとめ】
ある程度話がまとまったところで、私がチケットを閉じます。
皆さんからのご意見をお待ちしています。
<unordered_map>
ヘッダのタスクです。
unordered_multimap
の領域に関する以下のメンバ関数のリファレンスを作成お願いします。
ヘッダの残りのタスクを Issue へ登録するタスクです。
5〜10 ファイル程度で 1 Issue の粒度にすれば丁度良いかと思います。
ただ、丁度良い範囲で区切るなら、それより多くても少なくても構いません。
大体の目安としては、
ぐらいがいいと思います。
ヘッダは、C++11 の規格書上では 21 です。
基本的には string.md や、その中にあるクラスを登録していくことになります。
ただし、このリスト自体に抜けがある可能性もあるので、一通り規格書に目を通しておいて下さい。
#include <type_traits>
#include <locale>
struct s
{
~s() = delete;
// デストラクタは = delete されている。
// そのためデストラクトできない。
};
static_assert(std::is_destructible<int>::value == true, "value == true, int is destructible");
static_assert(std::is_same<std::is_destructible<int>::value_type, bool>::value, "value_type == bool");
static_assert(std::is_same<std::is_destructible<int>::type, std::true_type>::value, "type == true_type");
static_assert(std::is_destructible<int>() == true, "is_destructible<int>() == true");
static_assert(std::is_destructible<s>::value == false, "value == false, s is not destructible");
static_assert(std::is_same<std::is_destructible<s>::value_type, bool>::value, "value_type == bool");
static_assert(std::is_same<std::is_destructible<s>::type, std::false_type>::value, "type == false_type");
static_assert(std::is_destructible<s>() == false, "is_destructible<int>() == false");
static_assert(std::is_destructible<s&>::value == true, "s& is destructible");
static_assert(std::is_destructible<s&&>::value == true, "s&& is destructible");
static_assert(std::is_destructible<const int>::value == true, "const int is destructible");
static_assert(std::is_destructible<int[1]>::value == true, "int[1] is destructible");
static_assert(std::is_destructible<int[]>::value == false, "int[] is not destructible");
static_assert(std::is_destructible<void>::value == false, "void is not destructible");
static_assert(std::is_destructible<std::locale::facet>::value == false, "std::locale::facet is not destructible");
static_assert(std::is_destructible<std::ctype<char>>::value == false, "std::ctype<char> is not destructible");
int main(){}
Clan 3.3でのコンパイル結果:
prog.cc:23:1: error: static_assert failed "s&& is destructible"
static_assert(std::is_destructible<s&&>::value == true, "s&& is destructible");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:27:1: error: static_assert failed "int[] is not destructible"
static_assert(std::is_destructible<int[]>::value == false, "int[] is not destructible");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
static_assertに失敗しています。
ボレロさんのコメント:
static_assert(std::is_destructible<int[]>::value == false, "int[] is not destructible");
array of unknown bound が Destructible であるのはおかしい。
(おそらく)clang の実装のバグであろう。コードは正しい。
static_assert(std::is_destructible<s&>::value == true, "s& is destructible");
static_assert(std::is_destructible<s&&>::value == true, "s&& is destructible");
これは、GCC では両者を通し、clang は前者のみを通す。
Non-Destructible な型の参照型が Destructible であるのはおかしい。
(おそらく)GCC, clang 両方の実装のバグであろう。コードも誤っている。
自動更新に失敗しました。
以下の『ファイル』を更新し、『チェックサイト』のページを開いてもエラーが出ないことを確認して下さい。
ファイル | チェックサイト |
---|---|
/reference/unordered_set/unordered_set/begin-size_type.md | check_site |
次の自動実行は [2013-06-14 03:48:00+0900] に行われます。
---- Closed by andare ----
修正が確認されたので Close します。
<unordered_map>
ヘッダのタスクです。
unordered_map
のハッシュポリシーに関する以下のメンバ関数のリファレンスを作成お願いします。
cpprefjpをGoogle Sitesで直接編集していたころに使用していた、編集メンバ管理のためのmember.mdを削除します。
以降は、GitHubのメンバ一覧機能と、各リファレンスページのコントリビュータ一覧に任せます。
コアメンバ内で事前に議論して合意はとれているので、このチケットは単にタスク管理のために発行します。
自動更新に失敗しました。
以下の『ファイル』を更新し、『チェックサイト』のページを開いてもエラーが出ないことを確認して下さい。
次の自動実行は [2013-07-19 07:27:59+0900] に行われます。
---- Closed by andare ----
修正が確認されたので Close します。
<unordered_map>
ヘッダのタスクです。
unordered_map
のアロケータとオブザーバーに関する以下のメンバ関数のリファレンスを作成お願いします。
アロケータ
オブザーバー
あるヘッダファイルが「C++11で新しく追加されたものか否か」が、表記ブレなどもあり分かりづらい気がします。サイト全体で統一的な表記が必要ではないでしょうか?
(今後、C++14などで追加予定のヘッダファイルへの対応も配慮が必要かと思います。)
https://github.com/cpprefjp/site/blob/master/reference/valarray/valarray.md の2番目のコードが Clang でコンパイルエラーになります。
http://melpon.org/wandbox/permlink/z5tIcHzSx6BeE3oD
gcc では発生しないのですが、どちらの方が正しいのかいまいち分からず…。
#include <type_traits>
typedef void f();
static_assert(std::is_function<f>::value == true, "value == true, f is function");
static_assert(std::is_same<std::is_function<f>::value_type, bool>::value, "value_type == bool");
static_assert(std::is_same<std::is_function<f>::type, std::true_type>::value, "type == true_type");
static_assert(std::is_function<f>() == true, "is_function<f>() == true");
static_assert(std::is_function<int>::value == false, "value == false, int is not function");
static_assert(std::is_same<std::is_function<int>::value_type, bool>::value, "value_type == bool");
static_assert(std::is_same<std::is_function<int>::type, std::false_type>::value, "type == false_type");
static_assert(std::is_function<int>() == false, "is_function<int>() == false");
static_assert(std::is_function<const f>::value == true, "const f is function");
static_assert(std::is_function<volatile f>::value == true, "volatile f is function");
static_assert(std::is_function<const volatile f>::value == true, "const volatile f is function");
static_assert(std::is_function<f*>::value == false, "f* is not function");
static_assert(std::is_function<f&>::value == false, "f& is not function");
static_assert(std::is_function<f&&>::value == false, "f&& is not function");
int main(){}
Clang 3.3でのコンパイル結果:
prog.cc:15:32: warning: qualifier on function type 'f' (aka 'void ()') has unspecified behavior
static_assert(std::is_function<const f>::value == true, "const f is function");
^~~~~~~
prog.cc:16:32: warning: qualifier on function type 'f' (aka 'void ()') has unspecified behavior
static_assert(std::is_function<volatile f>::value == true, "volatile f is function");
^~~~~~~~~~
prog.cc:17:32: warning: qualifier on function type 'f' (aka 'void ()') has unspecified behavior
static_assert(std::is_function<const volatile f>::value == true, "const volatile f is function");
^~~~~~~~~~~~~~~~
3 warnings generated.
警告が出力されている行は以下:
static_assert(std::is_function<const f>::value == true, "const f is function");
static_assert(std::is_function<volatile f>::value == true, "volatile f is function");
static_assert(std::is_function<const volatile f>::value == true, "const volatile f is function");
関数に対してCV修飾するのは、未規定の振る舞いになる、と言ってます。
GCC 4.7では警告が出ず、コンパイルが通りました。
ボレロさんのコメント:
> 20.9.4.1 Primary type categories
> For any given type T, the result of applying one of these templates to T and to cv-qualified T shall yield the same result.
であるので、cv修飾された型も同じ結果にならなければならない。
clang の実装のバグであろう。コードは正しい。
linear_congruential_engine のページの minstd_rand0 へのリンクが間違っています。
https://sites.google.com/site/cpprefjp/reference/random/linear_congruential_engine
現在のtime_pointのサンプルコードでは、C++標準に存在しないctime_sおよびctime_rが使用されており、これをやめたいと思います。
個人的には、cpprefjpでは可能な限り標準ライブラリ以外の使用は避けるべきではないかと考えています。そこで、(若干手前味噌な感もありますが)標準ライブラリのlocaltime関数とput_timeマニピュレータで出力するコードに変更したいと思います。
特に、意見がなければ、数日中に行う予定です。ご意見等あればお聞かせください。
参考: https://github.com/cpp-pocketref/sample-code/blob/master/005_io/012_put_time.cpp
自動更新に失敗しました。
以下の『ファイル』を更新し、『チェックサイト』のページを開いてもエラーが出ないことを確認して下さい。
ファイル | チェックサイト |
---|---|
/article.md | check_site |
---- Closed by andare ----
修正が確認されたので Close します。
<list>
ヘッダのタスクです。以下のメンバ関数のリファレンスを作成お願いします。
領域
要素アクセス
<unordered_map>
ヘッダのタスクです。
unordered_multimap
のイテレータに関する以下のメンバ関数のリファレンスを作成お願いします。
<unordered_map>
ヘッダのタスクです。
unordered_map
の以下の非メンバ関数のリファレンスを作成お願いします。
https://sites.google.com/site/cpprefjp/reference/random/linear_congruential_engine
定数の名前が、コードでは a, c, m, 本文では A, B, M となっており統一されていません。混乱をきたすのでどちらかに統一したほうがよいと思います。
こちらも参照。
<limits>
ヘッダ以下のページがMarkdown形式に取り込まれていません。初期の変換対象から漏れてしまったようです。
ヘッダの残りのタスクを Issue へ登録するタスクです。
5〜10 ファイル程度で 1 Issue の粒度にすれば丁度良いかと思います。
ただ、丁度良い範囲で区切るなら、それより多くても少なくても構いません。
大体の目安としては、
ぐらいがいいと思います。
ヘッダは、C++11 の規格書上では 23.3.5 です。
基本的には list.md を登録していくことになります。
ただし、このリスト自体に抜けがある可能性もあるので、一通り規格書に目を通しておいて下さい。
reference/stack/stack.md
reference/random.md
---- Closed by andare ----
<unordered_map>
ヘッダのタスクです。
unordered_multimap
の構築/コピー/破棄に関する以下のメンバ関数のリファレンスを作成お願いします。
<unordered_map>
ヘッダのタスクです。
unordered_map
の構築/コピー/破棄に関する以下のメンバ関数のリファレンスを作成お願いします。
色覚異常の人への配慮として、色でしか区別できないグラフを描くのはやめたほうが良いです。色だけを変えるのでなく、色と線の種類(破線・点線)を変えるといいと思います。
<unordered_map>
ヘッダのタスクです。
unordered_map
の検索に関する以下のメンバ関数のリファレンスを作成お願いします。
<list>
ヘッダのタスクです。以下の関数のリファレンスを作成お願いします。
非メンバ関数
https://sites.google.com/site/cpprefjp/reference/array/front
要素数が0の場合(N == 0の場合)、この関数は定義されない。
この記述だと「Zero sized arrays がこのメンバ関数を持たない」かのように読めます。
N3337 では
23.3.2.8 Zero sized arrays
The effect of calling front() or back() for a zero-sized array is undefined.
とあるため、
”要素数が0の場合(N == 0の場合)、この関数呼出の効果は未定義である。”
などと書くべきだと思います。
この内容で問題なければぼくが修正しておきます。
<unordered_map> ヘッダの残りのタスクを Issue へ登録するタスクです。
5〜10 ファイル程度で 1 Issue の粒度にすれば丁度良いかと思います。
ただ、丁度良い範囲で区切るなら、それより多くても少なくても構いません。
大体の目安としては、
ぐらいがいいと思います。
<unordered_map> ヘッダは、C++11 の規格書上では 23.5.2 です。
基本的には unordered_map.md や、その中にあるクラスを登録していくことになります。
ただし、このリスト自体に抜けがある可能性もあるので、一通り規格書に目を通しておいて下さい。
#13 から派生して、「そもそものgithub化に伴う編集ルールの再検討をしておきましょう!」と言う事で別にIssueを発行しました。以下、 #13 から派生した主要な流れ。
@melpon
ひとまず、作業状況を削除して、wiki にも同様のページを作っておきました。https://github.com/cpprefjp/site/blob/master/reference.md
https://github.com/cpprefjp/site/wiki/progress(ほんとはこういうのはチケットで管理した方がいいんでしょうけど…)
@usagi
少なくともcpprefjpにページとしてあるよりは見やすく編集しやすくなったので良いと思います。チケット化についてはgithub管理化以降の計画的な取り組みについてはgithubのIssuesを使う方針にできれば良いかと思います。typo修正やそれほど大きくない程度であればpull-reqと編集者からのレビュー(何件以上とか条件付けるかは必要なら別スレッドで議論するにしても)でmergeが良い様にも思えます。現状では事実上レビューなしで参加者なら誰でも編集、pull-reqも権限のあるメンバーが気付き次第、明らかな問題点が見当たらなければmergeしている状況ですが、githubを使って居る事でpull-reqやレビューはとてもやりやすい状態になっており、いわゆるgithub-flowの採用は参加者への負担もさほどなくcpprefjpの品質を維持しつつ多くの参加者(直接編集権の有無に関わらず)が安心して編集に参加できる良いルールとなると私は思います。
本チケットでは、「github化に伴う編集ルールの再検討」について議論する事を目的とします。
草案として @usagi からは「以降は github-flow を採用して編集を進めてはどうか」と提案致します。みなさまご意見よろしくお願いいたします。
testtest
<unordered_map>
ヘッダのタスクです。
unordered_map
のイテレータに関する以下のメンバ関数のリファレンスを作成お願いします。
https://github.com/cpprefjp/site/blob/master/reference/random/seed_seq/generate.md
seed_seq::generate の【戻り値】の項で示された例が C++ コードとして ill-formed なので、
書き直してみたのですがどうでしょうか。
https://gist.github.com/bolero-MURAKAMI/7333428
具体的には:
・変数 r1, r2, r3, r4 がループ外にあるので内に
・添字が範囲を超える場合があるので modulus n に収めるように
・n と s の型が異なるとエラーになるので明示するように
・関係ない値 x が紛れ込んでいたので削除
一応 Wandbox でコンパイル通ることは確認しました。
問題ないようでしたらこれでコミットします。
VC++ 2013(12.0)のRCが出ました。
C++11とC++14の機能が、Previewのときより増えてるので、検証して実装状況のページに反映させましょう。
http://herbsutter.com/2013/09/09/visual-studio-2013-rc-is-now-available/
とりあえず、egtraさんに担当を振っておきますね。
「#22 [task] <map>
をmap
とmultimap
で分ける」
上記チケットと同様に、<set>
ヘッダのリファレンスを、std::set
とstd::multiset
両方を扱う階層形式に直します。
<random>
ヘッダのリファレンス作成を行っています。もともとこのヘッダを担当されていたusagiさんに作っていただいた乱数生成結果の図ですが、私がこれを新たに作る場合は、どのようにすればよいでしょうか。
何らかのツールを使っているのであれば、何を使用しているのかを教えていただけますでしょうか。
<unordered_map>
ヘッダのタスクです。
unordered_map
のバケットインタフェースに関する以下のメンバ関数のリファレンスを作成お願いします。
<unordered_map>
ヘッダのタスクです。
unordered_map
の領域に関する以下のメンバ関数のリファレンスを作成お願いします。
<list>
ヘッダのタスクです。以下のメンバ関数のリファレンスを作成お願いします。
リスト操作
アロケータ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.