boostorg / boostorg/array

Non standard return fails to compile

Open
#29 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
24
Forks
55
PR merge metrics
No merged PRs in 30d

Description

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];

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.