Created
September 19, 2021 18:44
-
-
Save marzer/b20752bde5f30995ceea71370ebbba1a to your computer and use it in GitHub Desktop.
MSVC Template partial specialization bug repro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
struct type_and_nttps | |
{ | |
static constexpr bool value = false; | |
}; | |
template <template <typename> typename T, typename U> | |
struct type_and_nttps<T<U>> | |
{ | |
static constexpr bool value = false; | |
}; | |
template <template <typename, auto...> typename T, typename U, auto... N> | |
struct type_and_nttps<T<U, N...>> | |
{ | |
static constexpr bool value = true; | |
}; | |
template <typename TN> | |
struct test{}; | |
template <typename T, int N> | |
struct vector{}; | |
template <typename T, int R, int C> | |
struct matrix{}; | |
static_assert(!type_and_nttps<float>::value); | |
static_assert(!type_and_nttps<test<float>>::value); | |
static_assert(type_and_nttps<vector<float, 3>>::value); | |
static_assert(type_and_nttps<matrix<float, 3, 3>>::value); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment