Changeset 7d9ad510


Ignore:
Timestamp:
Sep 1, 2017, 2:35:53 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
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 r7d9ad510  
    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.