Changeset 70:8d36d23fc17e in rrlib_util for type_list/tSizeOf.h


Ignore:
Timestamp:
24.10.2012 03:10:55 (7 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Children:
71:341c8d5984bb, 77:57c756db0b8d
Phase:
public
Message:

Reworked type lists

File:
1 edited

Legend:

Unmodified
Added
Removed
  • type_list/tSizeOf.h

    r34 r70  
    6464// Forward declarations / typedefs / enums 
    6565//---------------------------------------------------------------------- 
    66 template <typename TList> class tSizeOf; 
    6766 
    6867//---------------------------------------------------------------------- 
     
    7372 * 
    7473 */ 
     74template <typename TList> 
     75struct tSizeOf 
     76{ 
     77  static const size_t cVALUE = tSizeOf<typename TList::tTail>::cVALUE + 1; 
     78}; 
     79 
    7580template <> 
    7681struct tSizeOf<tEmptyList> 
    7782{ 
    78   enum { cVALUE = 0 }; 
     83  static const size_t cVALUE = 0; 
    7984}; 
    80  
    81 template <typename THead, typename ... TTail> 
    82 struct tSizeOf<tTypeList<THead, TTail...>> 
    83 { 
    84   enum { cVALUE = tSizeOf<typename tTypeList<THead, TTail...>::tTail>::cVALUE + 1 }; 
    85 }; 
    86  
    8785 
    8886//---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.