diff options
| author | jdhao <jdhao@hotmail.com> | 2021-11-08 21:57:21 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-11-08 21:57:21 +0800 |
| commit | e0c406a3443dfc08b0e62cf69fddcee0d68cb4de (patch) | |
| tree | 631882e6ce6ff718fd4343b12af668bdf7803ddc /my_snippets | |
| parent | db3b0024a6e2d880cee4571f51cbebc050903bf6 (diff) | |
add cpp snippets
Diffstat (limited to 'my_snippets')
| -rw-r--r-- | my_snippets/cpp.snippets | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/my_snippets/cpp.snippets b/my_snippets/cpp.snippets index 6bed2e9..c5a8210 100644 --- a/my_snippets/cpp.snippets +++ b/my_snippets/cpp.snippets @@ -60,6 +60,17 @@ void printMat(const vector<vector<T>>& mat, const string& desc){ } endsnippet +snippet pqueue "print queue" +template <class T> +void printQueue(T q){ + while(!q.empty()){ + std::cout << q.top() << " "; + q.pop(); + } + std::cout << '\n'; +} +endsnippet + snippet cout "print a variable" w cout << "$1: " << $2 << endl; endsnippet |
