| [12] | 1 | <html> | 
|---|
 | 2 | <head> | 
|---|
 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | 
|---|
 | 4 | <title>Class template years_duration</title> | 
|---|
 | 5 | <link rel="stylesheet" href="boostbook.css" type="text/css"> | 
|---|
 | 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> | 
|---|
 | 7 | <link rel="start" href="index.html" title="The Boost C++ Libraries"> | 
|---|
 | 8 | <link rel="up" href="date_time/doxy.html#id2442047" title="Header <boost/date_time/date_duration_types.hpp>"> | 
|---|
 | 9 | <link rel="prev" href="months_duration.html" title="Class template months_duration"> | 
|---|
 | 10 | <link rel="next" href="date_facet.html" title="Class template date_facet"> | 
|---|
 | 11 | </head> | 
|---|
 | 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | 
|---|
 | 13 | <table cellpadding="2" width="100%"> | 
|---|
 | 14 | <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td> | 
|---|
 | 15 | <td align="center"><a href="../../index.htm">Home</a></td> | 
|---|
 | 16 | <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> | 
|---|
 | 17 | <td align="center"><a href="../../people/people.htm">People</a></td> | 
|---|
 | 18 | <td align="center"><a href="../../more/faq.htm">FAQ</a></td> | 
|---|
 | 19 | <td align="center"><a href="../../more/index.htm">More</a></td> | 
|---|
 | 20 | </table> | 
|---|
 | 21 | <hr> | 
|---|
 | 22 | <div class="spirit-nav"> | 
|---|
 | 23 | <a accesskey="p" href="months_duration.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2442047"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="date_facet.html"><img src="images/next.png" alt="Next"></a> | 
|---|
 | 24 | </div> | 
|---|
 | 25 | <div class="refentry" lang="en"> | 
|---|
 | 26 | <a name="years_duration"></a><div class="titlepage"></div> | 
|---|
 | 27 | <div class="refnamediv"> | 
|---|
 | 28 | <h2><span class="refentrytitle">Class template years_duration</span></h2> | 
|---|
 | 29 | <p>boost::date_time::years_duration — additional duration type that represents a logical year </p> | 
|---|
 | 30 | </div> | 
|---|
 | 31 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> | 
|---|
 | 32 | <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> base_config>  | 
|---|
 | 33 | <span class="bold"><strong>class</strong></span> years_duration { | 
|---|
 | 34 | <span class="bold"><strong>public</strong></span>: | 
|---|
 | 35 |   <span class="emphasis"><em>// <a href="years_duration.html#years_durationconstruct-copy-destruct">construct/copy/destruct</a></em></span> | 
|---|
 | 36 |   <a href="years_duration.html#id2500832-bb">years_duration</a>(int_rep); | 
|---|
 | 37 |   <a href="years_duration.html#id2494294-bb">years_duration</a>(special_values); | 
|---|
 | 38 |  | 
|---|
 | 39 |   <span class="emphasis"><em>// <a href="years_duration.html#id2499807-bb">public member functions</a></em></span> | 
|---|
 | 40 |   <span class="type">int_rep</span> <a href="years_duration.html#id2499812-bb">number_of_years</a>() <span class="bold"><strong>const</strong></span>; | 
|---|
 | 41 |   <span class="type">duration_type</span> <a href="years_duration.html#id2469511-bb">get_neg_offset</a>(<span class="bold"><strong>const</strong></span> date_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 42 |   <span class="type">duration_type</span> <a href="years_duration.html#id2400535-bb">get_offset</a>(<span class="bold"><strong>const</strong></span> date_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 43 |   <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="years_duration.html#id2422790-bb"><span class="bold"><strong>operator</strong></span>==</a>(<span class="bold"><strong>const</strong></span> years_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 44 |   <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="years_duration.html#id2509907-bb"><span class="bold"><strong>operator</strong></span>!=</a>(<span class="bold"><strong>const</strong></span> years_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 45 |   <span class="type">years_type</span> <a href="years_duration.html#id2433883-bb"><span class="bold"><strong>operator</strong></span>+</a>(<span class="bold"><strong>const</strong></span> years_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 46 |   <span class="type">years_type &</span> <a href="years_duration.html#id2394158-bb"><span class="bold"><strong>operator</strong></span>+=</a>(<span class="bold"><strong>const</strong></span> years_type &) ; | 
|---|
 | 47 |   <span class="type">years_type</span> <a href="years_duration.html#id2409965-bb"><span class="bold"><strong>operator</strong></span>-</a>(<span class="bold"><strong>const</strong></span> years_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 48 |   <span class="type">years_type &</span> <a href="years_duration.html#id2434523-bb"><span class="bold"><strong>operator</strong></span>-=</a>(<span class="bold"><strong>const</strong></span> years_type &) ; | 
|---|
 | 49 |   <span class="type">years_type</span> <a href="years_duration.html#id2508356-bb"><span class="bold"><strong>operator</strong></span> *</a>(<span class="bold"><strong>const</strong></span> int_type) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 50 |   <span class="type">years_type &</span> <a href="years_duration.html#id2424513-bb"><span class="bold"><strong>operator</strong></span> *=</a>(<span class="bold"><strong>const</strong></span> int_type) ; | 
|---|
 | 51 |   <span class="type">years_type</span> <a href="years_duration.html#id2483657-bb"><span class="bold"><strong>operator</strong></span>/</a>(<span class="bold"><strong>const</strong></span> int_type) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 52 |   <span class="type">years_type &</span> <a href="years_duration.html#id2521577-bb"><span class="bold"><strong>operator</strong></span>/=</a>(<span class="bold"><strong>const</strong></span> int_type) ; | 
|---|
 | 53 |   <span class="type">months_type</span> <a href="years_duration.html#id2495882-bb"><span class="bold"><strong>operator</strong></span>+</a>(<span class="bold"><strong>const</strong></span> months_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 54 |   <span class="type">months_type</span> <a href="years_duration.html#id2528104-bb"><span class="bold"><strong>operator</strong></span>-</a>(<span class="bold"><strong>const</strong></span> months_type &) <span class="bold"><strong>const</strong></span>; | 
|---|
 | 55 | };</pre></div> | 
|---|
 | 56 | <div class="refsect1" lang="en"> | 
|---|
 | 57 | <a name="id2612830"></a><h2>Description</h2> | 
|---|
 | 58 | <p>A logical year enables things like: "date(2002,Mar,2) + years(2) -> 2004-Mar-2". If the date is a last day-of-the-month, the result will also be a last-day-of-the-month (ie date(2001-Feb-28) + years(3) -> 2004-Feb-29). </p> | 
|---|
 | 59 | <div class="refsect2" lang="en"> | 
|---|
 | 60 | <a name="id2612845"></a><h3> | 
|---|
 | 61 | <a name="years_durationconstruct-copy-destruct"></a><code class="computeroutput">years_duration</code> construct/copy/destruct</h3> | 
|---|
 | 62 | <div class="orderedlist"><ol type="1"> | 
|---|
 | 63 | <li><pre class="literallayout"><a name="id2500832-bb"></a>years_duration(int_rep num);</pre></li> | 
|---|
 | 64 | <li><pre class="literallayout"><a name="id2494294-bb"></a>years_duration(special_values sv);</pre></li> | 
|---|
 | 65 | </ol></div> | 
|---|
 | 66 | </div> | 
|---|
 | 67 | <div class="refsect2" lang="en"> | 
|---|
 | 68 | <a name="id2612894"></a><h3> | 
|---|
 | 69 | <a name="id2499807-bb"></a><code class="computeroutput">years_duration</code> public member functions</h3> | 
|---|
 | 70 | <div class="orderedlist"><ol type="1"> | 
|---|
 | 71 | <li><pre class="literallayout"><span class="type">int_rep</span> <a name="id2499812-bb"></a>number_of_years() <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 72 | <li><pre class="literallayout"><span class="type">duration_type</span> <a name="id2469511-bb"></a>get_neg_offset(<span class="bold"><strong>const</strong></span> date_type & d) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 73 | <li><pre class="literallayout"><span class="type">duration_type</span> <a name="id2400535-bb"></a>get_offset(<span class="bold"><strong>const</strong></span> date_type & d) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 74 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2422790-bb"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> years_type & rhs) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 75 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2509907-bb"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> years_type & rhs) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 76 | <li><pre class="literallayout"><span class="type">years_type</span> <a name="id2433883-bb"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> years_type & rhs) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 77 | <li><pre class="literallayout"><span class="type">years_type &</span> <a name="id2394158-bb"></a><span class="bold"><strong>operator</strong></span>+=(<span class="bold"><strong>const</strong></span> years_type & rhs) ;</pre></li> | 
|---|
 | 78 | <li><pre class="literallayout"><span class="type">years_type</span> <a name="id2409965-bb"></a><span class="bold"><strong>operator</strong></span>-(<span class="bold"><strong>const</strong></span> years_type & rhs) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 79 | <li><pre class="literallayout"><span class="type">years_type &</span> <a name="id2434523-bb"></a><span class="bold"><strong>operator</strong></span>-=(<span class="bold"><strong>const</strong></span> years_type & rhs) ;</pre></li> | 
|---|
 | 80 | <li><pre class="literallayout"><span class="type">years_type</span> <a name="id2508356-bb"></a><span class="bold"><strong>operator</strong></span> *(<span class="bold"><strong>const</strong></span> int_type rhs) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 81 | <li><pre class="literallayout"><span class="type">years_type &</span> <a name="id2424513-bb"></a><span class="bold"><strong>operator</strong></span> *=(<span class="bold"><strong>const</strong></span> int_type rhs) ;</pre></li> | 
|---|
 | 82 | <li><pre class="literallayout"><span class="type">years_type</span> <a name="id2483657-bb"></a><span class="bold"><strong>operator</strong></span>/(<span class="bold"><strong>const</strong></span> int_type rhs) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 83 | <li><pre class="literallayout"><span class="type">years_type &</span> <a name="id2521577-bb"></a><span class="bold"><strong>operator</strong></span>/=(<span class="bold"><strong>const</strong></span> int_type rhs) ;</pre></li> | 
|---|
 | 84 | <li><pre class="literallayout"><span class="type">months_type</span> <a name="id2495882-bb"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> months_type & m) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 85 | <li><pre class="literallayout"><span class="type">months_type</span> <a name="id2528104-bb"></a><span class="bold"><strong>operator</strong></span>-(<span class="bold"><strong>const</strong></span> months_type & m) <span class="bold"><strong>const</strong></span>;</pre></li> | 
|---|
 | 86 | </ol></div> | 
|---|
 | 87 | </div> | 
|---|
 | 88 | </div> | 
|---|
 | 89 | </div> | 
|---|
 | 90 | <table width="100%"><tr> | 
|---|
 | 91 | <td align="left"></td> | 
|---|
 | 92 | <td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td> | 
|---|
 | 93 | </tr></table> | 
|---|
 | 94 | <hr> | 
|---|
 | 95 | <div class="spirit-nav"> | 
|---|
 | 96 | <a accesskey="p" href="months_duration.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2442047"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="date_facet.html"><img src="images/next.png" alt="Next"></a> | 
|---|
 | 97 | </div> | 
|---|
 | 98 | </body> | 
|---|
 | 99 | </html> | 
|---|