Skip to content

Commit c14d02c

Browse files
committed
allow using string_view and const char* as CCDictionaryExt key
1 parent 1a6f4cd commit c14d02c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

loader/include/Geode/utils/cocos.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,12 @@ namespace geode::cocos {
12251225
cocos2d::CCDictElement* m_ptr;
12261226

12271227
std::pair<K, T*> operator*() {
1228-
if constexpr (std::is_same_v<K, std::string> || std::is_same_v<K, gd::string>) {
1228+
if constexpr (
1229+
std::is_same_v<K, std::string>
1230+
|| std::is_same_v<K, gd::string>
1231+
|| std::is_same_v<K, std::string_view>
1232+
|| std::is_same_v<K, const char*>)
1233+
{
12291234
return {m_ptr->getStrKey(), static_cast<T*>(m_ptr->getObject())};
12301235
}
12311236
else {

0 commit comments

Comments
 (0)