Changeset 64fc0ba for src/libcfa/containers/result
- Timestamp:
- May 25, 2017, 11:38:36 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- e883a4b
- Parents:
- 58ed882
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/libcfa/containers/result ¶
r58ed882 r64fc0ba 18 18 #define RESULT_H 19 19 20 #include <stdbool.h> 20 21 21 22 // DO NOT USE DIRECTLY! 22 23 forall(otype T, otype E) 24 union inner_result{ 25 T value; 26 E error; 27 }; 28 29 forall(otype T, otype E) 23 30 struct result { 24 _Bool has_value; 25 union { 26 T value; 27 E error; 28 }; 31 bool has_value; 32 inner_result(T, E); 29 33 }; 30 34 … … 46 50 47 51 forall(otype T, otype E) 48 _Bool ?!=?(result(T, E) this, zero_t);52 bool ?!=?(result(T, E) this, zero_t); 49 53 50 54 forall(otype T, otype E) … … 55 59 56 60 forall(otype T, otype E) 57 _Bool has_value(result(T, E) * this);61 bool has_value(result(T, E) * this); 58 62 59 63 forall(otype T, otype E)
Note: See TracChangeset
for help on using the changeset viewer.