Skip to content

Commit 2ad61e1

Browse files
annotations_of : アノテーションの値が reflect_constant() で変換されるとき、テンプレート引数と同様に、クラス型には const が付く
Co-authored-by: Raclamusi <61970673+Raclamusi@users.noreply.github.com>
1 parent 2bc3273 commit 2ad61e1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

reference/meta/annotations_of.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int main() {
4242
// 型ごとに値を取り出して出力
4343
// アノテーションは値のリフレクションではないため、
4444
// constant_of()で値を取り出してからスプライスする
45-
if constexpr (std::meta::type_of(a) == ^^Label) {
45+
if constexpr (std::meta::type_of(a) == ^^const Label) {
4646
std::println(" 値: {}", [:std::meta::constant_of(a):].text);
4747
} else if constexpr (std::meta::type_of(a) == ^^int) {
4848
std::println(" 値: {}", [:std::meta::constant_of(a):]);

0 commit comments

Comments
 (0)