boostorg / boostorg/array

Non standard return fails to compile

未关闭
#29 4 条评论 0 个 reaction 已指派 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];

贡献指南

这个仓库没有索引到贡献指南

调研方向

Search the Boost.Array source for the exact return statement containing BOOST_ASSERT_MSG and elems[i], then inspect its surrounding function. Separate the assertion from the return as described and build the optimized configuration to confirm it compiles; run the relevant Boost.Array tests to verify behavior remains unchanged.

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
backend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。