2 ms·
In C++ you can use indifferently either the class or typename keyword to introduce template arguments (because of course you can). A lot of styleguides suggest
by gpderetta 1y ago
In C++ you can use indifferently either the class or typename keyword to introduce template arguments (because of course you can). A lot of styleguides suggest using typename because class is slightly misleading (the type could be anything not just a class).
In practice everybody just uses class, because who as the time to type the full keyword and signature declarations in C++ are already unwieldy as it is.
- pjmlp 1y agoAnyone using a proper IDE instead of notepad like editor.
- gpderetta 1y agoI do use a proper ide with with clangd completion and all kind of helper macros, but I can still type 'class' faster than I can trigger completion.
- TinkersW 1y agoI have that and still prefer class, easier to type(not just shorter, but easier keys) and less to read. Only use typename in the rare case where it is required