17#if defined(__cpp_lib_format)
148 constexpr explicit operator
float() const
163 constexpr explicit operator
double() const
178 constexpr explicit operator
long double() const
193 [[nodiscard]] explicit operator
std::
string() const
247 [[nodiscard]] constexpr
int scale() const;
251 L* p_layout =
nullptr;
259 template <typename L>
266 template <
typename L>
269 p_layout->assign(std::forward<value_type>(rhs), m_index);
273 template <
typename L>
276 p_layout->assign(rhs, m_index);
280 template <
typename L>
287 template <
typename L>
294 template <
typename L>
297 return value() == rhs;
300 template <
typename L>
303 return value() <=> rhs;
306 template <
typename L>
309 return static_cast<const L*
>(p_layout)->
value(m_index);
312 template <
typename L>
315 return value().storage();
318 template <
typename L>
321 return value().scale();
324 template <
typename L>
328 return static_cast<float>(
value());
331 template <
typename L>
335 return static_cast<double>(
value());
338 template <
typename L>
342 return static_cast<long double>(
value());
346#if defined(__cpp_lib_format)
350struct std::formatter<
sparrow::decimal_reference<L>>
352 constexpr auto parse(std::format_parse_context& ctx)
357 auto format(
const sparrow::decimal_reference<L>& ref, std::format_context& ctx)
const
359 const auto& value = ref.
value();
360 return std::format_to(ctx.out(),
"{}", value);
366 template <
typename L>
369 os << std::format(
"{}", value);
constexpr int scale() const
constexpr bool operator==(const value_type &rhs) const
Equality comparison with decimal value.
constexpr decimal_reference(L *layout, size_type index) noexcept
Constructs a decimal reference for the given layout and index.
constexpr value_type::integer_type storage() const
constexpr self_type & operator=(self_type &&rhs) noexcept
Move assignment from another decimal reference.
typename array_type::inner_value_type value_type
decimal_reference< array_type > self_type
constexpr const_reference value() const
typename array_type::inner_reference reference
constexpr decimal_reference(const decimal_reference &)=default
constexpr auto operator<=>(const value_type &rhs) const
Three-way comparison with decimal value.
typename array_type::size_type size_type
constexpr decimal_reference(decimal_reference &&) noexcept=default
typename array_type::inner_const_reference const_reference
std::ptrdiff_t difference_type
constexpr bool is_int_placeholder_v
std::ostream & operator<<(std::ostream &os, const nullval_t &)