エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
ここにツイート内容が記載されます https://b.hatena.ne.jp/URLはspanで囲んでください
Twitterで共有ONにすると、次回以降このダイアログを飛ばしてTwitterに遷移します
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
#include <typeindex> #include <map> #include <iostream> int main(){ // 型をシーケンシャルなidに変... #include <typeindex> #include <map> #include <iostream> int main(){ // 型をシーケンシャルなidに変換したい. std::map<std::type_index, int> type_index_map; int next_index = 0; // 生成に累計で O(log(n) * n) 時間が掛かる. type_index_map[typeid(int)] = next_index++; type_index_map[typeid(void)] = next_index++; type_index_map[typeid(const char*)] = next_index++; // 照合で O(log(n)) 時間掛かる. std::cout << "int mapped -> " << type_index_m