You need to be able to manipulate template arguments
template <std::string temp> void f() {
Now, implantation will need to create a unique sequence of characters for std::string or, for that matter, any other arbitrary user class that stores a specific value, the value of which is unknown to the implementation, and besides, the value of arbitrary class objects cannot be computed at compile time.
It is planned to consider the possibility of using literal types as template types for post-C ++ 0x, which are initialized with constant expressions. This can be distorted if the data elements are recursively crippled in accordance with their values โโ(for base classes, for example, we can use depth traversal, first from left to right). But this will definitely not work for arbitrary classes.
Johannes Schaub - litb Apr 16 2018-11-11T00: 00Z
source share