boostorg / boostorg/array

Non standard return fails to compile

オープン
#29 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
24
フォーク
55
PR マージ指標
30日以内にマージされた PR はありません

説明

This statement:
return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];

is a non-standard form of return.

In case we compile optimized code that lacks assert function but still want something this code fails to compile.

Separating this to a more standard form solves the issue:

BOOST_ASSERT_MSG( i < N, "out of range" );
return elems[i];

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。