Commit f846bb6
committed
Add template deduction guide for Slice constructor
PR #1367 added an explicit Slice constructor which allows constructing
from any C++ container.
This adds a template deduction guide for that constructor which allows
the Slice type to be inferred from the container's contained type.
This applies to C++17 only.
Note that, because C can be any type of container, we need to use a
template template parameter.
Test: cargo test
Test: cargo test -F c++14
Test: cargo test -F c++17
Test: cargo test -F c++201 parent 94e8e46 commit f846bb6
2 files changed
+37
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
891 | 891 | | |
892 | 892 | | |
893 | 893 | | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
899 | 924 | | |
900 | 925 | | |
901 | 926 | | |
| |||
0 commit comments