#include <string>   // string
#include <cstdlib>  // EXIT_SUCCESS

// Return a pointer to a new N-element heap array filled with val
// (not entirely realistic, but shows what's possible)
template <typename T, int N>
T* valarray(const T& val) {
  T* a = new T[N];
  for (int i = 0; i < N; ++i)
    a[i] = val;
  return a;
}

int main(int argc, char** argv) {
  int* ip = valarray<int, 10>(17);
  std::string* sp = valarray<std::string, 17>("hello");

  delete[] ip;
  delete[] sp;
  return EXIT_SUCCESS;
}