คำถามติดแท็ก typename

6
ฉันต้องใส่คำหลัก“ เทมเพลต” และ“ พิมพ์ชื่อ” ที่ไหนและทำไม
ในแม่ที่และทำไมฉันต้องใส่typenameและtemplateรายชื่อขึ้นอยู่? ชื่อที่ขึ้นต่อกันคืออะไรกันแน่? ฉันมีรหัสต่อไปนี้: template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail { // ... template<typename U> struct inUnion { // Q: where to add typename/template here? typedef Tail::inUnion<U> dummy; }; template< > struct inUnion<T> { }; }; template <typename T> // …
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.