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:
parent
b06ec2c847
commit
775afd3579
2 changed files with 15 additions and 7 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue