MCPcopy Create free account
hub / github.com/pybind/pybind11 / arg

Class arg

include/pybind11/cast.h:1965–1988  ·  view source on GitHub ↗

\ingroup annotations Annotation for arguments

Source from the content-addressed store, hash-verified

1963/// \ingroup annotations
1964/// Annotation for arguments
1965struct 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

Callers 15

add_ostream_redirectFunction · 0.70
arg_vMethod · 0.70
operator""_aFunction · 0.70
pybind11.hFile · 0.70
enum_Method · 0.70
vector_if_equal_operatorFunction · 0.70
vector_modifiersFunction · 0.70
TEST_SUBMODULEFunction · 0.50
TEST_SUBMODULEFunction · 0.50
TEST_SUBMODULEFunction · 0.50
TEST_SUBMODULEFunction · 0.50

Calls

no outgoing calls

Tested by 15

TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
TEST_SUBMODULEFunction · 0.40
register_testFunction · 0.40