16 template <
typename T,
typename TACTIC = weakTactic>
class tweak:
public binder {
61 template <
typename T,
typename F> tmedium<T> operator|(
const tweak<T>& t, F&& f) {
68 template <
typename T,
typename F> tweak<T> operator|(tweak<T>&& t, F&& f) {
83 static nbool isNul(
const tweak<T>& it) {
return !it.isBind(); }
85 static constexpr nbool is_ptr =
false;
86 static constexpr nbool is_ref =
false;
87 static constexpr nbool is_like_ptr =
true;
95 static tweak<T>* ret() {
return nullptr; }
97 static nbool isNul(
const tweak<T>* it) {
return !it || !it->isBind(); }
99 static constexpr nbool is_ptr =
true;
100 static constexpr nbool is_ref =
false;
101 static constexpr nbool is_like_ptr = is_ptr;
109 static nbool isNul(
const tweak<T>& it) {
return !it.isBind(); }
116 static constexpr nbool is_ptr =
false;
117 static constexpr nbool is_ref =
true;
118 static constexpr nbool is_like_ptr =
true;
122 template <
typename T,
typename F>
127 template <
typename T,
typename F>
128 auto operator->*(
const tweak<T>& t, F&& f) ->
decltype(typeTrait<
decltype(f(*t))>::ret()) {
129 return t ? f(*t) : typeTrait<decltype(f(*t))>::ret();
132 template <
typename T,
typename F>
133 auto operator->*(tweak<T>&& t, F&& f) ->
decltype(typeTrait<
decltype(f(*t))>::ret()) {
134 return t ? f(*t) : typeTrait<decltype(f(*t))>::ret();
Generalized binding class for managing instance lifecycles.
Definition binder.hpp:108
Weak reference smart pointer with type-safe access.
Definition tweak.hpp:16
const T *get() const BY_CONST_FUNC(get()) using super nbool bind(const T &new1)
Binds a weak reference to the specified instance.
Core class for runtime type information in byeol language.
Definition type.hpp:100
Rich logging support with polymorphic type conversion.
Definition richLog.hpp:34