[cpp.embed.param.if.empty]

# 15 Preprocessing directives [[cpp]](./#cpp)

## 15.4 Resource inclusion [[cpp.embed]](cpp.embed#param.if.empty)

### 15.4.2 Embed parameters [[cpp.embed.param]](cpp.embed.param#if.empty)

#### 15.4.2.4 if_empty parameter [cpp.embed.param.if.empty]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/preprocessor.tex#L1166)

An embed-parameter of the form

if_empty ( [*pp-balanced-token-seq*](cpp.pre#nt:pp-balanced-token-seq "15.1 Preamble [cpp.pre]")opt )

shall appear at most once in the [*embed-parameter-seq*](cpp.pre#nt:embed-parameter-seq "15.1 Preamble [cpp.pre]")[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/preprocessor.tex#L1173)

If the resource is not empty, this [*embed-parameter*](cpp.pre#nt:embed-parameter "15.1 Preamble [cpp.pre]") is ignored[.](#2.sentence-1)

Otherwise, the #embed directive is replaced by the[*pp-balanced-token-seq*](cpp.pre#nt:pp-balanced-token-seq "15.1 Preamble [cpp.pre]")[.](#2.sentence-2)

[*Example [1](#example-1)*:

limit(0) affects when a resource is considered empty[.](#2.sentence-3)

Therefore, the following program:

#embed </owo/uwurandom> \
 if_empty(42203) limit(0) expands to42203

â *end example*]

[*Example [2](#example-2)*:

This resource is considered empty due to the limit(0) [*embed-parameter*](cpp.pre#nt:embed-parameter "15.1 Preamble [cpp.pre]"),
always, including in __has_embed clauses[.](#2.sentence-6)

int infinity_zero () {#if __has_embed(</owo/uwurandom> limit(0) prefix(some tokens)) == __STDC_EMBED_EMPTY__ // if </owo/uwurandom> exists, this conditional inclusion branch is taken and the function returns 0.return 0;#else// otherwise, the resource does not exist#error "The resource does not exist"#endif} â *end example*]
