~singpolyma/biboumi

ref: efa63ee5cb4be3aebc1489dc9db936eea26660d4 biboumi/src/database/row.hpp -rw-r--r-- 510 bytes
efa63ee5 — louiz’ Merge branch 'v7' 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <utils/is_one_of.hpp>

#include <type_traits>

template <typename... T>
struct Row
{
  Row(std::string name):
      table_name(std::move(name))
  {}

  template <typename Type>
  typename Type::real_type& col()
  {
    auto&& col = std::get<Type>(this->columns);
    return col.value;
  }

  template <typename Type>
  const auto& col() const
  {
    auto&& col = std::get<Type>(this->columns);
    return col.value;
  }

public:
  std::tuple<T...> columns;
  std::string table_name;
};