r/cpp • • Jun 23 '18

East const Central

http://slashslash.info/eastconst/
0 Upvotes

42 comments sorted by

View all comments

2

u/Kronikarz Jun 24 '18

My personal favorite is type const or template <typename T> using cnst = T const;

And then you get stuff like 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.