Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Will best practice for the auto keyword change when c++ concepts finally arrive?

Of the 3 options below, the third seems best to me:

  SomeReallyLongTypeName* x = foo();  // old-school

  auto x = foo();  // c++11

  pointer x = foo();  // c++17 concepts


you can already do: auto *x = foo(); Which is actually more readable than "pointer".


Perhaps a better example be something like:

  smart_ptr<auto> x = foo();




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: