From 4a9ce6e2555dfaf9155fa279f25667350377f688 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Sat, 15 Mar 2025 18:03:23 +0400 Subject: feat: chtype wrap --- include/ncurses/utils/modifiers.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/ncurses/utils/modifiers.hpp (limited to 'include/ncurses/utils/modifiers.hpp') diff --git a/include/ncurses/utils/modifiers.hpp b/include/ncurses/utils/modifiers.hpp new file mode 100644 index 0000000..79e4139 --- /dev/null +++ b/include/ncurses/utils/modifiers.hpp @@ -0,0 +1,31 @@ +#ifndef INCLUDE_UTILS_MODIFIERS_HPP_ +#define INCLUDE_UTILS_MODIFIERS_HPP_ + +#include + +#include + +namespace NCURSES_CPP_NAMESPACE { + +template class composable { +public: + using flags_type = multiflags; + using flags_mask_type = multiflags; + + NCURSES_CPP_CONSTEXPR_14 composable & + operator&(const ApplicantType applicant) { + static_cast(this)->value_(); + } + + NCURSES_CPP_CONSTEXPR_14 composable &operator&(const flags_type &flags) { + value_ &= static_cast(flags); + return *this; + } + +private: + value_type value_; +}; + +} // namespace NCURSES_CPP_NAMESPACE + +#endif // INCLUDE_UTILS_MODIFIERS_HPP_ -- cgit v1.2.3