<div dir="ltr">Using std::string instead of ustring will lead to a lot more memory allocations, which can be slow but may be ok in practice for the way Cycles uses it.<div><br></div><div>Feel free to submit a patch on <a href="http://developer.blender.org">developer.blender.org</a> when you think the code is in a good state.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 6, 2018 at 4:47 AM, Guillaume Chéreau <span dir="ltr"><<a href="mailto:guillaume.chereau@gmail.com" target="_blank">guillaume.chereau@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I just started a branch of Cycles on github for the goxel version.<br>
<br>
My first commit allows to use std::string for ustring and a custom<br>
implementation of TypeDef:<br>
<a href="https://github.com/guillaumechereau/cycles/commit/0f286bc4da5536a19640eb4ede640423e317e733" rel="noreferrer" target="_blank">https://github.com/<wbr>guillaumechereau/cycles/<wbr>commit/<wbr>0f286bc4da5536a19640eb4ede6404<wbr>23e317e733</a><br>
<br>
Regards,<br>
Guillaume<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Mar 6, 2018 at 10:05 AM, Guillaume Chéreau<br>
<<a href="mailto:guillaume.chereau@gmail.com">guillaume.chereau@gmail.com</a>> wrote:<br>
> It is actually not difficult to replace oiio ustring with std::string<br>
> in the code, since the api are almost the same, but the performance<br>
> are probably not as good with std::string.<br>
><br>
> In util/util_param.h, I can comment out the OpenImageIO/ustring.h<br>
> include and add those lines:<br>
><br>
> // ustring implementation based on std::string.<br>
> class ustring : public std::string<br>
> {<br>
> public:<br>
>     ustring() {}<br>
>     explicit ustring(const char *str) : std::string(str) {}<br>
>     ustring (const ustring &str) : ustring(str.c_str()) {}<br>
>     ustring (const std::string &str) : ustring(str.c_str()) {}<br>
>     const std::string &string() const { return *this; }<br>
>     operator int(void) const { return !empty(); }<br>
>     const ustring &operator=(const char *str) { *this = str; return *this; }<br>
> };<br>
> typedef std::hash<std::string> ustringHash;<br>
><br>
> And the compilation works.<br>
><br>
> Similar treatment can be done for typedesc.<br>
><br>
><br>
> Regards,<br>
> Guillaume<br>
><br>
> --<br>
> Guillaume<br>
> <a href="mailto:guillaume.chereau@gmail.com">guillaume.chereau@gmail.com</a><br>
> <a href="tel:%2B886%20970422910" value="+886970422910">+886 970422910</a><br>
<br>
<br>
<br>
--<br>
Guillaume<br>
<a href="mailto:guillaume.chereau@gmail.com">guillaume.chereau@gmail.com</a><br>
<a href="tel:%2B886%20970422910" value="+886970422910">+886 970422910</a><br>
______________________________<wbr>_________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/bf-cycles</a><br>
</div></div></blockquote></div><br></div>