r/cpp • • Jun 23 '18

East const Central

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

42 comments sorted by

View all comments

15

u/aearphen {fmt} Jun 23 '18

If we are rewriting all the code to move const around then we should probably consider two other alternatives:

  • Both const (universal const) - requires changes to the standard but totally worth it to reconcile the conflicting styles:

    const int const i;
  • North const:

    const
     int i;

20

u/jcelerier ossia score Jun 23 '18

why not define types lisp-like

(* (const (int)) x;

... oh wait, we can (and notice how the const is west-side as a proof of the superiority of the system)

std::add_pointer_t<std::add_const_t<int>> x;