Skip to content

Commit

Permalink
Fixes for ObjectiveCPP::ArrayFromVectorIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
macmade committed Feb 13, 2018
1 parent 23a982e commit e66c64b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ObjectiveCPP/include/ObjectiveCPP/Vector.hpp
Expand Up @@ -63,7 +63,7 @@ namespace ObjectiveCPP
#pragma clang diagnostic ignored "-Wnullability-completeness"
#endif
template < typename T, typename ObjCClass >
NSArray * ArrayFromVectorIterator( typename std::vector< T >::const_iterator begin, typename std::vector< T >::const_iterator end, SEL initMethod )
NSArray * ArrayFromVectorIterator( typename std::vector< T >::iterator begin, typename std::vector< T >::iterator end, SEL initMethod )
#ifdef __clang__
#pragma clang diagnostic pop
#endif
Expand Down Expand Up @@ -106,7 +106,9 @@ namespace ObjectiveCPP
template < typename T, typename ObjCClass >
NSArray * ArrayFromVector( const std::vector< T > & vector, SEL initMethod )
{
return ArrayFromVectorIterator< T, ObjCClass >( vector.cbegin(), vector.cend(), initMethod );
std::vector< T > & v( const_cast< std::vector< T > & >( vector ) );

return ArrayFromVectorIterator< T, ObjCClass >( v.begin(), v.end(), initMethod );
}

template < typename T, typename ObjCClass >
Expand Down

0 comments on commit e66c64b

Please sign in to comment.