Commit 1f7a8096 by Wenzel Jakob

support for string default arguments specified as static arrays

parent e206564e
...@@ -20,6 +20,7 @@ template <typename T> struct arg_t; ...@@ -20,6 +20,7 @@ template <typename T> struct arg_t;
struct arg { struct arg {
arg(const char *name) : name(name) { } arg(const char *name) : name(name) { }
template <typename T> arg_t<T> operator=(const T &value); template <typename T> arg_t<T> operator=(const T &value);
template <typename T, size_t N> arg_t<const T *> operator=(T const (&value)[N]);
const char *name; const char *name;
}; };
...@@ -32,6 +33,9 @@ template <typename T> struct arg_t : public arg { ...@@ -32,6 +33,9 @@ template <typename T> struct arg_t : public arg {
}; };
template <typename T> arg_t<T> arg::operator=(const T &value) { return arg_t<T>(name, value); } template <typename T> arg_t<T> arg::operator=(const T &value) { return arg_t<T>(name, value); }
template <typename T, size_t N> arg_t<const T *> arg::operator=(T const (&value)[N]) {
return operator=((const T *) value);
}
/// Annotation for methods /// Annotation for methods
struct is_method { handle class_; is_method(const handle &c) : class_(c) { } }; struct is_method { handle class_; is_method(const handle &c) : class_(c) { } };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment