Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Created November 5, 2015 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagomg/3a500e045844e4a4c0c0 to your computer and use it in GitHub Desktop.
Save thiagomg/3a500e045844e4a4c0c0 to your computer and use it in GitHub Desktop.
Ciclic dependency problem
//Resulting file after pre-processing ----
int get_total(std::vector<int> &v);
struct int_vector {
//implementation details ...
int size() { return _size; }
int operator[](int pos) {
return _data[pos];
}
int *_data;
};
int get_total(std::vector<int> &v) {
return std::accumulate(begin(v), end(v));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment