-
Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) · 9db98801
* Create templated abstract classes KeysView, ValuesView and ItemsView, and implement them on-the-fly when wrapping any specific map type * We don't want to wrap different ValuesView objects for double values and const double, for example, as both wrappers will be named ValuesView[float] * Fallback to C++ names if key or values types are not wrapped * Added a test for .keys(), .values() and .items() returning the same types for similarly-typed maps * Fixed wrong use of auto in a declarator list: the two descriptions might have different types * Fixes for clang-tidy issues: explicit single-argument constructor, using the 'override' keyword when overriding functions * Bugfix for old versions of clang++, which seem to have trouble with the struct being defined inside a module, which was also needlessly ugly anyway * Bugfix for clang++, which doesn't have some of the names in runtime uness they are specified to be static * A fix for clang-tidy performance-inefficient-string-concatenation issues - I personally think this looks uglier, but it's probably worth it for clang-tidy to be happy * Possible fix for clang++ linking issues - make the descriptions static constexpr to make sure they are known before linking * Correct names for previously-wrapped types as keys/values of maps * Bugfix - typo in type info names which caused things to segfault * Apply suggestions from code review Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com> * Use detail::remove_cvref_t instead of doing remove_cv and remove_reference separately * Avoid names with double underscore, as they are reserved * Improved testing for KeysView, ValuesView and ItemsView: check type names + stricter asserts * Moved description logic to helper function in type_caster_base.h * style: pre-commit fixes * Fix a clang-tidy issue: do not use 'else' after 'return' * Apply suggestion by @Skylion007, with additional trivial simplification. Co-authored-by: Amir <aimir@local> Co-authored-by: aimir <aimir@localhost> Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
aimir committed
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| detail | Loading commit data... | |
| eigen | Loading commit data... | |
| stl | Loading commit data... | |
| attr.h | Loading commit data... | |
| buffer_info.h | Loading commit data... | |
| cast.h | Loading commit data... | |
| chrono.h | Loading commit data... | |
| common.h | Loading commit data... | |
| complex.h | Loading commit data... | |
| eigen.h | Loading commit data... | |
| embed.h | Loading commit data... | |
| eval.h | Loading commit data... | |
| functional.h | Loading commit data... | |
| gil.h | Loading commit data... | |
| iostream.h | Loading commit data... | |
| numpy.h | Loading commit data... | |
| operators.h | Loading commit data... | |
| options.h | Loading commit data... | |
| pybind11.h | Loading commit data... | |
| pytypes.h | Loading commit data... | |
| stl.h | Loading commit data... | |
| stl_bind.h | Loading commit data... |