Changeset 7d9ad510
- Timestamp:
- Sep 1, 2017, 2:35:53 PM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/function-operator.c
rcccc534 r7d9ad510 128 128 } 129 129 130 // TODO: generalize to ttype return; doesn't work yet 131 // like std::function 132 forall(otype Return, ttype Args) 133 struct 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 130 142 int main() { 131 143 // generate for array fill
Note: See TracChangeset
for help on using the changeset viewer.