Changeset 7d9ad51


Ignore:
Timestamp:
Sep 1, 2017, 2:35:53 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
9b18044
Parents:
cccc534
Message:

Add std::function-like type to function-operator test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/function-operator.c

    rcccc534 r7d9ad51  
    128128}
    129129
     130// TODO: generalize to ttype return; doesn't work yet
     131// like std::function
     132forall(otype Return, ttype Args)
     133struct function {
     134  Return (*f)(Args);
     135};
     136// TODO: missing adapter in these functions
     137// // value, reference, pointer operators
     138// forall(otype Return, ttype Args) Return ?()(function(Return, Args) func, Args args) { return func.f(args); }
     139// forall(otype Return, ttype Args) Return ?()(function(Return, Args) & func, Args args) { return func.f(args); }
     140// forall(otype Return, ttype Args) Return ?()(function(Return, Args) * func, Args args) { return func->f(args); }
     141
    130142int main() {
    131143        // generate for array fill
Note: See TracChangeset for help on using the changeset viewer.