Skip to content

Commit

Permalink
Rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Mar 21, 2024
1 parent a84fc8f commit c1076a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions include/sparrow/array_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ namespace sparrow
using base_type = reference_proxy_base<self_type>;
using layout_type = L;
using value_type = typename L::inner_value_type;
using reference = typename L::inner_const_reference;
using const_reference = typename L::inner_const_reference;
using bitmap_reference = typename L::bitmap_const_reference;
using size_type = typename L::size_type;

const_reference_proxy(reference val_ref, bitmap_reference bit_ref);
const_reference_proxy(const_reference val_ref, bitmap_reference bit_ref);
~const_reference_proxy() = default;

const_reference_proxy(const self_type&) = default;
Expand All @@ -129,11 +129,11 @@ namespace sparrow
bool has_value() const;
explicit operator bool() const;

const value_type& value() const;
const_reference value() const;

private:

reference m_val_ref;
const_reference m_val_ref;
bitmap_reference m_bit_ref;
};

Expand Down Expand Up @@ -259,7 +259,7 @@ namespace sparrow
****************************************/

template <class L>
const_reference_proxy<L>::const_reference_proxy(reference val_ref, bitmap_reference bit_ref)
const_reference_proxy<L>::const_reference_proxy(const_reference val_ref, bitmap_reference bit_ref)
: m_val_ref(val_ref)
, m_bit_ref(bit_ref)
{
Expand All @@ -278,7 +278,7 @@ namespace sparrow
}

template <class L>
auto const_reference_proxy<L>::value() const -> const value_type&
auto const_reference_proxy<L>::value() const -> const_reference
{
assert(has_value());
return m_val_ref;
Expand Down
4 changes: 3 additions & 1 deletion include/sparrow/variable_size_binary_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ namespace sparrow
using inner_value_type = T;
using inner_reference = R;
using inner_const_reference = CR;
using bitmap_type = array_data::bitmap_type;
using bitmap_const_reference = typename bitmap_type::const_reference;
using value_type = std::optional<inner_value_type>;
using const_reference = const_reference_proxy<self_type>;
using size_type = std::size_t;
Expand Down Expand Up @@ -248,7 +250,7 @@ namespace sparrow
template <class T, class R, class CR, class OT>
auto variable_size_binary_layout<T, R, CR, OT>::operator[](size_type i) const -> const_reference
{
return const_reference(*this, i);
return const_reference(value(i), has_value(i));
}

template <class T, class R, class CR, class OT>
Expand Down

0 comments on commit c1076a4

Please sign in to comment.