1.6 KiB
[cpp.embed.param.suffix]
15 Preprocessing directives [cpp]
15.4 Resource inclusion [cpp.embed]
15.4.2 Embed parameters [cpp.embed.param]
15.4.2.3 suffix parameter [cpp.embed.param.suffix]
An embed-parameter of the form
suffix ( pp-balanced-token-seqopt )
shall appear at most once in the embed-parameter-seq.
If the resource is empty, this embed-parameter is ignored.
Otherwise, the pp-balanced-token-seq is placed immediately after the comma-delimited list of the integral constant expressions.
[Example 1: constexpr unsigned char whl[] = {#embed "ches.glsl"
prefix(0xEF, 0xBB, 0xBF, ) /* a sequence of bytes */
suffix(,)0};// always null-terminated, contains the sequence if not emptyconstexpr bool is_empty = sizeof(whl) == 1 && whl[0] == '\0';constexpr bool is_not_empty = sizeof(whl) >= 4&& whl[sizeof(whl) - 1] == '\0'&& whl[0] == '\xEF' && whl[1] == '\xBB' && whl[2] == '\xBF';static_assert(is_empty || is_not_empty); â end example]