Attampt to index refCounts with std::string when std::type_index is expected
@gpx1000 がすでに取り組んでいます。
2026年6月1日 から。
評価
この issue はまだ評価されていません。
説明
Hi,
In the tutorial on Resource management (specifically here: https://docs.vulkan.org/tutorial/latest/Building_a_Simple_Engine/Engine_Architecture/04_resource_management.html#_resource_manager_storage_architecture_and_type_safety), an associative array is created to stored resources' reference counts based on a specific type. But I have a problem with the following section (https://docs.vulkan.org/tutorial/latest/Building_a_Simple_Engine/Engine_Architecture/04_resource_management.html#_resource_manager_resource_loading_and_caching_logic) in the Load method. In my understanding, when we try to increment/initialize the reference counter for a given resource, it does this :
refCounts[resourceId]++
or this :
refCounts[resourceId] = 1;
but based on the definition of the refCounts associative array, I would have thought it should have done something more like this :
auto& typeReferenceCounters = refCounts[std::type_index(typeid(T))];
typeReferenceCounters[resourceId].refCount++; // or typeReferenceCounters[resourceId].refCount = 1 for the other case
Please tell me if I am wrong, I would be glad to learn from my mistakes.
Best regards,
ajvp
- 主要言語
- C++
- スター
- 424
- フォーク
- 127
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
KhronosGroup/Vulkan-Tutorial のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
KhronosGroup/Vulkan-Tutorial#519 · 担当者 1 名 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
KhronosGroup/Vulkan-Tutorial#511 · 担当者 1 名 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
KhronosGroup/Vulkan-Tutorial#508 · 担当者 1 名 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
KhronosGroup/Vulkan-Tutorial#499 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
KhronosGroup/Vulkan-Tutorial#498 ·
KhronosGroup/Vulkan-Tutorial の issue をすべて見る
似ている issue
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
QuantStack/git2cpp#187 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AXERA-TECH/ax-llm#77 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
games-on-whales/wolf#509 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100