   compiler error when building custom packed-fields library
  Since many attributes of integer packing in structs (such as alignment and padding) are compiler-specific according to the C++ standard, I decided to write my own, more portable mechanism for handling integer packing.   In my solution, each field is specified by a template instantiation of packed_field, which maintains the field size (in bits), bit offset, and type used to represent the field when unpacked. These packed_fields are then used as template arguments to packed_bit_fields which provides get/set methods for accessing its packed fields. The field types are internally maintained in a type-list, which is indexed by the template parameter of the get/set methods.  My goal is to have the return/parameter type of these get/set methods resolved by looking up their type which is a member typedef of the packed_fields in the type-list.Inside the body of these methods, I can simply typedef the desired packed_field in the type list and manipulate it. My problem however is resolving member typedefs of these packed_fields prior the get/set method bodies. I thought that simply using the 'typename' keyword would do the trick, but I can't get it to work for the life of me.In the code below, a half-ass "fix" is commented above each of the methods of interest. Enabling this "fix" demonstrates that my design is at least functional. If anyone could help get this working, I would be very appreciative.bit fields code:#ifndef __LD_BIT_FIELDS_DEFINED__#define __LD_BIT_FIELDS_DEFINED__#include <ld/type_list.h>namespace ld {/** * Usage:  * @code * typedef packed_bit_fields<uint32_t *bit_field<unsigned short, 5, 0>,  * bit_field<unsigned char, 3, 5>,  * bit_field<signed char, 3, 8> > my_packed_fields; * * my_packed_fields fields; * fields.set<0>(14); * fields.set<1>(5); * fields.set<2>(3); * unsigned short a = fields.get<0>(); * unsigned char b = fields.get<1>(); * signed char c = fields.get<2>(); */template <class _maskT, uint32_t _Bits, uint32_t _Offset>struct make_mask {static const _maskT value = ~((~0) << _Bits) << _Offset;};template <class _T, uint32_t _Size, uint32_t _Offset>struct bit_field {typedef _T value_type;static const uint32_t size = _Size;static const uint32_t offset = _Offset;template <class _storageT>static _T get(const _storageT& packed) {static const _storageT mask = make_mask<_storageT, _Size, _Offset>::value;return static_cast<_T>((packed & mask) >> _Offset);}template <class _storageT>static void set(_storageT& packed, _T value) {static const _storageT mask = make_mask<_storageT, _Size, _Offset>::value;packed = (packed & ~mask) | ((static_cast<_storageT>(value) << _Offset) & mask);}template <class _storageT>static void set_unsafe(_storageT& packed, _T value) {static const _storageT mask = make_mask<_storageT, _Size, _Offset>::value;packed = (packed & ~mask) | (static_cast<_storageT>(value) << _Offset);}};template <class _packedT, class _Field0, class _Field1 = null_type, class _Field2 = null_type, class _Field3 = null_type, class _Field4 = null_type, class _Field5 = null_type, class _Field6 = null_type, class _Field7 = null_type, class _Field8 = null_type, class _Field9 = null_type, class _Field10 = null_type, class _Field11 = null_type, class _Field12 = null_type, class _Field13 = null_type, class _Field14 = null_type>class packed_bit_fields {typedef typename ld::type_list::make_type_list<_Field0, _Field1, _Field2, _Field3, _Field4, _Field5, _Field6, _Field7, _Field8, _Field9,_Field10, _Field11, _Field12, _Field13, _Field14>::value_type field_list;_packedT packed_;public:packed_bit_fields() : packed_(0) {}typedef _packedT packed_type;template <int32_t _Index>typename type_list::type_at<field_list, _Index>::value_type::value_type//uint32_tget() const {typedef typename type_list::type_at<field_list, _Index>::value_type field_type;return field_type::get<_packedT>(packed_);}template <int32_t _Index>//void set(uint32_t value) {void set(typename type_list::type_at<field_list, _Index>::value_type::value_type value) {typedef typename type_list::type_at<field_list, _Index>::value_type field_type;field_type::set<_packedT>(packed_, static_cast<field_type::value_type>(value));}template <int32_t _Index>// void set_unsafe(uint32_t value) {void set_unsafe(typename type_list::type_at<field_list, _Index>::value_type::value_type value) {typedef typename type_list::type_at<field_list, _Index>::value_type field_type;field_type::set_unsafe<_packedT>(packed_, value);}};} // namespace ld {#endif // __LD_BIT_FIELDS_DEFINED__ code that triggers the issue:typedef ld::packed_bit_fields<uint32_t, bit_field<uint8_t, 5, 0>,bit_field<uint8_t, 6, 5>, bit_field<uint16_t, 12, 11> > my_fields_type;my_fields_type fields;fields.set<0>(12);uint8_t value = fields.get<0>();The compiler error generated:1>------ Build started: Project: unittests, Configuration: Debug Win32 ------1>Compiling...1>bit_fieldstest.cpp1>f:\repository\unittests\trunk\src\bit_fieldstest.cpp(9) : error C2770: invalid explicit template argument(s) for 'void ld::packed_bit_fields<_packedT,_Field0,_Field1,_Field2>::set(type_list::type_at<ld::type_list::type_list<_Head,_Tail>,_Index>::value_type::{ctor})'1>   with1>   [1>  _packedT=uint32_t,1>  _Field0=ld::bit_field<uint8_t,5,0>,1>  _Field1=ld::bit_field<uint8_t,6,5>,1>  _Field2=ld::bit_field<uint16_t,12,11>,1>  _Head=ld::bit_field<uint8_t,5,0>,1>  _Tail=ld::type_list::type_list<ld::bit_field<uint8_t,6,5>,ld::type_list::type_list<ld::bit_field<uint16_t,12,11>,ld::null_type>>1>   ]1>   f:\repository\luciddream\trunk\include\ld\bit_fields.h(86) : see declaration of 'ld::packed_bit_fields<_packedT,_Field0,_Field1,_Field2>::set'1>   with1>   [1>  _packedT=uint32_t,1>  _Field0=ld::bit_field<uint8_t,5,0>,1>  _Field1=ld::bit_field<uint8_t,6,5>,1>  _Field2=ld::bit_field<uint16_t,12,11>1>   ]1>f:\repository\unittests\trunk\src\bit_fieldstest.cpp(13) : error C2770: invalid explicit template argument(s) for 'type_list::type_at<ld::type_list::type_list<_Head,_Tail>,_Index>::value_type::{ctor} ld::packed_bit_fields<_packedT,_Field0,_Field1,_Field2>::get(void) const'1>   with1>   [1>  _Head=ld::bit_field<uint8_t,5,0>,1>  _Tail=ld::type_list::type_list<ld::bit_field<uint8_t,6,5>,ld::type_list::type_list<ld::bit_field<uint16_t,12,11>,ld::null_type>>,1>  _packedT=uint32_t,1>  _Field0=ld::bit_field<uint8_t,5,0>,1>  _Field1=ld::bit_field<uint8_t,6,5>,1>  _Field2=ld::bit_field<uint16_t,12,11>1>   ]1>   f:\repository\luciddream\trunk\include\ld\bit_fields.h(79) : see declaration of 'ld::packed_bit_fields<_packedT,_Field0,_Field1,_Field2>::get'1>   with1>   [1>  _packedT=uint32_t,1>  _Field0=ld::bit_field<uint8_t,5,0>,1>  _Field1=ld::bit_field<uint8_t,6,5>,1>  _Field2=ld::bit_field<uint16_t,12,11>1>   ]1>Build log was saved at "file://f:\repository\unittests\trunk\Debug\BuildLog.htm"1>unittests - 2 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========The code is dependent on my custom type-list library (taken straight from Alexandrescu's Modern C++ Design).    