[SG16-Unicode] [isocpp-lib-ext] Proposed design change to P1030 filesystem::path_view

Herring, Davis herring at lanl.gov
Thu Aug 22 15:45:24 CEST 2019


> It has been brought to my attention by Victor Zverovich that
> filesystem::path has an unfortunate quirk wrt Ranges:
> filesystem::path::iterator::value_type is filesystem::path.

This was (my) Late 19 comment for C++17.  (At the time, I proposed just using string for the individual components, but it's still helpful to have path's encoding support.)  It's also a famous pitfall in Python:

  def depth(x,f):  # apply f to all leaves
    try: x=iter(x)
    except TypeError: f(x)
    else:
      for e in x: depth(e,f)

depth("a",id) will recurse forever because list("a")[0]=="a".

Davis


More information about the Unicode mailing list