Changes in src/libcfa/containers/maybe.c [79308c8e:64fc0ba]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/containers/maybe.c
r79308c8e r64fc0ba 40 40 void ^?{}(maybe(T) * this) { 41 41 if (this->has_value) { 42 ^( this->value){};42 ^(&this->value){}; 43 43 } 44 44 } 45 45 46 46 forall(otype T) 47 _Bool ?!=?(result(T, E) this, zero_t) {48 return !this ->has_value;47 bool ?!=?(maybe(T) this, zero_t) { 48 return !this.has_value; 49 49 } 50 50 51 51 forall(otype T) 52 52 maybe(T) maybe_value(T value) { 53 return ( Maybe(T)){value};53 return (maybe(T)){value}; 54 54 } 55 55 56 56 forall(otype T) 57 57 maybe(T) maybe_none() { 58 return ( Maybe(T)){};58 return (maybe(T)){}; 59 59 } 60 60 61 61 forall(otype T) 62 _Bool has_value(maybe(T) * this) {62 bool has_value(maybe(T) * this) { 63 63 return this->has_value; 64 64 }
Note: See TracChangeset
for help on using the changeset viewer.