From 1f7a8096b7a1cfdaf8e5b91720232560ad4d988f Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 7 Feb 2016 13:29:17 +0100 Subject: [PATCH] support for string default arguments specified as static arrays --- include/pybind11/attr.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h index 92fceeb4c..cfa509030 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) { } };