15 Preprocessing directives [cpp]

15.4 Resource inclusion [cpp.embed]

15.4.2 Embed parameters [cpp.embed.param]

15.4.2.2 offset parameter [cpp.embed.param.offset]

An embed-parameter of the form offset ( pp-balanced-token-seq ) denotes the number of elements to be skipped from the resource.
It shall appear at most once in the embed-parameter-seq.
The pp-balanced-token-seq is evaluated as a constant-expression using the rules as described in conditional inclusion ([cpp.cond]), but without being processed as in normal text an additional time.
The constant-expression shall be an integral constant expression whose value is greater than or equal to zero.
[Example 1: constexpr const unsigned char arr[] = { // a hypothetical resource capable of expanding to four or more elements #embed <sdk/jump.wav> }; constexpr const unsigned char offset_arr[] = { // the same hypothetical resource capable of expanding to four or more elements #embed <sdk/jump.wav> offset(2) }; constexpr const unsigned char offset_limit_arr[] = { // the same hypothetical resource capable of expanding to four or more elements #embed <sdk/jump.wav> offset(1) limit(1) }; static_assert(arr[2] == offset_arr[0]); // OK static_assert(arr[3] == offset_arr[1]); // OK static_assert(arr[1] == offset_limit_arr[0]); // OK — end example]