Ticket #1107: PATCH.weak_use_count.diff

File PATCH.weak_use_count.diff, 20.0 KB (added by Carsten Neumann <carsten_neumann@…>, 10 years ago)

weak_use_count() implementation, docs, some testing coverage

  • boost/smart_ptr/detail/shared_count.hpp

    diff --git a/boost/smart_ptr/detail/shared_count.hpp b/boost/smart_ptr/detail/shared_count.hpp
    index f96a220..214e35e 100644
    a b public:  
    357357        return pi_ != 0? pi_->use_count(): 0;
    358358    }
    359359
     360    long weak_use_count() const // nothrow
     361    {
     362        return pi_ != 0 ? pi_->weak_use_count() : 0;
     363    }
     364
    360365    bool unique() const // nothrow
    361366    {
    362367        return use_count() == 1;
    public:  
    483488        return pi_ != 0? pi_->use_count(): 0;
    484489    }
    485490
     491    long weak_use_count() const // nothrow
     492    {
     493        return pi_ != 0 ? pi_->weak_use_count() : 0;
     494    }
     495
    486496    bool empty() const // nothrow
    487497    {
    488498        return pi_ == 0;
  • boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp b/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp
    index dffd995..82bdd47 100644
    a b public:  
    141141    {
    142142        return static_cast<int const volatile &>( use_count_ ); // TODO use ld.acq here
    143143    }
     144
     145    long weak_use_count() const // nothrow
     146    {
     147        return static_cast<int const volatile &>( weak_count_ ) - (use_count() != 0);
     148    }
    144149};
    145150
    146151} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_aix.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_aix.hpp b/boost/smart_ptr/detail/sp_counted_base_aix.hpp
    index 0208678..92278a4 100644
    a b public:  
    133133    {
    134134        return fetch_and_add( const_cast<int32_t*>(&use_count_), 0 );
    135135    }
     136
     137    long weak_use_count() const // nothrow
     138    {
     139        return fetch_and_add( const_cast<int32_t*>(&weak_count_), 0) - (use_count() != 0);
     140    }
    136141};
    137142
    138143} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
    index 51ac56a..0f716e8 100644
    a b public:  
    161161    {
    162162        return static_cast<long const volatile &>( use_count_ );
    163163    }
     164
     165    long weak_use_count() const // nothrow
     166    {
     167        return static_cast<int const volatile &>( weak_count_ ) - (use_count() != 0);
     168    }
    164169};
    165170
    166171} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp b/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp
    index 1234e78..29fa288 100644
    a b public:  
    149149    {
    150150        return static_cast<int const volatile &>( use_count_ );
    151151    }
     152
     153    long weak_use_count() const // nothrow
     154    {
     155        return static_cast<int const volatile &>( weak_count_ ) - (use_count() != 0);
     156    }
    152157};
    153158
    154159} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp b/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp
    index d122a49..b3d8a64 100644
    a b public:  
    148148    {
    149149        return static_cast<int const volatile &>( use_count_ ); // TODO use ld.acq here
    150150    }
     151
     152    long weak_use_count() const // nothrow
     153    {
     154        return static_cast<int const volatile &>( weak_count_ ) - (use_count() != 0);
     155    }
    151156};
    152157
    153158} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp b/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp
    index 3f1f449..b72b377 100644
    a b public:  
    172172    {
    173173        return static_cast<int const volatile &>( use_count_ );
    174174    }
     175
     176    long weak_use_count() const // nothrow
     177    {
     178        return static_cast<int const volatile &>( weak_count_ ) - (use_count() != 0);
     179    }
    175180};
    176181
    177182} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp
    index 7f5c414..f8f1048 100644
    a b public:  
    172172    {
    173173        return static_cast<int const volatile &>( use_count_ );
    174174    }
     175
     176    long weak_use_count() const // nothrow
     177    {
     178        return static_cast<int const volatile &>( weak_count_ ) - (use_count() != 0);
     179    }
    175180};
    176181
    177182} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp b/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp
    index 21fa59d..bd3c128 100644
    a b public:  
    157157    {
    158158        return const_cast< int32_t const volatile & >( use_count_ );
    159159    }
     160
     161    long weak_use_count() const // nothrow
     162    {
     163        return static_cast< int32_t const volatile & >( weak_count_ ) - (use_count() != 0);
     164    }
    160165};
    161166
    162167} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp b/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp
    index 4d7fa8d..7986747 100644
    a b public:  
    164164    {
    165165        return static_cast<int const volatile &>( use_count_ );
    166166    }
     167
     168    long weak_use_count() const // nothrow
     169    {
     170        return static_cast<int const volatile &>( weak_count_ ) - (use_count() != 0);
     171    }
    167172};
    168173
    169174} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_nt.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_nt.hpp b/boost/smart_ptr/detail/sp_counted_base_nt.hpp
    index dfd70e7..cf9951e 100644
    a b public:  
    9898    {
    9999        return use_count_;
    100100    }
     101
     102    long weak_use_count() const // nothrow
     103    {
     104        return weak_count_ - (use_count_ != 0);
     105    }
    101106};
    102107
    103108} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_pt.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_pt.hpp b/boost/smart_ptr/detail/sp_counted_base_pt.hpp
    index 3c56fec..683f592 100644
    a b public:  
    126126
    127127        return r;
    128128    }
     129
     130    long weak_use_count() const // nothrow
     131    {
     132        pthread_mutex_lock( &m_ );
     133        long r = weak_count_ - (use_count_ != 0);
     134        pthread_mutex_unlock( &m_ );
     135
     136        return r;
     137    }
    129138};
    130139
    131140} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp b/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp
    index e51e676..042f6ce 100644
    a b public:  
    152152    {
    153153        return const_cast< uint32_t const volatile & >( use_count_ );
    154154    }
     155
     156    long weak_use_count() const // nothrow
     157    {
     158        return static_cast< uint32_t const volatile & >( weak_count_ ) - (use_count() != 0);
     159    }
    155160};
    156161
    157162} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_solaris.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_solaris.hpp b/boost/smart_ptr/detail/sp_counted_base_solaris.hpp
    index d1b6bec..fa2b865 100644
    a b public:  
    104104    {
    105105        return static_cast<long const volatile &>( use_count_ );
    106106    }
     107
     108    long weak_use_count() const // nothrow
     109    {
     110        return static_cast<long const volatile &>( weak_count_ ) - (use_count() != 0);
     111    }
    107112};
    108113
    109114} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_spin.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_spin.hpp b/boost/smart_ptr/detail/sp_counted_base_spin.hpp
    index bbd11e6..13af5d2 100644
    a b public:  
    122122        spinlock_pool<1>::scoped_lock lock( &use_count_ );
    123123        return use_count_;
    124124    }
     125
     126    long weak_use_count() const // nothrow
     127    {
     128        spinlock_pool<1>::scoped_lock lock( &use_count_ );
     129        return weak_count_ - (use_count_ != 0);
     130    }
    125131};
    126132
    127133} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_sync.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_sync.hpp b/boost/smart_ptr/detail/sp_counted_base_sync.hpp
    index 41f654e..58cdc9d 100644
    a b public:  
    146146    {
    147147        return const_cast< sp_int32_t const volatile & >( use_count_ );
    148148    }
     149
     150    long weak_use_count() const // nothrow
     151    {
     152        return static_cast< sp_int32_t const volatile & >( weak_count_ ) - (use_count() != 0);
     153    }
    149154};
    150155
    151156} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp
    index 842f58f..b8b65a3 100644
    a b public:  
    141141    {
    142142        return *const_cast<volatile int*>(&use_count_);
    143143    }
     144
     145    long weak_use_count() const // nothrow
     146    {
     147        return *const_cast<volatile int*>(&weak_count_) - (use_count() != 0);
     148    }
    144149};
    145150
    146151} // namespace detail
  • boost/smart_ptr/detail/sp_counted_base_w32.hpp

    diff --git a/boost/smart_ptr/detail/sp_counted_base_w32.hpp b/boost/smart_ptr/detail/sp_counted_base_w32.hpp
    index 06aa456..155e266 100644
    a b public:  
    121121    {
    122122        return static_cast<long const volatile &>( use_count_ );
    123123    }
     124
     125    long weak_use_count() const // nothrow
     126    {
     127        return static_cast<long const volatile &>( weak_count_ ) - (use_count() != 0);
     128    }
    124129};
    125130
    126131} // namespace detail
  • boost/smart_ptr/shared_ptr.hpp

    diff --git a/boost/smart_ptr/shared_ptr.hpp b/boost/smart_ptr/shared_ptr.hpp
    index 0932cc3..8af7f9a 100644
    a b public:  
    437437        return pn.use_count();
    438438    }
    439439
     440    long weak_use_count() const // never throws
     441    {
     442        return pn.weak_use_count();
     443    }
     444
    440445    void swap(shared_ptr<T> & other) // never throws
    441446    {
    442447        std::swap(px, other.px);
  • boost/smart_ptr/weak_ptr.hpp

    diff --git a/boost/smart_ptr/weak_ptr.hpp b/boost/smart_ptr/weak_ptr.hpp
    index 5391910..7a24758 100644
    a b public:  
    173173        return pn.use_count();
    174174    }
    175175
     176    long weak_use_count() const // never throws
     177    {
     178        return pn.weak_use_count();
     179    }
     180
    176181    bool expired() const // never throws
    177182    {
    178183        return pn.use_count() == 0;
  • libs/smart_ptr/shared_ptr.htm

    diff --git a/libs/smart_ptr/shared_ptr.htm b/libs/smart_ptr/shared_ptr.htm
    index 77e1fa8..240d8dc 100644
    a b void bad()  
    136136
    137137      bool <A href="#unique" >unique</A>() const; // never throws
    138138      long <A href="#use_count" >use_count</A>() const; // never throws
     139      long <A href="#weak_use_count" >weak_use_count</A>() const; // never throws
    139140
    140141      operator <A href="#conversions" ><i>unspecified-bool-type</i></A>() const; // never throws
    141142
    q = p;  
    384385                        <P><B>Notes:</B> <code>use_count()</code> is not necessarily efficient. Use only
    385386                                for debugging and testing purposes, not for production code.</P>
    386387                </blockquote>
     388                <h3><a name="weak_use_count">weak_use_count</a></h3>
     389                <pre>long weak_use_count() const; // never throws</pre>
     390                <blockquote>
     391                        <p><b>Returns:</b> the number of <b>weak_ptr</b> objects that <i>share ownership</i> with <b>*this</b>,
     392                                or 0 when <b>*this</b> is <EM>empty</EM>.</p>
     393                        <p><b>Throws:</b> nothing.</p>
     394                        <P><B>Notes:</B> <code>weak_use_count()</code> is not necessarily efficient. Use only
     395                                for debugging and testing purposes, not for production code.</P>
     396                </blockquote>
    387397                <h3><a name="conversions">conversions</a></h3>
    388398                <pre>operator <i>unspecified-bool-type</i> () const; // never throws</pre>
    389399                <blockquote>
    p3.reset(new int(2)); // undefined, multiple writes  
    672682                <P>
    673683                        <b>A.</b> Automatic conversion is believed to be too error prone.<BR>
    674684                </P>
    675                 <P><B>Q.</B> Why does <b>shared_ptr</b> supply use_count()?</P>
     685                <P><B>Q.</B> Why does <b>shared_ptr</b> supply use_count()/weak_use_count()?</P>
    676686                <P>
    677687                        <b>A.</b> As an aid to writing test cases and debugging displays. One of the
    678688                        progenitors had use_count(), and it was useful in tracking down bugs in a
  • libs/smart_ptr/test/weak_ptr_test.cpp

    diff --git a/libs/smart_ptr/test/weak_ptr_test.cpp b/libs/smart_ptr/test/weak_ptr_test.cpp
    index a4ad766..819427f 100644
    a b  
    2929#include <boost/shared_ptr.hpp>
    3030#include <boost/weak_ptr.hpp>
    3131
     32#include <iostream>
    3233#include <map>
    3334#include <vector>
    3435
    void default_constructor()  
    7677    {
    7778        boost::weak_ptr<int> wp;
    7879        BOOST_TEST(wp.use_count() == 0);
     80        BOOST_TEST(wp.weak_use_count() == 0);
    7981    }
    8082
    8183    {
    8284        boost::weak_ptr<void> wp;
    8385        BOOST_TEST(wp.use_count() == 0);
     86        BOOST_TEST(wp.weak_use_count() == 0);
    8487    }
    8588
    8689    {
    8790        boost::weak_ptr<incomplete> wp;
    8891        BOOST_TEST(wp.use_count() == 0);
     92        BOOST_TEST(wp.weak_use_count() == 0);
    8993    }
    9094}
    9195
    void shared_ptr_constructor()  
    96100
    97101        boost::weak_ptr<int> wp(sp);
    98102        BOOST_TEST(wp.use_count() == sp.use_count());
     103        BOOST_TEST(wp.weak_use_count() == 0);
     104        BOOST_TEST(wp.weak_use_count() == sp.weak_use_count());
    99105
    100106        boost::weak_ptr<void> wp2(sp);
    101107        BOOST_TEST(wp2.use_count() == sp.use_count());
     108        BOOST_TEST(wp2.weak_use_count() == 0);
     109        BOOST_TEST(wp2.weak_use_count() == wp.weak_use_count());
    102110    }
    103111
    104112    {
    void shared_ptr_constructor()  
    108116            boost::weak_ptr<int> wp(sp);
    109117            BOOST_TEST(wp.use_count() == sp.use_count());
    110118            BOOST_TEST(wp.use_count() == 1);
     119            BOOST_TEST(wp.weak_use_count() == 1);
    111120            boost::shared_ptr<int> sp2(wp);
    112121            BOOST_TEST(wp.use_count() == 2);
     122            BOOST_TEST(wp.weak_use_count() == 1);
    113123            BOOST_TEST(!(sp < sp2 || sp2 < sp));
    114124        }
    115125
    void shared_ptr_constructor()  
    117127            boost::weak_ptr<void> wp(sp);
    118128            BOOST_TEST(wp.use_count() == sp.use_count());
    119129            BOOST_TEST(wp.use_count() == 1);
     130            BOOST_TEST(wp.weak_use_count() == 1);
    120131            boost::shared_ptr<void> sp2(wp);
    121132            BOOST_TEST(wp.use_count() == 2);
     133            BOOST_TEST(wp.weak_use_count() == 1);
    122134            BOOST_TEST(!(sp < sp2 || sp2 < sp));
    123135        }
    124136    }
    void shared_ptr_constructor()  
    130142            boost::weak_ptr<int> wp(sp);
    131143            BOOST_TEST(wp.use_count() == sp.use_count());
    132144            BOOST_TEST(wp.use_count() == 1);
     145            BOOST_TEST(wp.weak_use_count() == 1);
    133146            boost::shared_ptr<int> sp2(wp);
    134147            BOOST_TEST(wp.use_count() == 2);
     148            BOOST_TEST(wp.weak_use_count() == 1);
    135149            BOOST_TEST(!(sp < sp2 || sp2 < sp));
    136150        }
    137151
    void shared_ptr_constructor()  
    139153            boost::weak_ptr<void> wp(sp);
    140154            BOOST_TEST(wp.use_count() == sp.use_count());
    141155            BOOST_TEST(wp.use_count() == 1);
     156            BOOST_TEST(wp.weak_use_count() == 1);
    142157            boost::shared_ptr<void> sp2(wp);
    143158            BOOST_TEST(wp.use_count() == 2);
     159            BOOST_TEST(wp.weak_use_count() == 1);
    144160            BOOST_TEST(!(sp < sp2 || sp2 < sp));
    145161        }
    146162    }
    void shared_ptr_constructor()  
    150166
    151167        boost::weak_ptr<void> wp(sp);
    152168        BOOST_TEST(wp.use_count() == sp.use_count());
     169        BOOST_TEST(wp.weak_use_count() == sp.weak_use_count());
    153170    }
    154171
    155172    {
    void copy_constructor()  
    224241        boost::weak_ptr<int> wp;
    225242        boost::weak_ptr<int> wp2(wp);
    226243        BOOST_TEST(wp2.use_count() == wp.use_count());
     244        BOOST_TEST(wp2.weak_use_count() == wp.weak_use_count());
    227245        BOOST_TEST(wp2.use_count() == 0);
     246        BOOST_TEST(wp2.weak_use_count() == 0);
    228247    }
    229248
    230249    {
    void copy_constructor()  
    238257        boost::weak_ptr<incomplete> wp;
    239258        boost::weak_ptr<incomplete> wp2(wp);
    240259        BOOST_TEST(wp2.use_count() == wp.use_count());
     260        BOOST_TEST(wp2.weak_use_count() == wp.weak_use_count());
    241261        BOOST_TEST(wp2.use_count() == 0);
     262        BOOST_TEST(wp2.weak_use_count() == 0);
    242263    }
    243264
    244265    {
    void copy_constructor()  
    247268
    248269        boost::weak_ptr<int> wp2(wp);
    249270        BOOST_TEST(wp2.use_count() == wp.use_count());
     271        BOOST_TEST(wp2.weak_use_count() == wp.weak_use_count());
    250272        BOOST_TEST(wp2.use_count() == 1);
     273        BOOST_TEST(wp2.weak_use_count() == 2);
    251274        BOOST_TEST(!(wp < wp2 || wp2 < wp));
    252275
    253276        sp.reset();
    void copy_constructor()  
    255278
    256279        boost::weak_ptr<int> wp3(wp);
    257280        BOOST_TEST(wp3.use_count() == wp.use_count());
     281        BOOST_TEST(wp3.weak_use_count() == wp.weak_use_count());
    258282        BOOST_TEST(wp3.use_count() == 0);
     283        BOOST_TEST(wp3.weak_use_count() == 3);
    259284        BOOST_TEST(!(wp < wp3 || wp3 < wp));
    260285    }
    261286
    void copy_constructor()  
    265290
    266291        boost::weak_ptr<int> wp2(wp);
    267292        BOOST_TEST(wp2.use_count() == wp.use_count());
     293        BOOST_TEST(wp2.weak_use_count() == wp.weak_use_count());
    268294        BOOST_TEST(wp2.use_count() == 1);
     295        BOOST_TEST(wp2.weak_use_count() == 2);
    269296        BOOST_TEST(!(wp < wp2 || wp2 < wp));
    270297
    271298        sp.reset();
    void copy_constructor()  
    273300
    274301        boost::weak_ptr<int> wp3(wp);
    275302        BOOST_TEST(wp3.use_count() == wp.use_count());
     303        BOOST_TEST(wp3.weak_use_count() == wp.weak_use_count());
    276304        BOOST_TEST(wp3.use_count() == 0);
     305        BOOST_TEST(wp3.weak_use_count() == 3);
    277306        BOOST_TEST(!(wp < wp3 || wp3 < wp));
    278307    }
    279308
    void copy_constructor()  
    283312
    284313        boost::weak_ptr<void> wp2(wp);
    285314        BOOST_TEST(wp2.use_count() == wp.use_count());
     315        BOOST_TEST(wp2.weak_use_count() == wp.weak_use_count());
    286316        BOOST_TEST(wp2.use_count() == 1);
     317        BOOST_TEST(wp2.weak_use_count() == 2);
    287318        BOOST_TEST(!(wp < wp2 || wp2 < wp));
    288319
    289320        sp.reset();
    void copy_constructor()  
    291322
    292323        boost::weak_ptr<void> wp3(wp);
    293324        BOOST_TEST(wp3.use_count() == wp.use_count());
     325        BOOST_TEST(wp3.weak_use_count() == wp.weak_use_count());
    294326        BOOST_TEST(wp3.use_count() == 0);
     327        BOOST_TEST(wp3.weak_use_count() == 3);
    295328        BOOST_TEST(!(wp < wp3 || wp3 < wp));
    296329    }
    297330
  • libs/smart_ptr/weak_ptr.htm

    diff --git a/libs/smart_ptr/weak_ptr.htm b/libs/smart_ptr/weak_ptr.htm
    index 0fa87f7..b839e30 100644
    a b if(shared_ptr&lt;int&gt; r = q.<A href="#lock" >lock</A>())  
    8787      template&lt;class Y&gt; weak_ptr &amp; <A href="#assignment" >operator=</A>(shared_ptr&lt;Y&gt; const &amp; r);
    8888
    8989      long <A href="#use_count" >use_count</A>() const;
     90      long <A href="#weak_use_count" >weak_use_count</A>() const;
    9091      bool <A href="#expired" >expired</A>() const;
    9192      shared_ptr&lt;T&gt; <A href="#lock" >lock</A>() const;
    9293
    template&lt;class Y&gt; weak_ptr &amp; operator=(shared_ptr&lt;Y&gt; const &amp;  
    151152                        <P><B>Notes:</B> <code>use_count()</code> is not necessarily efficient. Use only
    152153                                for debugging and testing purposes, not for production code.</P>
    153154                </blockquote>
     155                <h3><a name="weak_use_count">weak_use_count</a></h3>
     156                <pre>long weak_use_count() const;</pre>
     157                <blockquote>
     158                        <p><b>Returns:</b> 0 if <STRONG>*this</STRONG> is <EM>empty</EM>; otherwise, the
     159                                number of <b>weak_ptr</b> objects that <EM>share ownership</EM> with <STRONG>*this</STRONG>.</p>
     160                        <p><b>Throws:</b> nothing.</p>
     161                        <P><B>Notes:</B> <code>weak_use_count()</code> is not necessarily efficient. Use only
     162                                for debugging and testing purposes, not for production code.</P>
     163                </blockquote>
    154164                <h3><a name="expired">expired</a></h3>
    155165                <pre>bool expired() const;</pre>
    156166                <blockquote>