Skip to content

Commit cfe6abb

Browse files
reflection: string_viewは構造的型ではないのでアノテーションに使用できず、文字列リテラルはdefine_static_stringでラップする必要がある
Co-authored-by: Raclamusi <61970673+Raclamusi@users.noreply.github.com>
1 parent 32cd88c commit cfe6abb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reference/meta/annotations_of.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace std::meta {
2626
2727
struct Label { const char* text; };
2828
29-
struct [[=Label{"my struct"}, =42]] S {};
29+
struct [[=Label{std::define_static_string("my struct")}, =42]] S {};
3030
3131
int main() {
3232
constexpr auto annots = std::meta::annotations_of(^^S);

0 commit comments

Comments
 (0)