Skip to content

Commit 813bc83

Browse files
committed
Rename arg_literal to arg_base
1 parent ca4e12d commit 813bc83

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

include/pybind11/attr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ struct process_attribute<arg> : process_attribute_default<arg> {
482482
}
483483
};
484484
template <>
485-
struct process_attribute<detail::arg_literal> : process_attribute<arg> {};
485+
struct process_attribute<detail::arg_base> : process_attribute<arg> {};
486486

487487
/// Process a keyword argument attribute (*with* a default value)
488488
template <>
@@ -687,7 +687,7 @@ using extract_guard_t = typename exactly_one_t<is_call_guard, call_guard<>, Extr
687687

688688
/// Check the number of named arguments at compile time
689689
template <typename... Extra,
690-
size_t named = constexpr_sum(std::is_base_of<arg_literal, Extra>::value...),
690+
size_t named = constexpr_sum(std::is_base_of<arg_base, Extra>::value...),
691691
size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>
692692
constexpr bool expected_num_args(size_t nargs, bool has_args, bool has_kwargs) {
693693
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(nargs, has_args, has_kwargs);

include/pybind11/cast.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,21 +1314,21 @@ PYBIND11_NAMESPACE_BEGIN(detail)
13141314

13151315
/// \ingroup annotations
13161316
/// Annotation for arguments
1317-
struct arg_literal {
1317+
struct arg_base {
13181318
/// Constructs an argument with the name of the argument; if null or omitted, this is a
13191319
/// positional argument.
1320-
constexpr explicit arg_literal(const char *name = nullptr)
1320+
constexpr explicit arg_base(const char *name = nullptr)
13211321
: name(name), flag_noconvert(false), flag_none(true) {}
13221322

13231323
/// Assign a value to this argument
13241324
template <typename T>
13251325
arg_v operator=(T &&value) const;
13261326

13271327
/// Indicate that the type should not be converted in the type caster
1328-
arg_literal &noconvert(bool flag = true);
1328+
arg_base &noconvert(bool flag = true);
13291329

13301330
/// Indicates that the argument should/shouldn't allow None (e.g. for nullable pointer args)
1331-
arg_literal &none(bool flag = true);
1331+
arg_base &none(bool flag = true);
13321332

13331333
const char *name; ///< If non-null, this is a named kwargs argument
13341334
bool flag_noconvert : 1; ///< If set, do not allow conversion (requires a supporting type
@@ -1338,11 +1338,11 @@ struct arg_literal {
13381338

13391339
PYBIND11_NAMESPACE_END(detail)
13401340

1341-
struct arg : detail::arg_literal {
1341+
struct arg : detail::arg_base {
13421342
// NOLINTNEXTLINE(google-explicit-constructor)
1343-
arg(const detail::arg_literal &arg_l) : detail::arg_literal{arg_l} {}
1343+
arg(const detail::arg_base &arg_b) : detail::arg_base{arg_b} {}
13441344

1345-
explicit arg(const char *name = nullptr) : detail::arg_literal{name} {}
1345+
explicit arg(const char *name = nullptr) : detail::arg_base{name} {}
13461346

13471347
/// Assign a value to this argument
13481348
template <typename T>
@@ -1364,7 +1364,7 @@ struct arg_v : arg {
13641364
// cannot access private member declared in class 'pybind11::arg_v'
13651365
private:
13661366
#endif
1367-
friend struct arg_literal;
1367+
friend struct arg_base;
13681368
template <typename T>
13691369
arg_v(arg &&base, T &&x, const char *descr = nullptr)
13701370
: arg(base), value(reinterpret_steal<object>(detail::make_caster<T>::cast(
@@ -1429,16 +1429,16 @@ struct pos_only {};
14291429
PYBIND11_NAMESPACE_BEGIN(detail)
14301430

14311431
template <typename T>
1432-
arg_v arg_literal::operator=(T &&value) const {
1432+
arg_v arg_base::operator=(T &&value) const {
14331433
return {*this, std::forward<T>(value)};
14341434
}
14351435

1436-
inline arg_literal &arg_literal::noconvert(bool flag) {
1436+
inline arg_base &arg_base::noconvert(bool flag) {
14371437
flag_noconvert = flag;
14381438
return *this;
14391439
}
14401440

1441-
inline arg_literal &arg_literal::none(bool flag) {
1441+
inline arg_base &arg_base::none(bool flag) {
14421442
flag_none = flag;
14431443
return *this;
14441444
}
@@ -1458,8 +1458,8 @@ inline namespace literals {
14581458
/** \rst
14591459
String literal version of `arg`
14601460
\endrst */
1461-
constexpr detail::arg_literal operator"" _a(const char *name, size_t) {
1462-
return detail::arg_literal(name);
1461+
constexpr detail::arg_base operator"" _a(const char *name, size_t) {
1462+
return detail::arg_base(name);
14631463
}
14641464
} // namespace literals
14651465

include/pybind11/pytypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct arg;
4545
struct arg_v;
4646

4747
PYBIND11_NAMESPACE_BEGIN(detail)
48-
struct arg_literal;
48+
struct arg_base;
4949
class args_proxy;
5050
bool isinstance_generic(handle obj, const std::type_info &tp);
5151

@@ -1280,7 +1280,7 @@ class args_proxy : public handle {
12801280

12811281
/// Python argument categories (using PEP 448 terms)
12821282
template <typename T>
1283-
using is_keyword = std::is_base_of<detail::arg_literal, T>;
1283+
using is_keyword = std::is_base_of<detail::arg_base, T>;
12841284
template <typename T>
12851285
using is_s_unpacking = std::is_same<args_proxy, T>; // * unpacking
12861286
template <typename T>

0 commit comments

Comments
 (0)