Boost C++ Libraries: Ticket #1737: Add AllocatorConcept to BCCL https://svn.boost.org/trac10/ticket/1737 <p> It would be convenient to have an <a class="missing wiki">AllocatorConcept</a> in the Boost Concept Check Library. Below is a nearly complete implementation. </p> <p> -- code -- </p> <p> namespace boost { </p> <p> template &lt;typename T&gt; struct <a class="missing wiki">AllocatorConcept</a> { </p> <blockquote> <p> typedef typename T::const_pointer const_pointer; typedef typename T::const_reference const_reference; typedef typename T::difference_type difference_type; typedef typename T::pointer pointer; typedef typename T::reference reference; typedef typename T::size_type size_type; typedef typename T::value_type value_type; <em> TODO: Do we need to do more here, e.g. </em></p> </blockquote> <p> char_allocator_type::rebind&lt;value_type&gt;::other == T? </p> <blockquote> <p> typedef typename T::template rebind&lt;char&gt;::other char_allocator_type; </p> </blockquote> <blockquote> <p> BOOST_CLASS_REQUIRE(T, boost, <a class="missing wiki">DefaultConstructibleConcept</a>); BOOST_CLASS_REQUIRE(T, boost, <a class="missing wiki">CopyConstructibleConcept</a>); BOOST_CLASS_REQUIRE(T, boost, <a class="missing wiki">EqualityComparableConcept</a>); </p> </blockquote> <blockquote> <p> void constraints() { </p> <blockquote> <p> pointer p = 0; reference ref = *p; const_reference cref = *p; </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> p = value.address(ref); const_pointer cp = value.address(cref); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> p = value.allocate(1); p = value.allocate(1, 0); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> value.construct(p, *p); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> value.deallocate(p, 1); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> value.destroy(p); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> size_type s = value.max_size(); </p> </blockquote> <p> } </p> </blockquote> <p> private: </p> <blockquote> <p> T value; </p> </blockquote> <p> }; } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1737 Trac 1.4.3 mfawcett Wed, 18 Mar 2009 19:28:13 GMT version, milestone deleted https://svn.boost.org/trac10/ticket/1737#comment:1 https://svn.boost.org/trac10/ticket/1737#comment:1 <ul> <li><strong>version</strong> <span class="trac-field-deleted">Boost Development Trunk</span> </li> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.36.0</span> </li> </ul> Ticket acharles Tue, 18 Feb 2014 12:03:06 GMT owner, status changed https://svn.boost.org/trac10/ticket/1737#comment:2 https://svn.boost.org/trac10/ticket/1737#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">jsiek</span> to <span class="trac-author">acharles</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket acharles Tue, 18 Feb 2014 12:03:34 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1737#comment:3 https://svn.boost.org/trac10/ticket/1737#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Library is unmaintained, therefore, no new features are planned. </p> Ticket