Commit ff4a4ff
committed
Workaround for compilation failure on MSVC
This commit depends on
#27.
There is implementation divergence as to whether the following code is
accepted:
template <typename T>
struct foo {
static constexpr auto baz() {
return 0;
}
using quux = decltype(baz);
};
It is accepted by GCC and Clang, and rejected by MSVC and sometimes
by EDG: https://godbolt.org/z/dW964rqec
Because the calculation of the iterator_category depended on code of
this form, previously, MSVC would fail to compile iterator_interface
with this error:
error C3539: a template-argument cannot be a type that contains 'auto'
In order to work around this issue, the static member function-based
metaprogramming has been replaced with the use of std::conditional_t.
After this change, MSVC successfully compiles and runs all the tests.1 parent 47c8faa commit ff4a4ff
1 file changed
+11
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
160 | 156 | | |
161 | 157 | | |
162 | 158 | | |
| |||
0 commit comments