Commit 26cd9f0
committed
Fail to compile with MI via class_ ctor parameters
We can't support this for classes from imported modules (which is the
primary purpose of a ctor argument base class) because we *have* to
have both parent and derived to properly extract a multiple-inheritance
base class pointer from a derived class pointer.
We could support this for actual `class_<Base, ...> instances, but since
in that case the `Base` is already present in the code, it seems more
consistent to simply always require MI to go via template options.
This also adds a new "number_of" template, mostly based on the `count_t`
removed in PR pybind#554, to count the number of satisfied templates; this is
basically just `constexpr_sum`, and uses that except for under MSVC
which doesn't think the constexpr is a constexpr.1 parent 819cb55 commit 26cd9f0
File tree
4 files changed
+42
-12
lines changed- include/pybind11
- tests
4 files changed
+42
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
885 | 885 | | |
886 | 886 | | |
887 | 887 | | |
888 | | - | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
889 | 899 | | |
890 | 900 | | |
891 | 901 | | |
892 | | - | |
| 902 | + | |
893 | 903 | | |
894 | 904 | | |
895 | 905 | | |
| |||
900 | 910 | | |
901 | 911 | | |
902 | 912 | | |
903 | | - | |
| 913 | + | |
904 | 914 | | |
905 | | - | |
| 915 | + | |
906 | 916 | | |
907 | 917 | | |
908 | | - | |
| 918 | + | |
909 | 919 | | |
910 | 920 | | |
911 | 921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
0 commit comments