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
#include<iostream>usingnamespacestd;automyfun(in auto x, forward auto y) {
cout << x << endl;
y = "goodbye";
auto z = 0;
return tuple{y, z};
}
intmain() {
auto [y, z] = myfun(1, string("hey"));
cout << y <<endl;
cout << z;
}
Error log
<source>:13:19: error: no matching function for call to 'myfun'
auto [y, z] = myfun(1, string("hey"));
^~~~~
<source>:4:6: note: candidate ignored; expected deduced type 'auto' but got 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>'
auto myfun(in auto x, forward auto y) {
^
1 error generated.
ASM generation compiler returned: 1
<source>:13:19: error: no matching function for call to 'myfun'
auto [y, z] = myfun(1, string("hey"));
^~~~~
<source>:4:6: note: candidate ignored; expected deduced type 'auto' but got 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>'
auto myfun(in auto x, forward auto y) {
^
1 error generated.
Execution build compiler returned: 1
Thanks, and sorry for the lag. #14 captures that the implementation of forward generally is not yet complete. . This issue is more than a duplicate of 14 so I'll leave it open as well. Both issues should be fixed when forward is completed. Thanks!
Thanks for this great proposal!
I was trying this at https://cppx.godbolt.org. I faced this issue that
forward auto
does not compile:https://cppx.godbolt.org/z/ezPz7K
Error log
In comparison this compiles:
https://cppx.godbolt.org/z/66YbnT
or this
https://cppx.godbolt.org/z/q64YfP
Feel free to transfer this issue to the proper repository that contains the actual implementation.
The text was updated successfully, but these errors were encountered: