Ignore:
Timestamp:
May 25, 2017, 11:38:36 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
e883a4b
Parents:
58ed882
Message:

Added maybe and result to libcfa makefiles and made some minor fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/containers/maybe.c

    r58ed882 r64fc0ba  
    4040void ^?{}(maybe(T) * this) {
    4141        if (this->has_value) {
    42                 ^(this->value){};
     42                ^(&this->value){};
    4343        }
    4444}
    4545
    4646forall(otype T)
    47 _Bool ?!=?(result(T, E) this, zero_t) {
    48         return !this->has_value;
     47bool ?!=?(maybe(T) this, zero_t) {
     48        return !this.has_value;
    4949}
    5050
    5151forall(otype T)
    5252maybe(T) maybe_value(T value) {
    53         return (Maybe(T)){value};
     53        return (maybe(T)){value};
    5454}
    5555
    5656forall(otype T)
    5757maybe(T) maybe_none() {
    58         return (Maybe(T)){};
     58        return (maybe(T)){};
    5959}
    6060
    6161forall(otype T)
    62 _Bool has_value(maybe(T) * this) {
     62bool has_value(maybe(T) * this) {
    6363        return this->has_value;
    6464}
Note: See TracChangeset for help on using the changeset viewer.