From 8c23496c8d64fd527b690ecbb570459f68ff92d6 Mon Sep 17 00:00:00 2001 From: Mathias Paulin Date: Mon, 3 Apr 2023 18:43:48 +0200 Subject: [PATCH] [core] fix strange code duplication --- src/Core/Utils/TypesUtils.hpp | 52 ----------------------------------- 1 file changed, 52 deletions(-) diff --git a/src/Core/Utils/TypesUtils.hpp b/src/Core/Utils/TypesUtils.hpp index 19dc4f7f51d..6305cad088f 100644 --- a/src/Core/Utils/TypesUtils.hpp +++ b/src/Core/Utils/TypesUtils.hpp @@ -54,32 +54,6 @@ std::false_type is_container_impl( ... ); template using is_container = decltype( detail::is_container_impl( 0 ) ); -// Check if a type is a container with access to its element type and number -// adapted from https://stackoverflow.com/questions/13830158/check-if-a-variable-type-is-iterable -namespace detail { - -using std::begin; -using std::end; - -template -auto is_container_impl( int ) - -> decltype( begin( std::declval() ) != - end( std::declval() ), // begin/end and operator != - void(), // Handle evil operator , - std::declval().empty(), - std::declval().size(), - ++std::declval() ) )&>(), // operator ++ - void( *begin( std::declval() ) ), // operator* - std::true_type {} ); - -template -std::false_type is_container_impl( ... ); - -} // namespace detail - -template -using is_container = decltype( detail::is_container_impl( 0 ) ); - // TypeList taken and adapted from // https://github.com/AcademySoftwareFoundation/openvdb/blob/master/openvdb/openvdb/TypeList.h // Only took small part of TypeList utilities @@ -190,32 +164,6 @@ std::string demangleType( const T& ) noexcept { return demangleType(); } -// Check if a type is a container with access to its element type and number -// adapted from https://stackoverflow.com/questions/13830158/check-if-a-variable-type-is-iterable -namespace detail { - -using std::begin; -using std::end; - -template -auto is_container_impl( int ) - -> decltype( begin( std::declval() ) != - end( std::declval() ), // begin/end and operator != - void(), // Handle evil operator , - std::declval().empty(), - std::declval().size(), - ++std::declval() ) )&>(), // operator ++ - void( *begin( std::declval() ) ), // operator* - std::true_type {} ); - -template -std::false_type is_container_impl( ... ); - -} // namespace detail - -template -using is_container = decltype( detail::is_container_impl( 0 ) ); - } // namespace Utils } // namespace Core } // namespace Ra