| 347 | |
| 348 | template <typename Reader> |
| 349 | bool Row::DoGet(Reader reader, int columnIndex) const |
| 350 | { |
| 351 | if (mStatement == nullptr) |
| 352 | { |
| 353 | if (mErrors != nullptr) |
| 354 | mErrors->emplace_back(Error(SQLITE_MISUSE)); |
| 355 | return false; |
| 356 | } |
| 357 | |
| 358 | if (columnIndex < 0 || columnIndex >= mColumnsCount) |
| 359 | { |
| 360 | if (mErrors != nullptr) |
| 361 | mErrors->emplace_back(Error(SQLITE_RANGE)); |
| 362 | return false; |
| 363 | } |
| 364 | |
| 365 | if constexpr (std::is_void_v<decltype(reader())>) |
| 366 | { |
| 367 | reader(); |
| 368 | return true; |
| 369 | } |
| 370 | else |
| 371 | return reader(); |
| 372 | } |
| 373 | |
| 374 | bool Row::Get(int columnIndex, bool& value) const |
| 375 | { |