#include #include // Fixed‑string non‑type template parameter. // Stores the characters of a literal at compile time. template struct fixed_string { char buf[N]{}; // constexpr constructor copies characters. constexpr fixed_string(const char(&s)[N]) { for (std::size_t i = 0; i < N; ++i) buf[i] = s[i]; } // constexpr size query. constexpr std::size_t size() const { return N; } }; // Deduction guide from a string literal. template fixed_string(const char(&)[N]) -> fixed_string; // Example function taking a fixed_string NTTP. template void print_fixed() { std::cout << "fixed_string: " << S.buf << " (size=" << S.size() << ")" << std::endl; } int main() { print_fixed<"hello">(); return 0; }