From 47b33bf2768cc61ef4356f09c79202f84f7c79d3 Mon Sep 17 00:00:00 2001 From: Shautvast Date: Sun, 27 Oct 2024 15:48:19 +0100 Subject: [PATCH] no using global namespace --- src/lox.cpp | 2 +- src/parser.cpp | 2 +- src/scanner.cpp | 2 +- src/tokens.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lox.cpp b/src/lox.cpp index c94ee35..969cff7 100644 --- a/src/lox.cpp +++ b/src/lox.cpp @@ -7,7 +7,7 @@ #include #include -using namespace std; +using std::string, std::vector, std::ifstream, std::cin, std::cout; void print_tokens(vector *list); int run_file(string file); diff --git a/src/parser.cpp b/src/parser.cpp index 419b8e4..b8b8212 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -3,7 +3,7 @@ #include #include -using namespace std; +using std::string, std::to_string, std::vector; Expression::~Expression() = default; diff --git a/src/scanner.cpp b/src/scanner.cpp index 75beaeb..8b91cfe 100644 --- a/src/scanner.cpp +++ b/src/scanner.cpp @@ -7,7 +7,7 @@ #include #include -using namespace std; +using std::string, std::map, std::vector, std::cout; static const map keywords = { {"and", Token::Type::AND}, {"class", Token::Type::CLASS}, diff --git a/src/tokens.cpp b/src/tokens.cpp index 9756f79..037b6a1 100644 --- a/src/tokens.cpp +++ b/src/tokens.cpp @@ -1,6 +1,6 @@ #include "tokens.hpp" -using namespace std; +using std::string; Token::Token(Token::Type _tokentype, string _lexeme, string _literal, int _line) : lexeme(_lexeme), literal(_literal), line(_line), tokentype(_tokentype) {}