Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/helpers.hpp

    r6e97e5 r7dad10  
    189189#define PLURAL_S(v) (((v)==1)?"":"s")
    190190
    191 // this is to allow different modes of access for
    192 // maps and sets
    193 template<typename Res,typename T>
    194 struct _take{
    195   Res get(T value) const;
    196 };
    197 
    198 // if we have a set,vector etc we can directly access the result
    199 template<typename Res>
    200 struct _take<Res,Res>{
    201   static inline Res get(Res value){
    202     return value;
    203   }
    204 };
    205 
    206 // if we have a map we have to access the second part of
    207 // the pair
    208 template<typename Res,typename T1>
    209 struct _take<Res,std::pair<T1,Res> >{
    210   static inline Res get(std::pair<T1,Res> value){
    211     return value.second;
    212   }
    213 };
    214 
    215191#endif /*HELPERS_HPP_*/
Note: See TracChangeset for help on using the changeset viewer.