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.
 

190 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

Leave a Reply