[meta.define.static] # 21 Metaprogramming library [[meta]](./#meta) ## 21.4 Reflection [[meta.reflection]](meta.reflection#meta.define.static) ### 21.4.3 Promoting to static storage strings [meta.define.static] [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3367) The functions in this subclause promote compile-time storage into static storage[.](#1.sentence-1) [🔗](#lib:define_static_string) `template consteval const ranges::range_value_t* define_static_string(R&& r); ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3377) *Effects*: Equivalent to:return extract*>(meta::reflect_constant_string(r)); [🔗](#lib:define_static_array) `template consteval span> define_static_array(R&& r); ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3392) *Effects*: Equivalent to:using T = ranges::range_value_t; meta::info array = meta::reflect_constant_array(r);if (is_array_type(type_of(array))) {return span(extract(array), extent(type_of(array)));} else {return span();} [🔗](#lib:define_static_object) `template consteval const remove_cvref_t* define_static_object(T&& t); ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3413) *Effects*: Equivalent to:using U = remove_cvref_t;if constexpr (is_class_type(^^U)) {return addressof(extract(meta::reflect_constant(std::forward(t))));} else {return define_static_array(span(addressof(t), 1)).data();} [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3425) [*Note [1](#note-1)*: For class types,define_static_object provides the address of the template parameter object ([[temp.param]](temp.param "13.2 Template parameters")) that is template-argument equivalent to t[.](#5.sentence-1) — *end note*]