TermOx
opposite.hpp
1 #ifndef TERMOX_WIDGET_LAYOUTS_OPPOSITE_HPP
2 #define TERMOX_WIDGET_LAYOUTS_OPPOSITE_HPP
3 #include <termox/widget/layouts/horizontal.hpp>
4 #include <termox/widget/layouts/vertical.hpp>
5 
6 namespace ox::layout {
7 
10 template <typename Layout_t>
11 struct Opposite;
12 
13 template <typename Child_t>
14 struct Opposite<layout::Horizontal<Child_t>> {
16 };
17 
18 template <typename Child_t>
19 struct Opposite<layout::Vertical<Child_t>> {
21 };
22 
23 template <typename Layout_t>
24 using Opposite_t = typename Opposite<Layout_t>::type;
25 
27 
29 template <typename Layout_t>
31 
32 template <typename Child_t>
33 struct Opposite_template<layout::Horizontal<Child_t>> {
34  template <typename T>
35  using type = layout::Vertical<T>;
36 };
37 
38 template <typename Child_t>
39 struct Opposite_template<layout::Vertical<Child_t>> {
40  template <typename T>
42 };
43 
44 // Can't have a Opposite_template_t, can't deduce type in this context.
45 
46 } // namespace ox::layout
47 #endif // TERMOX_WIDGET_LAYOUTS_OPPOSITE_HPP
Lays out Widgets in 2D, sharing space in a primary dimension.
Definition: linear_layout.hpp:35
Opposite Layout type, but ::type is a template.
Definition: opposite.hpp:30
Definition: opposite.hpp:11