\ingroup annotations Annotation for arguments
| 1963 | /// \ingroup annotations |
| 1964 | /// Annotation for arguments |
| 1965 | struct arg { |
| 1966 | /// Constructs an argument with the name of the argument; if null or omitted, this is a |
| 1967 | /// positional argument. |
| 1968 | constexpr explicit arg(const char *name = nullptr) |
| 1969 | : name(name), flag_noconvert(false), flag_none(true) {} |
| 1970 | /// Assign a value to this argument |
| 1971 | template <typename T> |
| 1972 | arg_v operator=(T &&value) const; |
| 1973 | /// Indicate that the type should not be converted in the type caster |
| 1974 | arg &noconvert(bool flag = true) { |
| 1975 | flag_noconvert = flag; |
| 1976 | return *this; |
| 1977 | } |
| 1978 | /// Indicates that the argument should/shouldn't allow None (e.g. for nullable pointer args) |
| 1979 | arg &none(bool flag = true) { |
| 1980 | flag_none = flag; |
| 1981 | return *this; |
| 1982 | } |
| 1983 | |
| 1984 | const char *name; ///< If non-null, this is a named kwargs argument |
| 1985 | bool flag_noconvert : 1; ///< If set, do not allow conversion (requires a supporting type |
| 1986 | ///< caster!) |
| 1987 | bool flag_none : 1; ///< If set (the default), allow None to be passed to this argument |
| 1988 | }; |
| 1989 | |
| 1990 | /// \ingroup annotations |
| 1991 | /// Annotation for arguments with values |
no outgoing calls