We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
template for
Is your feature request related to a problem? Please describe.
I was trying to use the template for syntax, but it wasn't clear to me from the proposal how and in what contexts it is supposed to work.
I am trying this example ...
struct test { int one; int two; int three; }; template<typename T> consteval void template_for_expansion_stmt() { template for(constexpr auto member : std::meta::define_static_array( std::meta::nonstatic_data_members_of(^T))) { // ... } } int main() { template_for_expansion_stmt<test>(); }
I get this error
clang++ -std=c++26 -stdlib=libc++ -freflection -fparameter-reflection -fconsteval-blocks -fexpansion-statements main.cxx -o main src/main.cxx:43:42: error: cannot decompose private member '__data_' of 'std::span<const meta::info>' 43 | template for(constexpr auto member : std::meta::define_static_array( | ^ src/main.cxx:51:5: note: in instantiation of function template specialization 'template_for_expansion_stmt<test>' requested here 51 | template_for_expansion_stmt<test>(); | ^ /home/user/.local/llvm-reflect/bin/../include/c++/v1/span:568:11: note: declared private here 568 | pointer __data_; | ^ src/main.cxx:43:42: error: cannot decompose private member '__size_' of 'std::span<const meta::info>' 43 | template for(constexpr auto member : std::meta::define_static_array( | ^ /home/user/.local/llvm-reflect/bin/../include/c++/v1/span:569:13: note: declared private here 569 | size_type __size_; | ^ 2 errors generated.
Thank you for the help!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
I was trying to use the
template for
syntax, but it wasn't clear to me from the proposal how and in what contexts it is supposed to work.I am trying this example ...
I get this error
Thank you for the help!
The text was updated successfully, but these errors were encountered: