Refactor Java director swig_override array code

Remove code duplication: Use new Swig::BoolArray to replace multiple
instances of ZeroedBoolArray.

Refactors #403 and #413.
This commit is contained in:
William S Fulton 2015-05-09 14:48:45 +01:00
commit 775afd3579
2 changed files with 15 additions and 7 deletions

View file

@ -209,6 +209,20 @@ namespace Swig {
}
};
// Zero initialized bool array
template<size_t N> class BoolArray {
bool array_[N];
public:
BoolArray() {
memset(array_, sizeof(array_), 0);
}
bool& operator[](size_t n) {
return array_[n];
}
bool operator[](size_t n) const {
return array_[n];
}
};
// Utility classes and functions for exception handling.