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.
PR の目的
メタクラス
CLayoutInt
の単体テストを追加します。カテゴリ
PR の背景
#1268 CStrictIntegerと整数を比較するグローバル演算子の実装を修正する
#1268 (comment)
#1268 で試したのは比較演算子だけだったんですが、せっかくなので他の演算子のテストも実装してみました。
結論だけ言うと
CLayoutInt
って単なる int
です。このクラスの主な機能は、暗黙のインスタンス化や許可されない型変換をプログラマにさせないことです。単体テストコードはその性質上、ビルドできることが前提の動作チェックになりますので、そうなった状態の
CLayoutInt
は実態としてint
と変わらなかったりします。本来の機能に対する
automake
系のテストもそのうち書きますが、とりあえず挙動確認のたたきを作るのがこのPRの目的になります。PR のメリット
CLayoutInt
に単体テストが追加される。PR のデメリット (トレードオフとかあれば)
CLayoutInt
の本来の目玉機能である「許可されない変換を行おうとした場合にビルドエラーになる」のテストは実施できない。仕様・動作説明
テスト内容
PR の影響範囲
CLayoutInt
の機能追加・仕様変更に影響を与える可能性があります。関連 issue, PR
#1268 CStrictIntegerと整数を比較するグローバル演算子の実装を修正する
参考資料
https://docs.microsoft.com/en-us/cpp/cpp/cpp-built-in-operators-precedence-and-associativity
http://stlalv.la.coocan.jp/Operator.html