diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/tag_primitive.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/tag_primitive.h b/include/tag_primitive.h index 3b8ac51237..397ea64da3 100644 --- a/include/tag_primitive.h +++ b/include/tag_primitive.h @@ -45,8 +45,11 @@ public: tag_primitive(T value = 0); tag_primitive& operator=(T value); + void set(T value); + operator T&(); operator T() const; + T get() const; tag_type get_type() const noexcept override; @@ -75,12 +78,30 @@ tag_primitive<T>& tag_primitive<T>::operator=(T val) } template<class T> +void tag_primitive<T>::set(T val) +{ + value = val; +} + +template<class T> +tag_primitive<T>::operator T&() +{ + return value; +} + +template<class T> tag_primitive<T>::operator T() const { return value; } template<class T> +T tag_primitive<T>::get() const +{ + return value; +} + +template<class T> tag_type tag_primitive<T>::get_type() const noexcept { return type; |
