LLVM 은 자료구조 어떻게 구현하는지 찾고 있다


libcxx/forward_list at master · llvm-mirror/libcxx (github.com)


이게 forward_list 구현인데


노드는 이러함 libcxx/forward_list at master · llvm-mirror/libcxx (github.com)


template <class _Tp, class _VoidPtr> struct _LIBCPP_HIDDEN __begin_node_of { typedef __forward_begin_node< typename __rebind_pointer<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >::type > type; }; template <class _Tp, class _VoidPtr> struct __forward_list_node : public __begin_node_of<_Tp, _VoidPtr>::type { typedef _Tp value_type; value_type __value_; };


이게 뭐지?


__forward_list_node 가 __begin_node_of::type 을 상속하는데 왜 __begin_node_of::type 이 __forward_list_node 를 쓰지?


어째서 template 에서 재귀가 허용되고 어떻게 작동하는지 도저히 이해가 안 간다


요 며칠 간 대가리 제대로 깨지는 중