+ // Swap last data of cacheContainer.
+ if(static_cast<std::size_t>(removeContainerIndex.GetIndex() + 1) < cacheContainer.size())
+ {
+ // First, change the cache index infomations inside of converter
+ mTextureIdConverter[cacheContainer.back().bufferId] = static_cast<std::uint32_t>(removeContainerIndex);
+
+ // After change converter, swap the value between current data and last data.
+ std::swap(cacheContainer[removeContainerIndex.GetIndex()], cacheContainer.back());
+ }
+
+ // Now we can assume that latest data should be removed. pop_back.
+ cacheContainer.pop_back();
+}
+
+template<class ContainerType>
+void TextureCacheManager::RemoveTextureInfoByIndex(ContainerType& cacheContainer, const TextureCacheManager::TextureCacheIndex& removeContainerIndex)
+{
+ // Swap last data of cacheContainer.
+ if(static_cast<std::size_t>(removeContainerIndex.GetIndex() + 1) < cacheContainer.size())
+ {
+ // First, change the cache index infomations inside of converter
+ mTextureIdConverter[cacheContainer.back().textureId] = static_cast<std::uint32_t>(removeContainerIndex);
+
+ // After change converter, swap the value between current data and last data.
+ std::swap(cacheContainer[removeContainerIndex.GetIndex()], cacheContainer.back());
+ }
+
+ // Now we can assume that latest data should be removed. pop_back.
+ cacheContainer.pop_back();
+}