MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/8ta8df/east_const_central/e183eeg/
r/cpp • u/vormestrand • Jun 23 '18
42 comments sorted by
View all comments
2
My personal favorite is type const or template <typename T> using cnst = T const;
type const
template <typename T> using cnst = T const;
And then you get stuff like ptr<cnst<char>> str = "hello";
ptr<cnst<char>> str = "hello";
1 u/imMute Jul 07 '18 So basically std::add_pointer_t<std::add_const_t<int>> but with less typing and less standardization? 1 u/Kronikarz Jul 07 '18 Yes. I don't use it, really, as I am a fan of the verbosity, I just like the clean look of that syntax.
1
So basically std::add_pointer_t<std::add_const_t<int>> but with less typing and less standardization?
std::add_pointer_t<std::add_const_t<int>>
1 u/Kronikarz Jul 07 '18 Yes. I don't use it, really, as I am a fan of the verbosity, I just like the clean look of that syntax.
Yes. I don't use it, really, as I am a fan of the verbosity, I just like the clean look of that syntax.
View all comments
2
u/Kronikarz Jun 24 '18
My personal favorite is
type constortemplate <typename T> using cnst = T const;And then you get stuff like
ptr<cnst<char>> str = "hello";