Files
CSCI-1200/hws/tiktok_trends/StringPtrUtils.h
JamesFlare1212 a109046498 solve hw-9
2025-04-15 22:10:48 -04:00

18 lines
383 B
C++

#pragma once
#include <string>
#include <functional>
struct StringPtrHash {
size_t operator()(const std::string* s) const {
return std::hash<std::string>()(*s);
}
};
struct StringPtrEqual {
bool operator()(const std::string* a, const std::string* b) const {
if (a == b) return true;
if (!a || !b) return false;
return *a == *b;
}
};