\ingroup annotations Annotation for arguments
| 1234 | /// \ingroup annotations |
| 1235 | /// Annotation for arguments |
| 1236 | struct arg { |
| 1237 | /// Constructs an argument with the name of the argument; if null or omitted, this is a |
| 1238 | /// positional argument. |
| 1239 | constexpr explicit arg(const char *name = nullptr) |
| 1240 | : name(name), flag_noconvert(false), flag_none(true) {} |
| 1241 | /// Assign a value to this argument |
| 1242 | template <typename T> |
| 1243 | arg_v operator=(T &&value) const; |
| 1244 | /// Indicate that the type should not be converted in the type caster |
| 1245 | arg &noconvert(bool flag = true) { |
| 1246 | flag_noconvert = flag; |
| 1247 | return *this; |
| 1248 | } |
| 1249 | /// Indicates that the argument should/shouldn't allow None (e.g. for nullable pointer args) |
| 1250 | arg &none(bool flag = true) { |
| 1251 | flag_none = flag; |
| 1252 | return *this; |
| 1253 | } |
| 1254 | |
| 1255 | const char *name; ///< If non-null, this is a named kwargs argument |
| 1256 | bool flag_noconvert : 1; ///< If set, do not allow conversion (requires a supporting type |
| 1257 | ///< caster!) |
| 1258 | bool flag_none : 1; ///< If set (the default), allow None to be passed to this argument |
| 1259 | }; |
| 1260 | |
| 1261 | /// \ingroup annotations |
| 1262 | /// Annotation for arguments with values |
no outgoing calls
no test coverage detected