Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

Besides types, templates can also be parametrized using non-type arguments from a limited set of structural types. In C++11, the selection was limited to integral types, enumerations and pointers/references to global objects. C++17 introduced a syntactic change, allowing auto to be used instead of a concrete type. Finally, C++20 added support for floating-point types and literal class types (that only have public members and are recursively structural). The argument is available in the template scope as a constant object. A prvalue for non-class types (except for lvalue reference); for class types, the argument is considered a static storage duration object. Compiler Explorer link: https://lnkd.in/eDeSdDFE #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text

To view or add a comment, sign in

Explore content categories