Changes in / [667c7da:0e44184]
- Location:
- src
- Files:
-
- 4 deleted
- 3 edited
-
libcfa/containers/maybe (modified) (3 diffs)
-
libcfa/containers/result (modified) (3 diffs)
-
libcfa/containers/result.c (modified) (2 diffs)
-
tests/.expect/maybe.txt (deleted)
-
tests/.expect/result.txt (deleted)
-
tests/maybe.c (deleted)
-
tests/result.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/containers/maybe
r667c7da r0e44184 10 10 // Created On : Wed May 24 14:43:00 2017 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jun 16 15:42:00 201713 // Update Count : 212 // Last Modified On : Thr May 25 16:36:00 2017 13 // Update Count : 1 14 14 // 15 15 … … 46 46 bool ?!=?(maybe(T) this, zero_t); 47 47 48 /* Waiting for bug#11 to be fixed.49 48 forall(otype T) 50 49 maybe(T) maybe_value(T value); … … 52 51 forall(otype T) 53 52 maybe(T) maybe_none(); 54 */55 53 56 54 forall(otype T) -
src/libcfa/containers/result
r667c7da r0e44184 10 10 // Created On : Wed May 24 14:45:00 2017 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jun 16 15:41:00 201713 // Update Count : 212 // Last Modified On : Thr May 25 16:39:00 2017 13 // Update Count : 1 14 14 // 15 15 … … 55 55 bool ?!=?(result(T, E) this, zero_t); 56 56 57 /* Wating for bug#11 to be fixed.58 57 forall(otype T, otype E) 59 58 result(T, E) result_value(T value); … … 61 60 forall(otype T, otype E) 62 61 result(T, E) result_error(E error); 63 */64 62 65 63 forall(otype T, otype E) -
src/libcfa/containers/result.c
r667c7da r0e44184 74 74 forall(otype T, otype E) 75 75 bool ?!=?(result(T, E) this, zero_t) { 76 return this.has_value;76 return !this.has_value; 77 77 } 78 78 … … 100 100 forall(otype T, otype E) 101 101 E get_error(result(T, E) * this) { 102 assertf( !this->has_value, "attempt to get from result without error");102 assertf(this->has_value, "attempt to get from result without error"); 103 103 return this->error; 104 104 }
Note:
See TracChangeset
for help on using the changeset viewer.