<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Rename link to time_zone_link</title>

	<style>
	p {text-align:justify}
	li {text-align:justify}
	blockquote.note
	{
		background-color:#E0E0E0;
		padding-left: 15px;
		padding-right: 15px;
		padding-top: 1px;
		padding-bottom: 1px;
	}
	ins {color:#00A000}
	del {color:#A00000}
	code {white-space:pre;}
	table, th, td {
		border: 1px solid black;
		border-collapse: collapse;
		padding: 10px;
	}
	</style>
</head>
<body>

<address align=right>
Document number: P1982R0<br>
<br/>
<br/>
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
2019-11-09<br/>
</address>
<hr/>
<h1 align=center>Rename link to time_zone_link</h1>

<p><a href="https://github.com/cplusplus/nbballot/issues/342"><b>Addresses DE 346</b></a></p>

<h2>Contents</h2>

<ul>
<li><a href="#Introduction">Introduction</a></li>
<li><a href="#Wording">Wording</a></li>
</ul>

<a name="Introduction"></a><h2>Introduction</h2>

<p>
The LEWG in Belfast requested that I write a paper which provides
wording for
<a href="https://github.com/cplusplus/nbballot/issues/342">DE 346</a>
as modified by the discussion in LEWG.  The LEWG chose the name
<code>time_zone_link</code> as a replacement for <code>link</code>,
and specifically chose not to change the associated data member of
<code>tzdb</code> <code>links</code>.
</p>

<a name="Wording"></a><h2>Wording</h2>

<ol>
<li>
<p>
Modify the synopsis in [time.syn] as indicated:
</p>
<blockquote><pre>
...
<i>// 27.11.9, class <ins>time_zone_</ins>link</i>
class <ins>time_zone_</ins>link;

bool operator==(const <ins>time_zone_</ins>link&amp; x, const <ins>time_zone_</ins>link&amp; y);
strong_ordering operator&lt;=&gt;(const <ins>time_zone_</ins>link&amp; x, const <ins>time_zone_</ins>link&amp; y);
...
</pre></blockquote>
</li>

<li>
<p>
Modify the synopsis in [time.zone.db.tzdb] as indicated:
</p>
<blockquote><pre>
namespace std::chrono {
  struct tzdb {
    string                 version;
    vector&lt;time_zone&gt;      zones;
    vector&lt;<ins>time_zone_</ins>link&gt; links;
    vector&lt;leap&gt;           leaps;

    const time_zone* locate_zone(string_view tz_name) const;
    const time_zone* current_zone() const;
  };
}
</pre></blockquote>
</li>

<li>
<p>
Modify [time.zone.db.tzdb]/p2 as indicated:
</p>
<blockquote><pre>
const time_zone* locate_zone(string_view tz_name) const;
</pre>

<blockquote><p>
2 <i>Returns:</i> <del>If a <code>time_zone</code> is found for which
<code>name() == tz_name</code>, returns a pointer to that
<code>time_zone</code>. Otherwise if a
<code>link</code> is found for which
<code>tz_name == link.name()</code>, then a
pointer is returned to the <code>time_zone</code> for which
<code>zone.name() == link.target()</code>.</del><br>

<ul>
<li>
<p><ins>
If a <code>time_zone</code>, <code>tz</code>, is found for which
<code>tz.name() == tz_name</code>, a pointer to
<code>tz</code>;
</ins></p>
</li>
<li>
<p><ins>
otherwise, if a <code>time_zone_link</code>, <code>tz_l</code>, is found for which
<code>tz_l.name() == tz_name</code>, then a
pointer to the <code>time_zone</code>, <code>tz</code>, for which
<code>tz.name() == tz_l.target()</code>.
</ins></p>
</li>
</ul>
[<i>Note:</i> A <code><ins>time_zone_</ins>link</code> specifies an
alternative name for a <code>time_zone</code>. <i>&mdash; end
note</i>]
</p></blockquote>
</blockquote>
</li>

<li>
<p>
Modify the title of [time.zone.link] as indicated:
</p>
<blockquote><p>
<b>Class <ins>time_zone_</ins>link</b>
</p></blockquote>
</li>


<li>
<p>
Modify [time.zone.link.overview] as indicated:
</p>
<blockquote>
<pre>
namespace std::chrono {
  class <ins>time_zone_</ins>link {
  public:
    <ins>time_zone_</ins>link(<ins>time_zone_</ins>link&amp;&amp;) = default;
    <ins>time_zone_</ins>link&amp; operator=(<ins>time_zone_</ins>link&amp;&amp;) = default;

    <i>// unspecified additional constructors</i>

    string_view name()   const noexcept;
    string_view target() const noexcept;
  };
}
</pre>
<p>
1 A <code><ins>time_zone_</ins>link</code> specifies an alternative
name for a <code>time_zone</code>.
<code><ins>time_zone_</ins>link</code>s are constructed when the time
zone database is initialized.
</p>
</blockquote>
</li>

<li>
<p>
Modify [time.zone.link.members]/p2 as indicated:
</p>
<blockquote>
<pre>
string_view target() const noexcept;
</pre>
<blockquote><p>
2 <i>Returns:</i> The name of the <code>time_zone</code> for which
this <code><ins>time_zone_</ins>link</code> provides an alternative
name.
</p></blockquote>
</blockquote>
</li>

<li>
<p>
Modify [time.zone.link.nonmembers] as indicated:
</p>
<blockquote>

<pre>
bool operator==(const <ins>time_zone_</ins>link&amp; x, const <ins>time_zone_</ins>link&amp; y) noexcept;
</pre>
<blockquote>
<p>
1 <i>Returns:</i> <code>x.name() == y.name()</code>.
</p>
</blockquote>

<pre>
strong_ordering operator&lt;=&gt;(const <ins>time_zone_</ins>link&amp; x, const <ins>time_zone_</ins>link&amp; y) noexcept;
</pre>
<blockquote>
<p>
2 <i>Returns:</i> <code>x.name() &lt;=&gt; y.name()</code>.
</p>
</blockquote>

</blockquote>
</li>

</ol>

</body>
</html>
