Skip to content

Commit

Permalink
Add missing LAGER_THROW
Browse files Browse the repository at this point in the history
  • Loading branch information
arximboldi committed Nov 21, 2023
1 parent 04e3869 commit 231f524
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions lager/reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ struct reader_mixin

auto node_() const
{
if(auto node = detail::access::node(*static_cast<const DerivT*>(this))) {
if (auto node =
detail::access::node(*static_cast<const DerivT*>(this))) {
return node;
}
throw std::runtime_error("Accessing uninitialized reader");
LAGER_THROW(std::runtime_error("Accessing uninitialized reader"));
}
};

Expand All @@ -101,20 +102,23 @@ class reader_base
int> = 0>
reader_base(reader_base<T> x)
: base_t{std::move(x)}
{}
{
}

template <typename T,
std::enable_if_t<std::is_same_v<zug::meta::value_t<NodeT>,
zug::meta::value_t<T>>,
int> = 0>
reader_base(cursor_base<T> x)
: base_t{std::move(x)}
{}
{
}

template <typename NodeT2>
reader_base(std::shared_ptr<NodeT2> n)
: base_t{std::move(n)}
{}
{
}
};

/*!
Expand Down
14 changes: 9 additions & 5 deletions lager/writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ struct writer_mixin

auto node_() const
{
if(auto node = detail::access::node(*static_cast<const DerivT*>(this))) {
if (auto node =
detail::access::node(*static_cast<const DerivT*>(this))) {
return node;
}
throw std::runtime_error("Accessing uninitialized writer");
LAGER_THROW(std::runtime_error("Accessing uninitialized writer"));
}
};

Expand All @@ -100,16 +101,19 @@ class writer_base
template <typename T>
writer_base(writer_base<T> x)
: node_(std::move(x.node_))
{}
{
}

template <typename T>
writer_base(cursor_base<T> x)
: node_(detail::access::node(std::move(x)))
{}
{
}

writer_base(node_ptr_t sig)
: node_(std::move(sig))
{}
{
}
};

/*!
Expand Down

0 comments on commit 231f524

Please sign in to comment.