Ignore:
Timestamp:
May 25, 2017, 11:38:36 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/libcfa/containers/result

    r58ed882 r64fc0ba  
    1818#define RESULT_H
    1919
     20#include <stdbool.h>
    2021
    2122// DO NOT USE DIRECTLY!
    2223forall(otype T, otype E)
     24union inner_result{
     25        T value;
     26        E error;
     27};
     28
     29forall(otype T, otype E)
    2330struct result {
    24         _Bool has_value;
    25         union {
    26                 T value;
    27                 E error;
    28         };
     31        bool has_value;
     32        inner_result(T, E);
    2933};
    3034
     
    4650
    4751forall(otype T, otype E)
    48 _Bool ?!=?(result(T, E) this, zero_t);
     52bool ?!=?(result(T, E) this, zero_t);
    4953
    5054forall(otype T, otype E)
     
    5559
    5660forall(otype T, otype E)
    57 _Bool has_value(result(T, E) * this);
     61bool has_value(result(T, E) * this);
    5862
    5963forall(otype T, otype E)
Note: See TracChangeset for help on using the changeset viewer.