std::enable_if

    [C++] std::enable_if / std::is_base_of

    std::enable_if - 스코프 지정 연산(::)에서 지정된 스코프 내에 존재하지 않는 타입을 사용한 경우를 활용하여 enable_if::type은 존재하지만 enable_if::type은 존재하지 않으므로 이를 바탕으로 특정한 경우에만 함수 템플릿을 사용할 수 있도록 만드는 것이다. // STRUCT TEMPLATE enable_if template struct enable_if {}; // no member "type" when !_Test template struct enable_if { // type is _Ty for _Test using type = _Ty; }; std::is_base_of - is_base_of 는 Template 첫번째 인자가 두번째 인자의 자식 객체이거나 동일한 객..