diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h index 92fceeb4..cfa50903 100644 --- a/include/pybind11/attr.h +++ b/include/pybind11/attr.h @@ -20,6 +20,7 @@ template struct arg_t; struct arg { arg(const char *name) : name(name) { } template arg_t operator=(const T &value); + template arg_t operator=(T const (&value)[N]); const char *name; }; @@ -32,6 +33,9 @@ template struct arg_t : public arg { }; template arg_t arg::operator=(const T &value) { return arg_t(name, value); } +template arg_t arg::operator=(T const (&value)[N]) { + return operator=((const T *) value); +} /// Annotation for methods struct is_method { handle class_; is_method(const handle &c) : class_(c) { } };