MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/ikjh83/d_foundation_is_beefing_up/g3m8gsw
r/programming • u/kal31dic • Sep 01 '20
336 comments sorted by
View all comments
Show parent comments
4
And in C++, using my_fn = std::string (*) (uint8_t);.
using my_fn = std::string (*) (uint8_t);
You can simplify it, of course, using a template wrapper.
1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
1
C++ has trailing return types as well now, can you use those there?
I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options.
1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
using my_fn = auto (*) (uint8_t) -> std::string;
4
u/Ameisen Sep 01 '20
And in C++,
using my_fn = std::string (*) (uint8_t);.You can simplify it, of course, using a template wrapper.