Boost C++ Libraries: Ticket #8630: uuid string generator accepts invalid uuids https://svn.boost.org/trac10/ticket/8630 <p> I've tried stream operator and string generator to convert string into uuids.<br /> But the string generator one accepts some incorrect uuid representation.<br /> For example, with the following strings: </p> <ul><li>"0000-0000-0000-0000-000000000000" </li><li>"------------------------------------" </li></ul><p> String generator accepts but produce strange content, but stream operator will refuse them. </p> <p> Maybe it's better to throw exception in such case?<br /> To tell user such string is not a correct uuid representation. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8630 Trac 1.4.3 anonymous Tue, 28 Oct 2014 15:22:05 GMT <link>https://svn.boost.org/trac10/ticket/8630#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8630#comment:1</guid> <description> <p> I think </p> <div class="wiki-code"><div class="code"><pre><span class="kt">char</span> <span class="k">const</span><span class="o">*</span> <span class="n">d</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">find</span><span class="p">(</span><span class="n">digits_begin</span><span class="p">,</span> <span class="n">digits_end</span><span class="p">,</span> <span class="n">c</span><span class="p">);</span> <span class="k">return</span> <span class="n">values</span><span class="p">[</span><span class="n">d</span> <span class="o">-</span> <span class="n">digits_begin</span><span class="p">];</span> </pre></div></div><p> should be </p> <div class="wiki-code"><div class="code"><pre><span class="kt">char</span> <span class="k">const</span><span class="o">*</span> <span class="n">d</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">find</span><span class="p">(</span><span class="n">digits_begin</span><span class="p">,</span> <span class="n">digits_end</span><span class="p">,</span> <span class="n">c</span><span class="p">);</span> <span class="k">if</span> <span class="p">(</span><span class="n">d</span> <span class="o">==</span> <span class="n">digits_end</span><span class="p">)</span> <span class="n">throw_invalid</span><span class="p">();</span> <span class="k">return</span> <span class="n">values</span><span class="p">[</span><span class="n">d</span> <span class="o">-</span> <span class="n">digits_begin</span><span class="p">];</span> </pre></div></div> </description> <category>Ticket</category> </item> <item> <author>James E. King, III <jking@…></author> <pubDate>Fri, 04 Aug 2017 01:58:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8630#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8630#comment:2</guid> <description> <p> Fixed in PR <a class="ext-link" href="https://github.com/boostorg/uuid/pull/17"><span class="icon">​</span>https://github.com/boostorg/uuid/pull/17</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Sat, 12 Aug 2017 22:29:52 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/8630#comment:3 https://svn.boost.org/trac10/ticket/8630#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.66.0</span> </li> </ul> Ticket