Closed brunoseivam closed 5 years ago
I'm ok with adding getFieldT()
variants, but I just can't bring myself to retroactively change the error behavior of getField(size_t)
. This would mean that getField<T>(size_t)
continues to throw an exception on out of range index, and return NULL when type T
isn't dynamic_cast-able. While this isn't how I would design a new API, I also don't think it is unreasonable. Array bounds can easily be checked with Field::getNumberFields()
.
The checks of 4cc9b650c57e7aa12e715e0f163120b19a0f249b could also be incorporated.
Fixes #66