Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support out/inout-parameters #20

Open
lhchavez opened this issue May 24, 2015 · 0 comments
Open

Support out/inout-parameters #20

lhchavez opened this issue May 24, 2015 · 0 comments

Comments

@lhchavez
Copy link
Member

lhchavez commented May 24, 2015

For arrays only, since this will be hard to model outside of C for other types.

Example:

// example.idl:
interface Main {
};

interface example {
    void foo([Range(1, 1)] int N, [InOut] int[N] X);
};
// Main.cpp
#include "example.h"
#include <iostream>
int main() {
  int X[1] = {1};
  foo(1, X);
  std::cout << X[0] << std::endl;
}

In order to implement this functionality, the return messages need to be expanded to include the arrays after the return value. The implementation of [InOut] is different from [Out] just in that it performs the extra copy to supply the initial values of the array to the contestant's program.

@lhchavez lhchavez changed the title Support in-parameters Support out/inout-parameters Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant