fix: fix compile.

This commit is contained in:
2025-02-28 22:28:05 +08:00
parent 5dce170b89
commit 4e8be06f46
2 changed files with 3 additions and 3 deletions

View File

@@ -28,13 +28,13 @@ void TypedSymbolList::read(const std::filesystem::path& path) {
}
void TypedSymbolList::write(const std::filesystem::path& path) const {
std::ofstream ofs;
std::ofstream ofs(path);
for (const auto& [symbol, decl_type] : m_data) {
ofs << symbol << ", " << decl_type.string() << "\n";
}
}
void TypedSymbolList::record(std::string_view symbol, DeclType type) {
void TypedSymbolList::record(const std::string& symbol, DeclType type) {
m_data.emplace(symbol, type);
}

View File

@@ -16,7 +16,7 @@ public:
void read(const std::filesystem::path& path) override;
void write(const std::filesystem::path& path) const override;
void record(std::string_view name, DeclType type);
void record(const std::string& symbol, DeclType type);
constexpr void for_each(const for_each_callback_t& callback) const {
for (const auto& entity : m_data) callback(entity);