nholthaus / units

a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.
http://nholthaus.github.io/units/
MIT License
952 stars 135 forks source link

`typename` vs `class` for template parameters #166

Closed JohelEGP closed 6 years ago

JohelEGP commented 6 years ago

What's this library's convention for when to use one or the other? I find it hard to infer from the uses, as sometimes is seems contradicting from what I had previously inferred. I personally follow the standard's and only use class.

nholthaus commented 6 years ago

there is no convention. Since c++17 I think both keywords are allowed in template template definitions so I don't think there's a functional difference between the two anymore.

Morwenn commented 6 years ago

Can confirm the lack of difference in C++17.

JohelEGP commented 6 years ago

Of course, the difference is only syntactical. I asked because some places use different keywords for the same parameter, and I wanted to be consistent.

nholthaus commented 6 years ago

understood. Pick whichever you prefer.