Listing 5: A simplified template implementation for a two-argument constructor

template<class TARGET, class ARG0, class ARG1>
Value* Ctor2::construct(const vector<Value*>& args) {
  ARG0 arg0 = value_cast<ARG0>(args[0]);
  ARG1 arg1 = value_cast<ARG1>(args[1]);
  TARGET* t = new TARGET(arg0,arg1);
  return new Value(t);
}
— End of Listing —