From cbdbf28dd98bfeddb6d73be7de5c8867c10a1338 Mon Sep 17 00:00:00 2001 From: Alexei Gladkikh Date: Sat, 27 Apr 2024 17:48:03 +0300 Subject: [PATCH] #248 Buildable and test pass ... don't wanna see it more --- Source/Cloud9/Tools/Extensions/TContainer.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Source/Cloud9/Tools/Extensions/TContainer.h b/Source/Cloud9/Tools/Extensions/TContainer.h index c5a6b18ab..66ebd0080 100644 --- a/Source/Cloud9/Tools/Extensions/TContainer.h +++ b/Source/Cloud9/Tools/Extensions/TContainer.h @@ -65,7 +65,9 @@ namespace Private_ETContainer template auto IteratorOf(ContainerType&& Container) { - return static_cast::Type>(Container).CreateIterator(); + using FNakedContainerType = typename TDecay::Type; + using FMutableContainerType = typename TRemoveConst::Type; + return const_cast(Container).CreateIterator(); } template @@ -94,14 +96,14 @@ namespace ETContainer { struct FromIterator { - template - constexpr auto operator()(ContainerType&& Self) const + template typename ContainerType> + constexpr auto operator()(ContainerType&& Self) const { - using FDereferenceFunctionType = decltype(&ContainerType::operator*); - using FDereferenceResultType = typename TInvokeResult::Type; - using FElementType = typename TRemovePointer::Type; - var Iterator = Private_ETContainer::TFromIteratorIterator(Self); - return TSequence(MoveTemp(Iterator)); + var Iterator = Private_ETContainer::TFromIteratorIterator< + InElementType, + ContainerType + >(Self); + return TSequence(MoveTemp(Iterator)); } OPERATOR_BODY(FromIterator)