<div dir="ltr">On Tue, Jun 4, 2019 at 3:39 AM Lyberta &lt;<a href="mailto:lyberta@lyberta.net">lyberta@lyberta.net</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I&#39;m trying to replicate a &quot;sv&quot; UDL with strong code unit types.<br>
<br>
constexpr auto operator &quot;&quot; _cus(const char8_t* literal, std::size_t size)<br>
<br>
As view types require some outside storage, I&#39;m will need to create an<br>
array of code units in static memory. I&#39;m not sure how to do that. Also,<br>
the compiler says that &quot;size&quot; is not a constant expression. Any ideas?<br></blockquote><div><br></div><div>The answer is &quot;cheat and reinterpret cast&quot;, but you can&#39;t reinterpret cast in &quot;constexpr&quot;. So the real answer is: it&#39;s somewhat helpless. Whether we like it or not, char, char8_t, char16_t, and char32_t are the strongest string literal types we&#39;re ever going to have.<br><br></div><div>Sincerely,<br></div><div>ThePhD<br></div></div></div>