Skip to content

Commit

Permalink
changed c++ cout to a more efficient and polyvalent snippet (#381)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mtoons authored Nov 27, 2023
1 parent 83c54cd commit 068b165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snippets/cpp/cpp.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 068b165

Please sign in to comment.