diff --git a/alib2abstraction/src/core/type_details.hpp b/alib2abstraction/src/core/type_details.hpp index 83dc2079f53672500d67c451386769e4a2b63541..9d28ca9316f0277235624c9b06e7ea3c441f272e 100644 --- a/alib2abstraction/src/core/type_details.hpp +++ b/alib2abstraction/src/core/type_details.hpp @@ -62,13 +62,6 @@ struct type_details_retriever < T * > { } }; -template < class T, size_t S > -struct type_details_retriever < T [ S ] > { - static std::unique_ptr < type_details_base > get ( ) { - return std::make_unique < type_details_array > ( std::is_const_v < T >, S, type_details_retriever < std::decay_t < T > >::get ( ) ); - } -}; - template < class T > struct type_details_retriever < const T && > { static std::unique_ptr < type_details_base > get ( ) { diff --git a/alib2abstraction/src/core/type_details_base.cpp b/alib2abstraction/src/core/type_details_base.cpp index 60fe0de1b4b3008cfb52612df37ebe2e2211ce0a..fcbf86de4e4c88f8f27be46fc8835ee614f1ccc2 100644 --- a/alib2abstraction/src/core/type_details_base.cpp +++ b/alib2abstraction/src/core/type_details_base.cpp @@ -195,45 +195,6 @@ bool type_details_pointer::operator == ( const type_details_pointer & other ) co // -------------------------------------------------------------------------------------------------------------------------------------------------- -void type_details_array::print ( std::ostream & os ) const { - os << (m_is_const_qualified ? "const " : "" ) << * m_sub_type << "[" << m_length << "]"; -} - -type_details_array::type_details_array ( bool is_const_qualified, size_t length, std::unique_ptr < type_details_base > sub_type ) : m_is_const_qualified ( is_const_qualified ), m_length ( length ), m_sub_type ( std::move ( sub_type ) ) { -} - -bool type_details_array::compatible_with ( const type_details_base & other ) const { - auto casted = dynamic_cast < const type_details_array * > ( & other ); - if ( casted == nullptr ) - return false; - - return m_is_const_qualified == casted->m_is_const_qualified && m_length == casted->m_length && m_sub_type->compatible_with ( * casted->m_sub_type ); -} - -std::strong_ordering type_details_array::operator <=> ( const type_details_base & other ) const { - if ( ext::type_index ( typeid ( * this ) ) != ext::type_index ( typeid ( other ) ) ) - return ext::type_index ( typeid ( * this ) ) <=> ext::type_index ( typeid ( other ) ); - - return * this <=> static_cast < decltype ( ( * this ) ) > ( other ); -} - -std::strong_ordering type_details_array::operator <=> ( const type_details_array & other ) const { - return std::tie ( m_is_const_qualified, m_length, * m_sub_type ) <=> std::tie ( other.m_is_const_qualified, m_length, * other.m_sub_type ); -} - -bool type_details_array::operator == ( const type_details_base & other ) const { - if ( ext::type_index ( typeid ( * this ) ) != ext::type_index ( typeid ( other ) ) ) - return false; - - return * this == static_cast < decltype ( ( * this ) ) > ( other ); -} - -bool type_details_array::operator == ( const type_details_array & other ) const { - return std::tie ( m_is_const_qualified, m_length, * m_sub_type ) == std::tie ( other.m_is_const_qualified, m_length, * other.m_sub_type ); -} - -// -------------------------------------------------------------------------------------------------------------------------------------------------- - void type_details_reference::print ( std::ostream & os ) const { os << (m_is_const_qualified ? "const " : "" ) << * m_sub_type << ( m_is_rvalue ? " &&" : " &" ); } diff --git a/alib2abstraction/src/core/type_details_base.hpp b/alib2abstraction/src/core/type_details_base.hpp index 621dc944d78bd4006eaf51e0c1fab176fb0549b0..ee97b2979e3a2d2e3ebb4b68b1e5c5cee4d7a828 100644 --- a/alib2abstraction/src/core/type_details_base.hpp +++ b/alib2abstraction/src/core/type_details_base.hpp @@ -113,28 +113,6 @@ public: bool operator == ( const type_details_pointer & other ) const; }; -class type_details_array : public type_details_base { - bool m_is_const_qualified; - size_t m_length; - - std::unique_ptr < type_details_base > m_sub_type; - - void print ( std::ostream & os ) const override; - -public: - type_details_array ( bool is_const_qualified, size_t length, std::unique_ptr < type_details_base > sub_type ); - - bool compatible_with ( const type_details_base & other ) const override; - - std::strong_ordering operator <=> ( const type_details_base & other ) const override; - - std::strong_ordering operator <=> ( const type_details_array & other ) const; - - bool operator == ( const type_details_base & other ) const override; - - bool operator == ( const type_details_array & other ) const; -}; - class type_details_reference : public type_details_base { bool m_is_const_qualified; bool m_is_rvalue;