Boost C++ Libraries: Ticket #6791: Support boost::array https://svn.boost.org/trac10/ticket/6791 <p> boost::hash_value appears to lack support for boost::array. Could you add it? </p> <p> Isn't it possible to support all containers in a generic way? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6791 Trac 1.4.3 Daniel James Sat, 14 Apr 2012 16:39:37 GMT owner, component changed https://svn.boost.org/trac10/ticket/6791#comment:1 https://svn.boost.org/trac10/ticket/6791#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Daniel James</span> to <span class="trac-author">Marshall Clow</span> </li> <li><strong>component</strong> <span class="trac-field-old">hash</span> → <span class="trac-field-new">array</span> </li> </ul> <p> It isn't possible to do it generically, because equality isn't always defined the same for all containers. </p> <p> Support needs to be added to array itself, which is pretty easy, it just needs to include <code>&lt;boost/functional/hash_fwd.hpp&gt;</code> and then add something like the following to the same namespace as array (so that it will be picked up by ADL): </p> <pre class="wiki">template&lt;....&gt; std::size_t hash_value(array&lt;....&gt; const&amp; x) { return boost::hash_range(x.begin(), x.end()); } </pre> Ticket Marshall Clow Sat, 14 Apr 2012 18:07:37 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6791#comment:2 https://svn.boost.org/trac10/ticket/6791#comment:2 <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> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77976" title="Added support for Boost.Hash to Boost.Array; fixes #6791">[77976]</a>) Added support for Boost.Hash to Boost.Array; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6791" title="#6791: Feature Requests: Support boost::array (closed: fixed)">#6791</a> </p> Ticket Olaf van der Spek <olafvdspek@…> Sat, 14 Apr 2012 20:05:19 GMT <link>https://svn.boost.org/trac10/ticket/6791#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6791#comment:3</guid> <description> <blockquote class="citation"> <p> It isn't possible to do it generically, because equality isn't always defined the same for all containers. </p> </blockquote> <p> Does that matter? Can't you just do "return boost::hash_range(x.begin(), x.end());"? </p> <blockquote class="citation"> <p> Support needs to be added to array itself, </p> </blockquote> <p> What about std::array? </p> </description> <category>Ticket</category> </item> </channel> </rss>