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
{{ message }}
Repository navigation
[BUG] no match for operator<< and const cpp2::nonesuch_ #961
Activity
sookach commentedon Apr 25, 2024
I believe this issue can be fixed. The most recent version generates the expected c++:
wolfseifert commentedon Apr 26, 2024
I can confirm that the transpiler output changed to:
#define CPP2_IMPORT_STD Yes #include "cpp2util.h" auto main() -> int; auto main() -> int{ std::any a {1}; std::cout << cpp2::impl::as_(a) << std::endl; std::cout << cpp2::impl::as_(cpp2::move(a)) << std::endl; }but trying to compile still gives:
anys.cpp:10:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream'} and 'const cpp2::nonesuch_') 10 | std::cout << cpp2::impl::as_(a) << std::endl; | ~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~ | | | | | const cpp2::nonesuch_ | std::ostream {aka std::basic_ostream}sookach commentedon Apr 26, 2024
Ah, my bad. I'll see what I can do to fix it.
hsutter commentedon May 15, 2024
Thanks! This should now be fixed with the above commit, please check.
Finish unifying the built-in "as" functions to remove the non-const o…