<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Your suggestion is essentially to replace experimental/string_view with something like:<div class=""><br class=""></div><div class="">    namespace std { inline namespace __1 { namespace experimental {</div><div class="">      template <class CharT></div><div class="">      using basic_string_view = _VSTD::basic_string_view;</div><div class="">    }}}</div><div class=""><br class=""></div><div class="">That breaks:</div><div class="">1. User compiles 1.cpp with older toolchain.  1.cpp implements foo(std::experimental::string_view).</div><div class="">2. User compiles 2.cpp with newer toolchain.  2.cpp calls foo(std::experimental::string_view).</div><div class="">3. User links 1.o with 2.o.</div><div class=""><br class=""></div><div class="">I'm not sure if this matters.</div><div class=""><br class=""></div><div class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Jun 15, 2017, at 21:55, Eric Fiselier <<a href="mailto:eric@efcs.ca" class="">eric@efcs.ca</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I would also want to do serious performance analysis on this patch. Does removing the string_view overloads cause less optimal overloads to be chosen? Perhaps allocating ones?<div class="">That would be really unfortunate, and I'm not sure that's in the best interest of our users at large.</div></div></div></blockquote><div><br class=""></div><div>Less optimal compared to what?  C++17 code?</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">/Eric</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jun 15, 2017 at 10:51 PM, Duncan P. N. Exon Smith <span dir="ltr" class=""><<a href="mailto:dexonsmith@apple.com" target="_blank" class="">dexonsmith@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jun 15, 2017, at 19:42, Eric Fiselier <<a href="mailto:eric@efcs.ca" target="_blank" class="">eric@efcs.ca</a>> wrote:</div><br class="m_3829869060949612838Apple-interchange-newline"><div class=""><br class="m_3829869060949612838Apple-interchange-newline"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Thu, Jun 15, 2017 at 8:38 PM, Duncan P. N. Exon Smith<span class="m_3829869060949612838Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:dexonsmith@apple.com" target="_blank" class="">dexonsmith@apple.com</a>></span><span class="m_3829869060949612838Apple-converted-space"> </span>w<wbr class="">rote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word" class="">I just started working on a patch to add #if guards, and the first interesting thing I found was the basic_string constructor:<div class=""><br class=""></div><div class=""><div class=""></div><blockquote type="cite" class=""><span class=""><div class="">template <class _CharT, class _Traits, class _Allocator></div></span><div class="">template <class _Tp></div><div class="">basic_string<_CharT, _Traits, _Allocator>::basic_string(</div><div class="">             const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a,</div><div class=""><span class="m_3829869060949612838m_8776782733827039247Apple-tab-span" style="white-space:pre-wrap">                       </span><span class="m_3829869060949612838Apple-converted-space"> </span>typename enable_if<__can_be_converted_t<wbr class="">o_string_view<_CharT, _Traits, _Tp>::value, void>::type *)</div><div class="">   <span class="m_3829869060949612838Apple-converted-space"> </span>: __r_(__second_tag(), __a)</div><div class="">{</div><div class=""><span class="m_3829869060949612838m_8776782733827039247Apple-tab-span" style="white-space:pre-wrap">   </span>__self_view __sv = __self_view(__t).substr(__pos, __n);</div><div class="">   <span class="m_3829869060949612838Apple-converted-space"> </span>__init(__sv.data(), __sv.size());</div><div class="">#if _LIBCPP_DEBUG_LEVEL >= 2</div><div class="">   <span class="m_3829869060949612838Apple-converted-space"> </span>__get_db()->__insert_c(this)<wbr class="">;</div><div class="">#endif</div><div class="">}</div></blockquote><div class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">That constructor was added in C++17, so removing it along with string_view should be OK.</div><div class="">Assuming we don't use it to implement older constructors using a single template.</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class=""></div><div class="">I suppose the decision was made so that std::string could take advantage of it.</div><div class=""><br class=""></div><div class="">Is it a conforming extension?</div></div></div></blockquote><div class=""><br class=""></div><div class="">No, because it can change the meaning of otherwise well defined code, as you pointed out initially. </div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Let me know if this patch is along the right lines.  If so, I'll finish it up and put it on phab.</div><div class=""><br class=""></div><div class="">experimental/filesystem/path.<wbr class="">cpp doesn't compile, since experimental/filesystem uses things like operator+=(string, string_view) extensively.  But I'd like an early opinion on the approach before I dig in.</div><div class=""><br class=""></div><div class="">In string, the only function that needed to be rewritten was string::compare(size, size, string, size, size).  I'm nervous that filesystem will be a bigger job.</div><div class=""><br class=""></div><div class=""></div></div></div><br class=""><div style="word-wrap:break-word" class=""><div class=""><div class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class=""><div class="m_230594884939490540h5"><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Jun 15, 2017, at 18:35, Eric Fiselier <<a href="mailto:eric@efcs.ca" target="_blank" class="">eric@efcs.ca</a>> wrote:</div><br class="m_230594884939490540m_8776782733827039247Apple-interchange-newline"><div class=""><div dir="ltr" class="">It *shouldn't* include <string_view>, that's a given.<div class=""><br class=""></div><div class="">IIRC, and Marshall would know better, I believe it was untenable to</div><div class="">maintain a version of <string> that didn't depend on <string_view> after making</div><div class="">the changes required for C++17.</div><div class=""><br class=""></div><div class="">However inspecting <string> now it does seem possible that the entanglement</div><div class="">is avoidable.Though it's also likely I'm just not seeing the whole picture. </div><div class=""><br class=""></div><div class="">/Eric</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jun 15, 2017 at 6:42 PM, Duncan P. N. Exon Smith<span class="m_230594884939490540Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:dexonsmith@apple.com" target="_blank" class="">dexonsmith@apple.com</a>></span>wr<wbr class="">ote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br class="">> On Jul 20, 2016, at 22:31, Marshall Clow via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class="">><br class="">> Modified: libcxx/trunk/include/string<br class="">> URL:<span class="m_230594884939490540Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?rev=276238&r1=276237&r2=276238&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/<wbr class="">llvm-project/libcxx/trunk/<wbr class="">include/string?rev=276238&r1=<wbr class="">276237&r2=276238&view=diff</a><br class="">> ==============================<wbr class="">==============================<wbr class="">==================<br class="">><br class=""></span><span class="">> @@ -435,6 +461,7 @@ basic_string<char32_t> operator "" s( co<br class="">> */<br class="">><br class="">> #include <__config><br class="">> +#include <string_view><br class=""><br class=""></span>This breaks the following, valid, C++14 code:<br class=""><br class="">   <span class="m_230594884939490540Apple-converted-space"> </span>#include <string><br class="">   <span class="m_230594884939490540Apple-converted-space"> </span>#include <experimental/string_view><br class="">   <span class="m_230594884939490540Apple-converted-space"> </span>using namespace std;<br class="">   <span class="m_230594884939490540Apple-converted-space"> </span>using std::experimental::string_view<wbr class="">;<br class="">   <span class="m_230594884939490540Apple-converted-space"> </span>void f() { string_view sv; }<br class=""><br class="">Should <string> #include <string_view> even when we're not in C++17 mode?  Why?<br class=""><div class="m_230594884939490540m_8776782733827039247HOEnZb"><div class="m_230594884939490540m_8776782733827039247h5"><br class="">> #include <iosfwd><br class="">> #include <cstring><br class="">> #include <cstdio>  // For EOF.</div></div></blockquote></div></div></div></blockquote></div></div></div></div></div></blockquote></div></div></blockquote></div><br class=""></div><br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>