From 068b165a7a44eed21433ee3a7f3490ea8aca3cc5 Mon Sep 17 00:00:00 2001 From: mtoon <77199166+mtoons@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:08:42 +0100 Subject: [PATCH] changed c++ cout to a more efficient and polyvalent snippet (#381) the main use cases for cout is debugging which is mostly composed of outing variables not string, std::endl write '\n' and flush the stream which cause a unnecessary performance overhead in most of the cases --- snippets/cpp/cpp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/cpp/cpp.json b/snippets/cpp/cpp.json index 6fca7c6c..feb53017 100644 --- a/snippets/cpp/cpp.json +++ b/snippets/cpp/cpp.json @@ -204,7 +204,7 @@ }, "cout": { "prefix": "cout", - "body": ["std::cout << \"${1:message}\" << std::endl;"], + "body": ["std::cout << ${1:message};"], "description": "Code snippet for printing to std::cout, provided the header is set" }, "cin": {