|
|
|
|
|
by andreidd
1521 days ago
|
|
No, it can't. std::to_string isn't constexpr. And even if it was, it still wouldn't work because the std::string needs to be destroyed inside the constexpr context. The article is also wrong because std::to_chars isn't constexpr so you can't use that. |
|
In one thing you're actually right, I should have used a string_view for the return value instead.
The template metaprogramming to expand all values for get_fizzbuzz() is left as exercise.