60 [&observed](
auto&&... bakedCases) {
63 [&observed, ... cases = std::forward<std::decay_t<decltype(bakedCases)>>(bakedCases)] {
65 return !((cases.value == observed.
value() ? (renderer = cases.renderer,
true) :
false) || ...)
66 ? [](
auto&,
auto const&) -> std::shared_ptr<Dom::Element> {
67 Console::warn(
"Nui::switch_ error! No case matched and no default case was provided!");
76 bakedDefault = std::move(bakedDefault),
77 ... cases = std::forward<std::decay_t<decltype(bakedCases)>>(bakedCases)]() {
79 return !((cases.value == observed.
value() ? (renderer = cases.renderer,
true) :
false) || ...)
static void warn(Args &&... args)
Definition: console.hpp:23
ContainedT const & value() const
Definition: observed_value.hpp:313
Definition: observed_value.hpp:1202
Definition: comment.hpp:10
constexpr auto fragment(ParametersT &&... params)
A fragment is a collection of elements that can be inserted into a parent without an enclosing tag.
Definition: fragment.hpp:15
constexpr auto switch_(Observed< T > &observed)
Definition: switch.hpp:57
auto default_()
Definition: switch.hpp:51
auto case_(T &&value)
Definition: switch.hpp:47
std::function< std::shared_ptr< Dom::Element >(Dom::Element &, Renderer const &)> ElementRenderer
Definition: element_renderer.hpp:11
Definition: switch.hpp:16
Nui::ElementRenderer renderer
Definition: switch.hpp:18
T value
Definition: switch.hpp:17
Definition: switch.hpp:23
auto operator()(Nui::ElementRenderer renderer) &&
Definition: switch.hpp:26
T value
Definition: switch.hpp:24
Definition: switch.hpp:33
Nui::ElementRenderer renderer
Definition: switch.hpp:34
Definition: switch.hpp:38
auto operator()(Nui::ElementRenderer renderer) &&
Definition: switch.hpp:39
Definition: overloaded.hpp:7