Skip to content

Conversation

@ednolan
Copy link
Member

@ednolan ednolan commented Nov 14, 2024

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.

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.
@ednolan ednolan merged commit 94adc3e into bemanproject:main Nov 14, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants