From 25602409b625635c519b4249aea83661c777467a Mon Sep 17 00:00:00 2001 From: Lorenzo Ravaglia Date: Thu, 7 Sep 2023 20:07:35 +0200 Subject: [PATCH] refactor(file-templates): c++-mode/__main.cpp: modernize - Drops `using namespace std`: a known anti-pattern which imports a massive namespace into the global namespace. See https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice - Modernizes/generalizes `main`'s signature with a trailing return type (C++11) Ref: https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice Close: #7387 --- modules/editor/file-templates/templates/c++-mode/__main.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/editor/file-templates/templates/c++-mode/__main.cpp b/modules/editor/file-templates/templates/c++-mode/__main.cpp index b4a1557a8..b3554503f 100644 --- a/modules/editor/file-templates/templates/c++-mode/__main.cpp +++ b/modules/editor/file-templates/templates/c++-mode/__main.cpp @@ -4,9 +4,7 @@ # -- #include -using namespace std; - -int main(int argc, char *argv[]) { +auto main(int argc, char *argv[]) -> int { $0 return 0;