support for string default arguments specified as static arrays

This commit is contained in:
Wenzel Jakob 2016-02-07 13:29:17 +01:00
parent e206564ebf
commit 1f7a8096b7

View File

@ -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 {
}; };
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) { } };