add macro to print valiable easy-to-see#3
Open
708yamaguchi wants to merge 2 commits intoitohdak:masterfrom
Open
add macro to print valiable easy-to-see#3708yamaguchi wants to merge 2 commits intoitohdak:masterfrom
708yamaguchi wants to merge 2 commits intoitohdak:masterfrom
Conversation
Contributor
Author
|
thanks to @ykawamura96 |
itohdak
requested changes
Feb 7, 2020
Owner
itohdak
left a comment
There was a problem hiding this comment.
ところで,この書き方だと,
ve: [ 0 1 2 3 4 5 6 7 8 9 ]
^ ^
みたいに最初と最後に空白入っちゃうけど,いいんだっけ?
itohdak
reviewed
Feb 7, 2020
Contributor
Author
この書き方についてなんだけど、マクロを短くするためにこういう書き方をしてしまった。 どうしましょう? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
整数型の変数やコンテナ型の変数の中身を簡単に見やすく表示するマクロを追加しました。
複数文に渡るマクロはdo-whileで囲わないと文字列を置換した時に予期せぬエラーを起こす可能性があるらしいので、少し長いですがdo-whileで囲っておきました。
https://www.jpcert.or.jp/sc-rules/c-pre10-c.html
今の状態では、表示可能/不可能な型は以下のとおりです。
表示可能
表示不可能
mapに関しては、<<演算子をpair型用にオーバーロードしたら表示できるようになります。
setに関しては、check_vの中のfor文を(auto it=vec.begin(); it!=vec.end(); it++)としたら表示できるようになりますが、そうすると固定長配列が表示できなくなるので難しいところです。