Flags

Ich saß vor kurzem an der Arbeit und habe eine Funktion gebastelt, die ziemlich viele Parameter benötigt.

Also habe ich mir mal ein paar Gedanken über Flags gemacht und folgendes ist dabei herausgekommen:

#define FLAG_SET(f,v,bl) (bl) ? (v |= f) : (v &= ~f);
#define FLAG_GET(f,v) ((f&v)>0) || (f==0)
 
enum eFlags {
    STANDARD, //schließt alle anderen Optionen aus!
    FIRST   = 1 << 0,
    SECOUND = 1 << 1,
    THIRD   = 1 << 2,
    FOURTH  = 1 << 3
};

Mich würde interessieren, ob es nicht noch schönere bzw. schnellere Methoden gibt, dieses Probleme zu lösen.
 

294 thoughts on “Flags

  1. Pingback: ontario payday loans

  2. Pingback: direct payday loans parksville lender

  3. Pingback: drugrehabcentershotline.com heroin addiction treatment

  4. Pingback: Tony

  5. Pingback: enrique

  6. Pingback: neil

  7. Pingback: Jeffrey

  8. Pingback: nathaniel

  9. Pingback: Byron

  10. Pingback: Ronald

  11. Pingback: George

  12. Pingback: warren

  13. Pingback: Jeff

  14. Pingback: max

  15. Pingback: jesus

  16. Pingback: Ian

  17. Pingback: Milton

  18. Pingback: Lloyd

  19. Pingback: chester

  20. Pingback: gabriel

  21. Pingback: manuel

  22. Pingback: Kirk

  23. Pingback: Travis

  24. Pingback: Arthur

  25. Pingback: rene

  26. Pingback: Oscar

  27. Pingback: Larry

  28. Pingback: randy

  29. Pingback: todd

  30. Pingback: trevor

  31. Pingback: calvin

  32. Pingback: Roberto

  33. Pingback: Leonard

  34. Pingback: Chester

  35. Pingback: melvin

  36. Pingback: arturo

  37. Pingback: Gregory

  38. Pingback: casey

  39. Pingback: Kirk

  40. Pingback: Lloyd

  41. Pingback: David

  42. Pingback: gabriel

  43. Pingback: Sam

  44. Pingback: jimmie

  45. Pingback: Lance

  46. Pingback: herman

  47. Pingback: harold

  48. Pingback: Gerald

  49. Pingback: angelo

  50. Pingback: lester

  51. Pingback: todd

  52. Pingback: maurice

  53. Pingback: Alan

  54. Pingback: Larry

  55. Pingback: Arthur

  56. Pingback: johnny

  57. Pingback: Ralph

  58. Pingback: Randy

  59. Pingback: craig

  60. Pingback: frederick

  61. Pingback: Troy

  62. Pingback: Alfred

  63. Pingback: Allan

  64. Pingback: Ben

  65. Pingback: stuart

  66. Pingback: Gerard

  67. Pingback: Dave

  68. Pingback: ron

  69. Pingback: jonathan

  70. Pingback: Wade

  71. Pingback: Jared

  72. Pingback: Oscar

  73. Pingback: Alan

  74. Pingback: Dwayne

  75. Pingback: Ray

  76. Pingback: alfonso

  77. Pingback: roland

  78. Pingback: Barry

  79. Pingback: robert

  80. Pingback: Dan

  81. Pingback: Reginald

  82. Pingback: austin

  83. Pingback: hector

  84. Pingback: allen

  85. Pingback: luis

  86. Pingback: harold

  87. Pingback: Francisco

  88. Pingback: Zachary

  89. Pingback: Carlton

  90. Pingback: Sam

  91. Pingback: nathaniel

  92. Pingback: harold

  93. Pingback: Christopher

  94. Pingback: ronnie

  95. Pingback: edward

  96. Pingback: Freddie

  97. Pingback: Ernest

  98. Pingback: joshua

  99. Pingback: claude

  100. Pingback: Jackie

  101. Pingback: Eddie

  102. Pingback: Adam

  103. Pingback: eddie

  104. Pingback: Adrian

  105. Pingback: Ramon

  106. Pingback: Danny

  107. Pingback: Alan

  108. Pingback: brent

  109. Pingback: donald

  110. Pingback: Floyd

  111. Pingback: Derek

  112. Pingback: Hubert

  113. Pingback: Eugene

  114. Pingback: Dave

  115. Pingback: Travis

  116. Pingback: austin

  117. Pingback: Jimmy

  118. Pingback: Allen

  119. Pingback: Melvin

  120. Pingback: Gene

  121. Pingback: julian

  122. Pingback: rene

  123. Pingback: Everett

  124. Pingback: Greg

  125. Pingback: Ronald

  126. Pingback: Cecil

  127. Pingback: jay

  128. Pingback: David

  129. Pingback: theodore

  130. Pingback: rafael

  131. Pingback: Joey

  132. Pingback: Harold

  133. Pingback: juan

  134. Pingback: manuel

  135. Pingback: richard

  136. Pingback: Patrick

  137. Pingback: Kelly

  138. Pingback: Jorge

  139. Pingback: jacob

  140. Pingback: doug

  141. Pingback: melvin

  142. Pingback: nelson

  143. Pingback: tyrone

  144. Pingback: Andre

  145. Pingback: tracy

  146. Pingback: clifford

  147. Pingback: eugene

  148. Pingback: andrew

  149. Pingback: Tommy

  150. Pingback: ronnie

  151. Pingback: charles

  152. Pingback: Fred

  153. Pingback: Cory

  154. Pingback: greg

  155. Pingback: Ralph

  156. Pingback: Gary

  157. Pingback: ray

  158. Pingback: Shannon

  159. Pingback: Pedro

  160. Pingback: David

  161. Pingback: Bruce

  162. Pingback: willard

  163. Pingback: ryan

  164. Pingback: Chad

  165. Pingback: Terry

  166. Pingback: Arnold

  167. Pingback: howard

  168. Pingback: Justin

  169. Pingback: Harvey

  170. Pingback: ramon

  171. Pingback: Harvey

  172. Pingback: Raul

  173. Pingback: Oscar

  174. Pingback: jonathan

  175. Pingback: Wayne

  176. Pingback: Rene

  177. Pingback: rex

  178. Pingback: Dan

  179. Pingback: walter

  180. Pingback: Joshua

  181. Pingback: Derek

  182. Pingback: Willie

  183. Pingback: brent

  184. Pingback: Aaron

  185. Pingback: Wallace

  186. Pingback: greg

  187. Pingback: gregory

  188. Pingback: jeffery

  189. Pingback: Joey

  190. Pingback: Lyle

  191. Pingback: carlos

  192. Pingback: donald

  193. Pingback: warren

  194. Pingback: terry

  195. Pingback: Stephen

  196. Pingback: Kent

  197. Pingback: Brandon

  198. Pingback: Dwight

  199. Pingback: bill

  200. Pingback: Julio

  201. Pingback: Aaron

  202. Pingback: Ted

  203. Pingback: Brandon

  204. Pingback: Trevor

  205. Pingback: philip

  206. Pingback: Jacob

  207. Pingback: Derek

  208. Pingback: Francisco

  209. Pingback: clarence

  210. Pingback: Dean

  211. Pingback: Dwayne

  212. Pingback: Casey

  213. Pingback: James

  214. Pingback: Micheal

  215. Pingback: herbert

  216. Pingback: timothy

  217. Pingback: Ronnie

  218. Pingback: Charles

  219. Pingback: Ted

  220. Pingback: Evan

  221. Pingback: Marion

  222. Pingback: Clifton

  223. Pingback: Lee

  224. Pingback: Claude

  225. Pingback: Reginald

  226. Pingback: Leroy

  227. Pingback: Stephen

  228. Pingback: wayne

  229. Pingback: Nelson

  230. Pingback: Sidney

  231. Pingback: mathew

  232. Pingback: Lawrence

  233. Pingback: Marion

  234. Pingback: Keith

  235. Pingback: Rafael

  236. Pingback: Melvin

  237. Pingback: oscar

  238. Pingback: dennis

  239. Pingback: Edward

  240. Pingback: Joey

  241. Pingback: Bill

  242. Pingback: Travis

  243. Pingback: Gerard

  244. Pingback: angel

  245. Pingback: Hugh

  246. Pingback: michael

  247. Pingback: leslie

  248. Pingback: marshall

  249. Pingback: harvey

  250. Pingback: Adrian

  251. Pingback: Alfredo

  252. Pingback: marc

  253. Pingback: Wesley

  254. Pingback: eddie

  255. Pingback: Billy

  256. Pingback: hubert

  257. Pingback: Everett

  258. Pingback: matt

  259. Pingback: george

  260. Pingback: leo

  261. Pingback: ian

  262. Pingback: Luke

  263. Pingback: Bill

  264. Pingback: Jorge

  265. Pingback: Gerard

  266. Pingback: Scott

  267. Pingback: tyler

  268. Pingback: angelo

  269. Pingback: Elmer

  270. Pingback: Fredrick

  271. Pingback: jerome

  272. Pingback: Trevor

  273. Pingback: darryl

  274. Pingback: homer

  275. Pingback: Alex

  276. Pingback: Franklin

  277. Pingback: rick

  278. Pingback: Theodore

  279. Pingback: Terrance

  280. Pingback: Greg

  281. Pingback: theodore

  282. Pingback: bob

  283. Pingback: Scott

  284. Pingback: zachary

  285. Pingback: leroy

  286. Pingback: Virgil

  287. Pingback: alfred

  288. Pingback: francis

  289. Pingback: Stuart

Leave a Reply