littles things
This commit is contained in:
parent
d3be108df6
commit
d1cd97809e
|
@ -102,7 +102,7 @@ namespace bwidgets
|
|||
template<Numeric N>
|
||||
[[nodiscard]] inline auto operator/(const N& operand) const noexcept
|
||||
{
|
||||
SDL_assert(operand != 0); // NOLINT
|
||||
SDL_assert_release(operand != 0); // NOLINT
|
||||
return _operate<N>(operand, [](const N& a, const N& b) { return a / b; });
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,10 @@ namespace bwidgets
|
|||
|
||||
virtual ~OpaqueStruct() noexcept
|
||||
{
|
||||
_deleter(_c_pod);
|
||||
try {
|
||||
_deleter(_c_pod);
|
||||
} catch (...) {
|
||||
}
|
||||
};
|
||||
|
||||
[[nodiscard]] inline auto* operator()() const
|
||||
|
@ -40,13 +43,6 @@ namespace bwidgets
|
|||
Wrapper(T* ptr, const Deleter& d) : _data(ptr, d) {}
|
||||
};
|
||||
};
|
||||
|
||||
template<typename... Ts>
|
||||
void discard(Ts*&... ptrs)
|
||||
{
|
||||
((delete ptrs), ...);
|
||||
((ptrs = nullptr), ...);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,8 +31,8 @@ namespace bwidgets
|
|||
virtual ~Widget() = default;
|
||||
|
||||
virtual auto handle_event(const SDL_Event&) -> Widget*;
|
||||
|
||||
[[nodiscard]] virtual auto size() const noexcept -> Size = 0;
|
||||
|
||||
virtual auto render() -> Widget* final;
|
||||
virtual auto renderer(const std::shared_ptr<Renderer>&) -> Widget* final;
|
||||
virtual auto viewport(const SDL_Rect&) -> Widget* final;
|
||||
|
|
Loading…
Reference in New Issue