Skip to content

Add init_attr<T>#57

Merged
saki7 merged 1 commit intomainfrom
add-init_attr
Feb 25, 2026
Merged

Add init_attr<T>#57
saki7 merged 1 commit intomainfrom
add-init_attr

Conversation

@saki7
Copy link
Member

@saki7 saki7 commented Feb 25, 2026

init_attr<T> is a special attr parser that resets the variable and always succeeds.

This can be used for constructing constexpr instance of a parser even when T has dynamically allocated storage. For example, normal attr(std::vector<int>{}) cannot be assigned to a constexpr instance, but init_attr<std::vector<int>> can.

@saki7 saki7 self-assigned this Feb 25, 2026
@saki7 saki7 added the enhancement New feature or request label Feb 25, 2026
@cppwarningnotifier
Copy link

EnvironmentC++23C++26
x4Clang21Debug✅success✅success
Release✅success✅success
GCC14Debug✅success✅success
Release✅success✅success
MSVC2022Debug✅success✅success
Release✅success✅success
2026Debug✅success✅success
Release✅success✅success

@saki7 saki7 merged commit 68467d6 into main Feb 25, 2026
65 of 68 checks passed
@saki7 saki7 deleted the add-init_attr branch February 25, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant