Java/C# std::vector<bool> workarounds for clang
Workaround clang++ 9.1.0 error not knowing std::vector<bool>::const_reference
is actually typedef to bool:
li_std_vector_wrap.cxx:1838:40: error: no matching constructor for initialization of 'std::vector<bool>::const_reference'
Workaround is use
const value_type& getitem(int index) throw (std::out_of_range) { ...
// bool specialization:
bool getitem(int index) throw (std::out_of_range) { ...
instead of
const_reference_type getitem(int index) throw (std::out_of_range) { ...
Although the following would be better, it would require a more
complicated implementation:
const_reference_type getitem(int index) throw (std::out_of_range) { ...
// bool specialization:
bool getitem(int index) throw (std::out_of_range) { ...
This commit is contained in:
parent
77f075b6e8
commit
d67c133c4a
2 changed files with 2 additions and 2 deletions
|
|
@ -233,7 +233,7 @@
|
|||
else
|
||||
throw std::out_of_range("index");
|
||||
}
|
||||
const_reference getitem(int index) throw (std::out_of_range) {
|
||||
CONST_REFERENCE getitem(int index) throw (std::out_of_range) {
|
||||
if (index>=0 && index<(int)$self->size())
|
||||
return (*$self)[index];
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue