Skip to content

Instantly share code, notes, and snippets.

View FuZer's full-sized avatar
🎯
Focusing

SeungHyun Jeon FuZer

🎯
Focusing
View GitHub Profile
@FuZer
FuZer / gist:2d7dc665572f1238737f9e5fa70d99df
Last active February 17, 2019 22:40
A<0> 제거, 재귀적 접근 다이렉트로 접근하게 변경, 잘못된 접근 컴파일 에러
#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>>>;
};
@FuZer
FuZer / gist:8681b5be993963e19063b84e8a47a9b6
Last active February 17, 2019 22:27
get Template 명시, enable_if_t 제거
#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>>;
};