refactor(templates): remove the GetData function from the non-container class

This commit is contained in:
2022-04-24 22:42:40 +08:00
parent b3a97cfe21
commit c2eca8df1e
5 changed files with 85 additions and 129 deletions

View File

@ -308,9 +308,6 @@ public:
TTuple& operator=(const TTuple&) = default;
TTuple& operator=(TTuple&&) = default;
constexpr void* GetData() { return this; }
constexpr const void* GetData() const { return this; }
template <size_t I> requires (I < ElementSize) constexpr TElementType<I>::Type& GetValue() & { return static_cast< NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>& >(*this).GetValue(); }
template <size_t I> requires (I < ElementSize) constexpr const TElementType<I>::Type& GetValue() const & { return static_cast<const NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>& >(*this).GetValue(); }
template <size_t I> requires (I < ElementSize) constexpr volatile TElementType<I>::Type& GetValue() volatile& { return static_cast< volatile NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>& >(*this).GetValue(); }