Changeset 5738177 for molecuilder/src/helpers.hpp
- Timestamp:
- Mar 17, 2010, 3:19:56 PM (16 years ago)
- Children:
- 43ed42
- Parents:
- d639c7
- git-author:
- Tillmann Crueger <crueger@…> (03/17/10 14:53:26)
- git-committer:
- Tillmann Crueger <crueger@…> (03/17/10 15:19:56)
- File:
-
- 1 edited
-
molecuilder/src/helpers.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/helpers.hpp
rd639c7 r5738177 189 189 #define PLURAL_S(v) (((v)==1)?"":"s") 190 190 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 191 215 #endif /*HELPERS_HPP_*/
Note:
See TracChangeset
for help on using the changeset viewer.
