File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1085,7 +1085,7 @@ Wrapper classes
1085
1085
*Note *: The C string will be deleted when the `str ` instance is garbage
1086
1086
collected.
1087
1087
1088
- .. cpp :function :: template <typename ... Args> str format (Args&&... args)
1088
+ .. cpp :function :: template <typename ... Args> str format (Args&&... args) const
1089
1089
1090
1090
C++ analog of the Python routine ``str.format ``. Can be called with
1091
1091
positional and keyword arguments.
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ detail::accessor<detail::num_item_tuple> tuple::operator[](T index) const {
250
250
return { derived (), (Py_ssize_t) index };
251
251
}
252
252
253
- template <typename ... Args> str str::format (Args&&... args) {
253
+ template <typename ... Args> str str::format (Args&&... args) const {
254
254
return steal<str>(
255
255
derived ().attr (" format" )((detail::forward_t <Args>) args...).release ());
256
256
}
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ class str : public object {
427
427
explicit str (const char *s, size_t n)
428
428
: object(detail::str_from_cstr_and_size(s, n), detail::steal_t{}) { }
429
429
430
- template <typename ... Args> str format (Args&&... args);
430
+ template <typename ... Args> str format (Args&&... args) const ;
431
431
432
432
const char *c_str () const { return PyUnicode_AsUTF8AndSize (m_ptr, nullptr ); }
433
433
};
You can’t perform that action at this time.
0 commit comments