You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structFoo1 {
int data;
};
structFoo2 {
int data;
Foo2() = default;
};
structFoo3 {
int data;
Foo3(constint data): data{data} {}
};
But once the constructor accepts more than one arugments, we will get an error, like this:
structFoo4 {
int data;
Foo4() = default; // with or without it just lead to the same errorFoo4(constint data, constbool bar): data{data} {}
}
FAILED: CMakeFiles/symusic.dir/src/io/alpaca.cpp.obj
C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\cl.exe /nologo /TP -DFMT_HEADER_ONLY=1 -IC:\Users\nhy\symusic-libra\include -IC:\Users\nhy\symusic-libra\3rdparty\minimidi\include -IC:\Users\nhy\symusic-libra\3rdparty\pdqsort -IC:\Users\nhy\symusic-libra\3rdparty\zpp_bits -IC:\Users\nhy\symusic-libra\3rdparty\fmt\include -IC:\Users\nhy\symusic-libra\3rdparty\alpaca\include /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -std:c++20 -MDd /GL -bigobj /showIncludes /FoCMakeFiles\symusic.dir\src\io\alpaca.cpp.obj /FdCMakeFiles\symusic.dir\symusic.pdb /FS -c C:\Users\nhy\symusic-libra\src\io\alpaca.cpp
C:\Users\nhy\symusic-libra\3rdparty\alpaca\include\alpaca/detail/struct_nth_field.h(21): error C3448: the number of identifiers must match the number of array elements or members in a structured binding declaration
C:\Users\nhy\symusic-libra\3rdparty\alpaca\include\alpaca/detail/struct_nth_field.h(21): note: the template instantiation context (the oldest one first) is
C:\Users\nhy\symusic-libra\src\io\alpaca.cpp(104): note: see reference to function template instantiation 'std::vector<uint8_t,std::allocator<uint8_t>> symusic::details::serailize_alpaca<symusic::Foo4>(const symusic::Foo4 &)' being compiled
C:\Users\nhy\symusic-libra\src\io\alpaca.cpp(29): note: see reference to function template instantiation 'size_t alpaca::serialize<T,2,std::vector<uint8_t,std::allocator<uint8_t>>>(const T &,Container &)' being compiled
with
[
T=symusic::Foo4,
Container=std::vector<uint8_t,std::allocator<uint8_t>>
]
C:\Users\nhy\symusic-libra\3rdparty\alpaca\include\alpaca/alpaca.h(152): note: see reference to function template instantiation 'void alpaca::detail::serialize_helper<alpaca::options::none,T,2,std::vector<uint8_t,std::allocator<uint8_t>>,0>(const T &,Container &,size_t &)' being compiled
with
[
T=symusic::Foo4,
Container=std::vector<uint8_t,std::allocator<uint8_t>>
]
C:\Users\nhy\symusic-libra\3rdparty\alpaca\include\alpaca/alpaca.h(135): note: see reference to function template instantiation 'decltype(auto) alpaca::detail::get<0,const T&,2>(type) noexcept' being compiled
with
[
T=symusic::Foo4,
type=const symusic::Foo4 &
]
ninja: build stopped: subcommand failed.
Note that I'm using c++20 and msvc 19.38.33133.0 on windows11. And I have read the similar issue #24
The text was updated successfully, but these errors were encountered:
I also get similar error with Clang 11 and GCC 9 on linux like
/data/include/alpaca/detail/struct_nth_field.h:14:11: error: type 'const hos::xs::Sk<float>' decomposes into 6 elements, but only 1 names were provided
[build] auto &[p1] = value;
The only 1 names part would change to only 2 names if I change the constructor from 1 argument to 2 arguments. The struct Sk has 6 members.
The following 3 cases could pass compile
But once the constructor accepts more than one arugments, we will get an error, like this:
Note that I'm using c++20 and msvc 19.38.33133.0 on windows11. And I have read the similar issue #24
The text was updated successfully, but these errors were encountered: