Simply put, I’m trying to use std::distance to find the position of an iterator in an FString.
Here’s the code I’m trying to build (HiddenWord and Input are both FString types):
and I get the pre-compiler error:
no instance of function template “std::distance” matches the argument list – argument types are: (TCheckedPointerIterator<const TCHAR, int32>, TCheckedPointerIterator<const TCHAR, int32>)
I copied this snippet over to VS2019 just to see if it compiles without the context of UE4 and it’s completely fine, so this is definitely UE specific.
I also tried creating a vector and assigning the Input data which actually solved my problem, but I’d like to understand why this didn’t work in the first place.
Could someone help me in understanding why my FString variables work fine for some STL functions (find, for_each etc) but not for distance?