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
| #include <iostream> | |
| template <std::size_t Idx> | |
| struct A { | |
| constexpr static std::size_t idx = Idx; | |
| template <std::size_t Target> | |
| using get = std::enable_if_t<(Idx > Target), std::conditional_t<Target == 0, A<Idx>, A<Idx-Target>>>; | |
| }; |
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
| #include <iostream> | |
| template <std::size_t Idx> | |
| struct A { | |
| constexpr static std::size_t idx = Idx; | |
| template <std::size_t Target> | |
| using get = std::conditional_t<Target == 0, A<Idx>, typename A<idx-1>::template get<Target-1>>; | |
| }; |