summaryrefslogtreecommitdiff
path: root/subprojects/boost-sqlite/src/row.cpp
blob: a674e9c19330dc5a42bc38c3cff4356ecd0dffcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) 2023 Klemens D. Morgenstern
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <boost/sqlite/row.hpp>

BOOST_SQLITE_BEGIN_NAMESPACE

field row::at(std::size_t idx) const
{
  if (idx >= size())
    throw_exception(std::out_of_range("column out of range"), BOOST_CURRENT_LOCATION);
  else
  {
    field f;
    f.stm_ = stm_;
    f.col_ = static_cast<int>(idx);
    return f;
  }
}

BOOST_SQLITE_END_NAMESPACE