solve hw-9
This commit is contained in:
15
hws/tiktok_trends/StringInterner.h
Normal file
15
hws/tiktok_trends/StringInterner.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
|
||||
class StringInterner {
|
||||
private:
|
||||
std::unordered_set<std::string> pool;
|
||||
|
||||
public:
|
||||
const std::string* intern(const std::string& str);
|
||||
const std::string* intern(std::string&& str);
|
||||
const std::string* getEmptyString();
|
||||
};
|
||||
Reference in New Issue
Block a user