Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65557 - in sandbox/conversion/libs/conversion/doc: . html
From: vicente.botet_at_[hidden]
Date: 2010-09-23 15:35:39


Author: viboes
Date: 2010-09-23 15:35:35 EDT (Thu, 23 Sep 2010)
New Revision: 65557
URL: http://svn.boost.org/trac/boost/changeset/65557

Log:
COnversion 0.5: Update doc
Added:
   sandbox/conversion/libs/conversion/doc/conversion.pdf (contents, props changed)
Text files modified:
   sandbox/conversion/libs/conversion/doc/Jamfile.v2 | 2
   sandbox/conversion/libs/conversion/doc/conversion.qbk | 239 +-
   sandbox/conversion/libs/conversion/doc/html/index.html | 3496 +++++++++++++++++++++++++++++++++++++++
   sandbox/conversion/libs/conversion/doc/html/standalone_HTML.manifest | 23
   4 files changed, 3587 insertions(+), 173 deletions(-)

Modified: sandbox/conversion/libs/conversion/doc/Jamfile.v2
==============================================================================
--- sandbox/conversion/libs/conversion/doc/Jamfile.v2 (original)
+++ sandbox/conversion/libs/conversion/doc/Jamfile.v2 2010-09-23 15:35:35 EDT (Thu, 23 Sep 2010)
@@ -33,7 +33,7 @@
         # Use graphics not text for navigation:
         <xsl:param>navig.graphics=1
         # How far down we chunk nested sections, basically all of them:
- <xsl:param>chunk.section.depth=2
+ <xsl:param>chunk.section.depth=0
         # Don't put the first section on the same page as the TOC:
         <xsl:param>chunk.first.sections=1
         # How far down sections get TOC's

Added: sandbox/conversion/libs/conversion/doc/conversion.pdf
==============================================================================
Binary file. No diff available.

Modified: sandbox/conversion/libs/conversion/doc/conversion.qbk
==============================================================================
--- sandbox/conversion/libs/conversion/doc/conversion.qbk (original)
+++ sandbox/conversion/libs/conversion/doc/conversion.qbk 2010-09-23 15:35:35 EDT (Thu, 23 Sep 2010)
@@ -8,8 +8,9 @@
 
 [article Toward Boost.Conversion
     [quickbook 1.4]
+ [version 0.5.0]
     [authors [Botet Escriba, Vicente J.]]
- [copyright 2009 Vicente J. Botet Escriba]
+ [copyright 2009-2010 Vicente J. Botet Escriba]
     [id boost.conversion]
     [dirname conversion]
     [purpose Conversion utilities]
@@ -428,7 +429,7 @@
 [endsect]
 
 
-[section:ext_references References]
+[section:ext_references External Resources]
 [variablelist
 [
     [[@http://www.boostpro.com/vault/index.php?action=downloadfile&filename=boost-string-convert.zip&directory=&
@@ -446,6 +447,30 @@
     [Optimized Policy-based Numeric Conversions from Fernando Cacciola.]
 ]
 
+[
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2380.pdf [*N2380 - Explicit Conversion Operator Draft Working Paper (revision 2)]]]
+ [Lois Goldthwaite, Michael Wong, Jens Mauer, Alisdair Meredith.]
+]
+[
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2200.pdf [*N2200 - Operator Overloading]]]
+ [Gary Powell, Doug Gregor, Jaakko Jarvi.]
+]
+
+[
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1671.pdf [*N1671 - Overloading operator.() & operator.*()]]]
+ [Gary Powell, Doug Gregor, Jaakko Jarvi.]
+]
+
+[
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1676.htm [*N1676 - Non-member overloaded copy assignment operator]]]
+ [Bronek Kozicki.]
+]
+
+[
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1694.html [*N1694 - A Proposal to Extend the Function Call Operator]]]
+ [Bronek Kozicki.]
+]
+
 ]
 
 [endsect]
@@ -465,7 +490,7 @@
     #include <boost/conversion/assign_to.hpp>
     #include <boost/conversion/convert_to_via.hpp>
     #include <boost/conversion/ca_wrapper.hpp>
- #include <boost/conversion/paxk.hpp>
+ #include <boost/conversion/pack.hpp>
 
 [endsect]
 
@@ -851,17 +876,13 @@
 Include this file when using conversions between rational of convertible types.
 
     namespace boost {
- namespace conversion {
- namespace partial_specialization_workaround {
- template < class T, class U>
- struct convert_to< rational<T>, rational<U> > {
- inline static rational<T> apply(rational<U> const & from);
- };
- template < class T, class U>
- struct assign_to< rational<T>, rational<U> > {
- inline static rational<T>& apply(rational<T>& to, const rational<U>& from);
- };
- }}
+ template < class T, class U>
+ rational<T> convert_to(rational<U> const & from
+ , boost::dummy::type_tag<rational<T> > const&);
+
+ template < class T, class U>
+ rational<T>& assign_to(rational<T>& to, const rational<U>& from
+ , boost::dummy::type_tag<rational<T> > const&);
     }
 
 [endsect]
@@ -872,58 +893,45 @@
 Include this file when using conversions between chrono and posix_time time and duration types.
 
     namespace boost {
- namespace conversion {
- namespace partial_specialization_workaround {
- template < class Rep, class Period>
- struct convert_to<posix_time::time_duration, chrono::duration<Rep, Period> > {
- static posix_time::time_duration apply(
- chrono::duration<Rep, Period> const & from);
- };
- template < class Rep, class Period>
- struct assign_to<posix_time::time_duration, chrono::duration<Rep, Period> > {
- static posix_time::time_duration& apply(
- posix_time::time_duration& to,
- const chrono::duration<Rep, Period>& from
- );
- };
+ namespace chrono {
+ template < class Clock, class Duration>
+ posix_time::ptime convert_to(const chrono::time_point<Clock, Duration>& from
+ , boost::dummy::type_tag<posix_time::ptime> const&);
+
+ template < class Clock, class Duration>
+ chrono::time_point<Clock, Duration>& assign_to(chrono::time_point<Clock, Duration>& to, const posix_time::ptime& from
+ , boost::dummy::type_tag<chrono::time_point<Clock, Duration> > const&);;
 
- template < class Rep, class Period>
- struct convert_to<chrono::duration<Rep, Period>, posix_time::time_duration> {
- static chrono::duration<Rep, Period> apply(posix_time::time_duration const & from);
- };
- template < class Rep, class Period>
- struct assign_to<chrono::duration<Rep, Period>, posix_time::time_duration> {
- static chrono::duration<Rep, Period> & apply(
- chrono::duration<Rep, Period> & to,
- const posix_time::time_duration& from);
- };
- }}
     }
+ namespace posix_time {
+ template < class Clock, class Duration>
+ chrono::time_point<Clock, Duration> convert_to(const ptime& from
+ , boost::dummy::type_tag<chrono::time_point<Clock, Duration> > const&);
 
- namespace boost {
- namespace conversion {
- namespace partial_specialization_workaround {
- template < class Clock, class Duration>
- struct convert_to<posix_time::ptime, chrono::time_point<Clock, Duration> > {
- static posix_time::ptime apply(const chrono::time_point<Clock, Duration>& from);
- };
- template < class Clock, class Duration>
- struct assign_to<posix_time::ptime, chrono::time_point<Clock, Duration> > {
- static posix_time::ptime& apply(posix_time::ptime& to,
- const chrono::time_point<Clock, Duration>& from);
- };
+ template < class Clock, class Duration>
+ ptime& assign_to(ptime& to, const chrono::time_point<Clock, Duration>& from
+ , boost::dummy::type_tag<posix_time::ptime> const&);
+ }
 
- template < class Clock, class Duration>
- struct convert_to<chrono::time_point<Clock, Duration>, posix_time::ptime> {
- static chrono::time_point<Clock, Duration> apply(const posix_time::ptime& from);
- };
- template < class Clock, class Duration>
- struct assign_to<chrono::time_point<Clock, Duration>, posix_time::ptime> {
- static chrono::time_point<Clock, Duration>& apply(
- chrono::time_point<Clock, Duration>& to,
- const posix_time::ptime& from);
- };
- }}
+ namespace chrono {
+ template < class Rep, class Period>
+ inline posix_time::time_duration convert_to(chrono::duration<Rep, Period> const & from
+ , boost::dummy::type_tag<posix_time::time_duration> const&);
+
+ template < class Rep, class Period>
+ inline chrono::duration<Rep, Period> & assign_to(chrono::duration<Rep, Period> & to, const posix_time::time_duration& from
+ , boost::dummy::type_tag<chrono::duration<Rep, Period> > const&);
+ }
+
+ namespace posix_time {
+ template < class Rep, class Period>
+ inline chrono::duration<Rep, Period> convert_to(time_duration const & from
+ , boost::dummy::type_tag<chrono::duration<Rep, Period> > const&);
+
+ template < class Rep, class Period>
+ inline time_duration& assign_to(time_duration& to, const chrono::duration<Rep, Period>& from
+ , boost::dummy::type_tag<posix_time::time_duration> const&);
+ }
     }
 
 [endsect]
@@ -934,18 +942,15 @@
 Include this file when using conversions between intervals of convertible types.
 
     namespace boost {
- namespace conversion {
- namespace partial_specialization_workaround {
- template < class T, class PT, class U, class PU>
- struct convert_to< interval<T,PT>, interval<U,PU> > {
- static interval<T,PT> apply(interval<U,PU> const & from);
- };
- template < class T, class PT, class U, class PU>
- struct assign_to< interval<T,PT>, interval<U,PU> > {
- static interval<T,PT>& apply(
- interval<T,PT>& to, const interval<U,PU>& from);
- };
- }}
+ namespace numeric {
+ template < class T, class PT, class U, class PU>
+ interval<T,PT> convert_to(interval<U,PU> const & from
+ , boost::dummy::type_tag<interval<T,PT> > const&);
+
+ template < class T, class PT, class U, class PU>
+ inline interval<T,PT>& assign_to(interval<T,PT>& to, const interval<U,PU>& from
+ , boost::dummy::type_tag<interval<T,PT> > const&);
+ }
     }
 
 [endsect]
@@ -956,18 +961,13 @@
 Include this file when using conversions between optional of convertible types.
 
     namespace boost {
- namespace conversion {
- namespace partial_specialization_workaround {
- template < class Target, class Source>
- struct convert_to< optional<Target>, optional<Source> > {
- static optional<Target> apply(optional<Source> const & from);
- };
- template < class Target, class Source>
- struct assign_to< optional<Target>, optional<Source> > {
- static optional<Target>& apply(
- optional<Target>& to, const optional<Target>& from);
- };
- }}
+ template < class Target, class Source>
+ optional<Target> convert_to(optional<Source> const & from
+ , boost::dummy::type_tag<optional<Target> > const&);
+
+ template < class Target, class Source>
+ optional<Target>& assign_to(optional<Target>& to, const optional<Source>& from
+ , boost::dummy::type_tag<optional<Target> > const&);
     }
 
 [endsect]
@@ -979,17 +979,13 @@
 Include this file when using conversions between arrays of convertible types.
 
     namespace boost {
- namespace conversion {
- namespace partial_specialization_workaround {
- template < typename T1, typename T2, std::size_t N>
- struct convert_to< array<T1,N>, array<T2,N> > {
- static array<T1,N> apply(array<T2,N> const & from);
- };
- template < typename T1, typename T2, std::size_t N>
- struct assign_to< array<T1,N>, array<T2,N> > {
- static array<T1,N>& apply(array<T1,N>& to, array<T2,N> const & from);
- };
- }}
+ template < typename T1, typename T2, std::size_t N>
+ array<T1,N> convert_to(array<T2,N> const & from
+ , boost::dummy::type_tag<array<T1,N> > const&);;
+
+ template < typename T1, typename T2, std::size_t N>
+ array<T1,N>& assign_to(array<T1,N>& to, array<T2,N> const & from
+ , boost::dummy::type_tag<array<T1,N> > const&);
     }
 
 
@@ -1002,20 +998,23 @@
 Include this file when using conversions between fusion::tuple of convertible types.
 
     namespace boost {
- namespace conversion {
- namespace partial_specialization_workaround {
- template < class T1, ..., class Tn, class U1, ..., class Un>
- struct convert_to< boost::fusion::tuple<T1,...,T3>, boost::fusion::tuple<U1,...,U3> > {
- inline static boost::fusion::tuple<T1,...,T3>
- apply(boost::fusion::tuple<U1,...,U3> const & from);
- };
- template < class T1, ..., class Tn, class U1, ..., class Un>
- struct assign_to< boost::fusion::tuple<T1,...,T3>, boost::fusion::tuple<U1,...,U3> > {
- inline static boost::fusion::tuple<T1,...,T3>
- apply(boost::fusion::tuple<T1,...,T3>& to, boost::fusion::tuple<U1,...,U3> const & from);
- };
-
- }}
+ namespace fusion {
+ template < class T1, class T2, class U1, class U2>
+ tuple<T1,T2> convert_to(tuple<U1,U2> const & from
+ , boost::dummy::type_tag<tuple<T1,T2> > const&);
+
+ template < class T1, class T2, class U1, class U2>
+ tuple<T1,T2>& assign_to(tuple<T1,T2>& to, tuple<U1,U2> const & from
+ , boost::dummy::type_tag<tuple<T1,T2> > const&);
+
+ template < class T1, class T2, class T3, class U1, class U2, class U3>
+ tuple<T1,T2,T3> convert_to(tuple<U1,U2,U3> const & from
+ , boost::dummy::type_tag<tuple<T1,T2,T3> > const&);;
+
+ template < class T1, class T2, class T3, class U1, class U2, class U3>
+ tuple<T1,T2,T3> assign_to(tuple<T1,T2,T3>& to, boost::fusion::tuple<U1,U2,U3> const & from
+ , boost::dummy::type_tag<tuple<T1,T2,T3> > const&);;
+ }
     }
 
 [endsect]
@@ -1057,6 +1056,7 @@
 
 * Added is_asignable_to metafunction.
 
+[endsect]
 
 [section [*Version 0.4.0, October 27, 2009] ['Applying the same technique that boost::swap applies making use of ADL]]
 [*New Features:]
@@ -1311,19 +1311,19 @@
 
 [heading Make a proposal to the C++ standard]
 
-C++1x has added explicit conversion operators, but they must always be defined in the Source class. The same applies to the assignment operator, it must be defined on the Target class.
+C++1x has added explicit conversion operators, but they must always be defined in the source class. The same applies to the assignment operator, it must be defined on the Target class.
 
 What it will interesting is to be able to add constructors and assignments operators to the class std::pair, so we can say that two pairs are convertible if the parameters are explicitly convertible using a convert_to function
 
     template<class U , class V>
     //requires HasConvertTo<T1, const U&> && HasConvertTo<T2, const V&>
     std::pair& operator=(const std::pair<U , V>& p) {
- return std::make_pair(convert_to<T1>(p.first), convert_to<T1>(p.second));
+ return std::make_pair(convert_to<T1>(p.first), convert_to<T2>(p.second));
     }
 
 But this is not possible. We can not add operations to a class.
 
-Another possibility could be to make an evolution to the standard, so the convertible concept takes car of extrinsic conversions. We could be able to implicitly or explicitly add extrinsic conversion operators between unrelated types. Assignment operators could also be specialized.
+Another possibility could be to make an evolution to the standard, so the convertible concept takes car of extrinsic conversions. We could be able to implicitly or explicitly add extrinsic conversion operators between unrelated types. Non-member assignment operators could also be specialized.
 
   template < typename To, typename From >
   operator To(const From& val);
@@ -1331,10 +1331,10 @@
   template < typename To, typename From >
   To& operator=(To& to, const From& from);
 
-For example we could specialize the conversion from as chrono::time_point<Clock, Duration> to posix_time::ptime follows
+For example we could define the explicit conversion from as chrono::time_point<Clock, Duration> to posix_time::ptime follows
 
     template < class Clock, class Duration>
- operator boost::posix_time::ptime(const boost::chrono::time_point<Clock, Duration>& from) {
+ explicit operator boost::posix_time::ptime(const boost::chrono::time_point<Clock, Duration>& from) {
         typedef boost::chrono::time_point<Clock, Duration> time_point_t;
         typedef boost::chrono::nanoseconds duration_t;
         typedef boost::duration_t::rep rep_t;
@@ -1346,6 +1346,13 @@
                 boost::posix_time::nanoseconds(nsec);
     }
 
+With this explicit conversion and the equivalen for duration, the actual definition of std::pair will allows to
+
+ std::pair<chrono::time_point<Clock, Duration>, boost::chrono::duration<Rep, Period> > tp_dur_pair;
+ std::pair<boost::posix_time::ptime, boost::posix_time::time_duration> ppt;
+ ppt = tp_dur_pair;
+
+
 [endsect]
 [endsect]
 

Modified: sandbox/conversion/libs/conversion/doc/html/index.html
==============================================================================
--- sandbox/conversion/libs/conversion/doc/html/index.html (original)
+++ sandbox/conversion/libs/conversion/doc/html/index.html 2010-09-23 15:35:35 EDT (Thu, 23 Sep 2010)
@@ -1,11 +1,10 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>Toward Boost.Conversion</title>
+<title>Toward Boost.Conversion 0.5.0</title>
 <link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
-<link rel="start" href="index.html" title="Toward Boost.Conversion">
-<link rel="next" href="boost/conversion/overview.html" title="Overview">
+<link rel="start" href="index.html" title="Toward Boost.Conversion 0.5.0">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -17,18 +16,18 @@
 <td align="center">More</td>
 </tr></table>
 <hr>
-<div class="spirit-nav"><a accesskey="n" href="boost/conversion/overview.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"></div>
 <div class="article" lang="en">
 <div class="titlepage">
 <div>
 <div><h2 class="title">
-<a name="boost.conversion"></a>Toward Boost.Conversion</h2></div>
+<a name="boost.conversion"></a>Toward Boost.Conversion 0.5.0</h2></div>
 <div><div class="authorgroup"><div class="author"><h3 class="author">
 <span class="firstname">Vicente J.</span> <span class="surname">Botet Escriba</span>
 </h3></div></div></div>
-<div><p class="copyright">Copyright &#169; 2009 Vicente J. Botet Escriba</p></div>
+<div><p class="copyright">Copyright &#169; 2009 -2010 Vicente J. Botet Escriba</p></div>
 <div><div class="legalnotice">
-<a name="id4762501"></a><p>
+<a name="id4987067"></a><p>
         Distributed under the Boost Software License, Version 1.0. (See accompanying
         file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       </p>
@@ -39,63 +38,3494 @@
 <div class="toc">
 <p><b>Table of Contents</b></p>
 <dl>
-<dt><span class="section">Overview</span></dt>
-<dd><dl><dt><span class="section">Motivation</span></dt></dl></dd>
-<dt><span class="section"> Users' Guide</span></dt>
+<dt><span class="section">Overview</span></dt>
+<dd><dl><dt><span class="section">Motivation</span></dt></dl></dd>
+<dt><span class="section"> Users' Guide</span></dt>
 <dd><dl>
-<dt><span class="section"><a href="boost/conversion/users_guide/getting_started.html"> Getting
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.getting_started"> Getting
       Started</a></span></dt>
-<dt><span class="section">Tutorial</span></dt>
-<dt><span class="section"> References</span></dt>
+<dt><span class="section">Tutorial</span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.ext_references"> External
+ Resources</a></span></dt>
 </dl></dd>
-<dt><span class="section">Reference</span></dt>
+<dt><span class="section">Reference</span></dt>
 <dd><dl>
-<dt><span class="section"> Header <boost/conversion.hpp></span></dt>
-<dt><span class="section">Core</span></dt>
-<dt><span class="section"><a href="boost/conversion/reference/c___standard_classes_specializations.html">C++
+<dt><span class="section"> Header <boost/conversion.hpp></span></dt>
+<dt><span class="section">Core</span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations">C++
       Standard classes specializations</a></span></dt>
-<dt><span class="section"><a href="boost/conversion/reference/boost_classes_specializations.html">Boost
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations">Boost
       classes specializations</a></span></dt>
 </dl></dd>
-<dt><span class="section">Examples</span></dt>
+<dt><span class="section">Examples</span></dt>
 <dd><dl>
-<dt><span class="section"><a href="boost/conversion/examples/chrono__time_point_and_posix_time__ptime.html">chrono::time_point
+<dt><span class="section"><a href="index.html#boost.conversion.examples.chrono__time_point_and_posix_time__ptime">chrono::time_point
       and posix_time::ptime</a></span></dt>
-<dt><span class="section">boost::optional</span></dt>
-<dt><span class="section">std::pair</span></dt>
+<dt><span class="section">boost::optional</span></dt>
+<dt><span class="section">std::pair</span></dt>
 </dl></dd>
-<dt><span class="section">Appendices</span></dt>
+<dt><span class="section">Appendices</span></dt>
 <dd><dl>
-<dt><span class="section"> Appendix A: History</span></dt>
-<dt><span class="section"> Appendix B: Rationale</span></dt>
-<dt><span class="section"><a href="boost/conversion/appendices/implementation.html"> Appendix
+<dt><span class="section"> Appendix A: History</span></dt>
+<dt><span class="section"> Appendix B: Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.implementation"> Appendix
       C: Implementation Notes</a></span></dt>
-<dt><span class="section"><a href="boost/conversion/appendices/acknowledgements.html"> Appendix
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.acknowledgements"> Appendix
       D: Acknowledgements</a></span></dt>
-<dt><span class="section"><a href="boost/conversion/appendices/appendix_e__tests.html">Appendix
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_e__tests">Appendix
       E: Tests</a></span></dt>
-<dt><span class="section"><a href="boost/conversion/appendices/appendix_f__tickets.html">Appendix
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_f__tickets">Appendix
       F: Tickets</a></span></dt>
-<dt><span class="section"><a href="boost/conversion/appendices/todo.html"> Appendix F: Future
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.todo"> Appendix F: Future
       plans</a></span></dt>
 </dl></dd>
 </dl>
 </div>
 <div class="warning"><table border="0" summary="Warning">
 <tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/html/images/warning.png"></td>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/src/images/warning.png"></td>
 <th align="left">Warning</th>
 </tr>
 <tr><td align="left" valign="top"><p>
       Conversion is not a part of the Boost libraries.
     </p></td></tr>
 </table></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost.conversion.overview"></a>Overview
+</h2></div></div></div>
+<div class="toc"><dl><dt><span class="section">Motivation</span></dt></dl></div>
+<a name="boost.conversion.overview.description"></a><h3>
+<a name="id4986977"></a>
+ Description
+ </h3>
+<p>
+ Generic explicit conversion between unrelated types.
+ </p>
+<p>
+ The template function <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ allows to convert a source type to a target type, using argument dependent
+ lookup to select a specialized <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ function if available. If no specialized <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ function is available, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">conversion</span><span class="special">::</span><span class="identifier">convert_to</span></code>
+ is used.
+ </p>
+<p>
+ The generic <code class="computeroutput"><span class="identifier">convert_to</span></code> function
+ requires that the elements to be converted are assignable and copy constructible.
+ It is implemented using the Target copy construction from a Source or the Source
+ conversion operator Target - this is sometimes unavailable.
+ </p>
+<p>
+ For standard types, we can not add a specialized <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ function on the namespace std. The alternative to using argument dependent
+ lookup in this situation is to provide a template specialization of boost::conversion::convert_to
+ for every pair of standard types that requires a specialized <code class="computeroutput"><span class="identifier">convert_to</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Boost.Conversion</strong></span> provides:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ a generic <code class="computeroutput"><span class="identifier">convert_to</span></code> function
+ which can be specialized by the user to make explicit conversion between
+ unrelated types.
+ </li>
+<li>
+ a generic <code class="computeroutput"><span class="identifier">assign_to</span></code> function
+ which can be specialized by the user to make explicit assignation between
+ unrelated types.
+ </li>
+<li>
+ a generic <code class="computeroutput"><span class="identifier">mca</span></code> function
+ returning a wrapper which replace assignments by a call to <code class="computeroutput"><span class="identifier">assign_to</span></code> and conversion operators by
+ a call <code class="computeroutput"><span class="identifier">convert_to</span></code>.
+ </li>
+<li>
+ a generic <code class="computeroutput"><span class="identifier">convert_to_via</span></code>
+ function which convert a type <code class="computeroutput"><span class="identifier">From</span></code>
+ to another <code class="computeroutput"><span class="identifier">To</span></code> using a temporary
+ one <code class="computeroutput"><span class="identifier">Via</span></code>.
+ </li>
+<li>
+ a generic <code class="computeroutput"><span class="identifier">pack</span></code> function
+ used to pack Source and target constructor arguments.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">optional</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rational</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interval</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ptime</span></code>.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">time_duration</span></code>.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between Boost.Fusion sequences of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code>
+ of explicitly convertible types.
+ </li>
+</ul></div>
+<a name="boost.conversion.overview.how_to_use_this_documentation"></a><h3>
+<a name="id4949128"></a>
+ <a href="index.html#boost.conversion.overview.how_to_use_this_documentation">How
+ to Use This Documentation</a>
+ </h3>
+<p>
+ This documentation makes use of the following naming and formatting conventions.
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Code is in <code class="computeroutput"><span class="identifier">fixed</span> <span class="identifier">width</span>
+ <span class="identifier">font</span></code> and is syntax-highlighted.
+ </li>
+<li>
+ Replaceable text that you will need to supply is in <em class="replaceable"><code>italics</code></em>.
+ </li>
+<li>
+ If a name refers to a free function, it is specified like this: <code class="computeroutput"><span class="identifier">free_function</span><span class="special">()</span></code>;
+ that is, it is in code font and its name is followed by <code class="computeroutput"><span class="special">()</span></code>
+ to indicate that it is a free function.
+ </li>
+<li>
+ If a name refers to a class template, it is specified like this: <code class="computeroutput"><span class="identifier">class_template</span><span class="special">&lt;&gt;</span></code>;
+ that is, it is in code font and its name is followed by <code class="computeroutput"><span class="special">&lt;&gt;</span></code>
+ to indicate that it is a class template.
+ </li>
+<li>
+ If a name refers to a function-like macro, it is specified like this:
+ <code class="computeroutput"><span class="identifier">MACRO</span><span class="special">()</span></code>;
+ that is, it is uppercase in code font and its name is followed by <code class="computeroutput"><span class="special">()</span></code> to indicate that it is a function-like
+ macro. Object-like macros appear without the trailing <code class="computeroutput"><span class="special">()</span></code>.
+ </li>
+<li>
+ Names that refer to <span class="emphasis"><em>concepts</em></span> in the generic programming
+ sense are specified in CamelCase.
+ </li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ In addition, notes such as this one specify non-essential information that
+ provides additional background or rationale.
+ </p></td></tr>
+</table></div>
+<p>
+ Finally, you can mentally add the following to any code fragments in this document:
+ </p>
+<pre class="programlisting"><span class="comment">// Include all of the core Conversion files
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.overview.motivation"></a>Motivation
+</h3></div></div></div>
+<p>
+ I've needed recently to convert from boost::chrono::time_point&lt;Clock,
+ Duration&gt; to boost::posix_time::ptime and from boost::chrono::duration&lt;Rep,
+ Period&gt; to boost::posix_time::time_duration. This kind of conversions
+ are needed quite often when you use code from two different libraries that
+ have implemented the same concept using of course different representations
+ and have hard coded the library interface to its own implementation. Well
+ this is a normal situation we can't avoid. Life is life.
+ </p>
+<p>
+ Quite often we need to convert unrelated types <code class="computeroutput"><span class="identifier">Source</span></code>
+ and <code class="computeroutput"><span class="identifier">Target</span></code>. As these classes
+ are unrelated, neither of them offers conversion operators to the other.
+ Usually we get it by defining a specific function such as
+ </p>
+<pre class="programlisting"><span class="identifier">Target</span> <span class="identifier">ConvertToTarget</span><span class="special">(</span><span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">);</span>
+</pre>
+<p>
+ In my case I started by defining
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">&gt;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="identifier">convert_to_posix_time_time_duration</span><span class="special">(</span>
+ <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+<span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span> <span class="identifier">convert_to_posix_time_ptime</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+</pre>
+<p>
+ Imagine now that you need to convert a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">,</span> <span class="identifier">Source</span><span class="special">&gt;</span></code> to a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span> <span class="identifier">Target</span><span class="special">&gt;</span></code>. The standard defines conversions of
+ pairs if the related types are C++ convertible:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">pair</span> <span class="special">{</span>
+ <span class="special">...</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">U</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
+ <span class="comment">//requires Constructible&lt;T1, const U&amp;&gt; &amp;&amp; Constructible&lt;T2, const V&amp;&gt;
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;&amp;</span> <span class="identifier">p</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">U</span> <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
+ <span class="comment">//requires HasAssign&lt;T1, const U&amp;&gt; &amp;&amp; HasAssign&lt;T2, const V&amp;&gt;
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U</span> <span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;&amp;</span> <span class="identifier">p</span><span class="special">);</span>
+ <span class="special">...</span>
+<span class="special">};</span>
+</pre>
+<p>
+ But as the types <code class="computeroutput"><span class="identifier">Target</span></code> and
+ <code class="computeroutput"><span class="identifier">Source</span></code> are not C++ convertible
+ other than using a specific function.
+ </p>
+<p>
+ Well we can again define a specific function
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="identifier">ConvertToPairOfTarget</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">,</span><span class="identifier">Source</span><span class="special">&gt;&amp;</span> <span class="identifier">v</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">ConvertToTarget</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">fisrt</span><span class="special">),</span> <span class="identifier">ConvertToTarget</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+<p>
+ While the <code class="computeroutput"><span class="identifier">ConvertToTarget</span></code>
+ could be specific, the <code class="computeroutput"><span class="identifier">ConvertToPairOfTarget</span></code>
+ should be generic
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Target2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source2</span><span class="special">)</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target1</span><span class="special">,</span><span class="identifier">Target2</span><span class="special">&gt;</span> <span class="identifier">ConvertToPair</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source1</span><span class="special">,</span><span class="identifier">Source2</span><span class="special">&gt;&amp;</span> <span class="identifier">v</span><span class="special">);</span>
+</pre>
+<p>
+ In order to do that we need that the pair template parameters define a common
+ function, let it call <code class="computeroutput"><span class="identifier">convert_to</span></code>,
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span><span class="special">)</span>
+<span class="identifier">Target</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">);</span>
+</pre>
+<p>
+ so <code class="computeroutput"><span class="identifier">ConvertToPair</span></code> can be defined
+ as
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Target2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source2</span><span class="special">)</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target1</span><span class="special">,</span><span class="identifier">Target2</span><span class="special">&gt;</span> <span class="identifier">ConvertToPair</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source1</span><span class="special">,</span><span class="identifier">Source2</span><span class="special">&gt;&amp;</span> <span class="identifier">v</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target1</span><span class="special">&gt;(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">fisrt</span><span class="special">),</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target2</span><span class="special">&gt;(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+<p>
+ We need to specialize the <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ function for the specific classes <code class="computeroutput"><span class="identifier">Source</span></code>
+ and <code class="computeroutput"><span class="identifier">Target</span></code>. We can do it
+ as follows
+ </p>
+<pre class="programlisting"><span class="identifier">Target</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">ConvertToTarget</span><span class="special">(</span><span class="identifier">v</span><span class="special">);}</span>
+</pre>
+<p>
+ In my case I needed
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">&gt;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">convert_to_posix_time_time_duration</span><span class="special">(</span><span class="identifier">from</span><span class="special">);</span>
+<span class="special">}</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">convert_to_posix_time_ptime</span><span class="special">(</span><span class="identifier">from</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ So now I can convert
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="special">&gt;</span>
+</pre>
+<p>
+ to
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span><span class="special">&gt;</span>
+</pre>
+<p>
+ using the <code class="computeroutput"><span class="identifier">ConvertToPair</span></code> function.
+ </p>
+<p>
+ What about converting <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">,</span><span class="identifier">Source</span><span class="special">&gt;</span> <span class="special">&gt;</span></code> to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span><span
class="identifier">Target</span><span class="special">&gt;</span> <span class="special">&gt;</span></code>? The issue now is that <code class="computeroutput"><span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">&lt;</span><span class="identifier">to</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">&lt;</span><span class="identifier">to</span><span class="special">,</span><span class="identifier">to</span><span class="special">&gt;</span> <span class="special">&gt;)</span></code>
+ do not compiles because the conversion of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>
+ is named <code class="computeroutput"><span class="identifier">ConvertToPair</span></code>. So
+ we need to specialize the function <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ for pairs.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">S1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">S2</span><span class="special">)</span>
+<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source1</span><span class="special">,</span><span class="identifier">Source2</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span> <span class="special">{</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">first</span><span class="special">),</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">second</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+<p>
+ There is still a last point. The preceding design works well with unrelated
+ classes, but what about classes that already define some kind of conversion,
+ using a constructor or a conversion operator. Do we need to make specialization
+ for these conversion? The answer is no. We need just to define the default
+ implementation of convert_to function to just return the explicit conversion.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+<span class="identifier">Target</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">Target</span><span class="special">(</span><span class="identifier">from</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ What have we learned? Classes or algorithms relying on a conversion by copy-construction
+ or by the conversion operator can be made more generic by relaying in a function
+ that explicitly states this conversion. Thus, instead of requiring
+ </p>
+<pre class="programlisting"><span class="identifier">Target</span><span class="special">(</span><span class="identifier">from</span><span class="special">)</span>
+</pre>
+<p>
+ requires
+ </p>
+<pre class="programlisting"><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">)</span>
+</pre>
+<p>
+ The same applies to classes or algorithms relying on the assignment operator.
+ So instead of requiring
+ </p>
+<pre class="programlisting"><span class="identifier">to</span> <span class="special">=</span> <span class="identifier">from</span>
+</pre>
+<p>
+ requires
+ </p>
+<pre class="programlisting"><span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">to</span><span class="special">,</span> <span class="identifier">from</span><span class="special">);</span>
+</pre>
+<p>
+ The default implementation of <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ relies on the assignment operator
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span> <span class="special">&gt;</span>
+<span class="identifier">To</span><span class="special">&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">Target</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">from</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ For classes that are explicitly convertible and having a self assignment
+ operator it is easy to make a specialization of <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ as follows.
+ </p>
+<pre class="programlisting"><span class="identifier">to</span> <span class="special">=</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">);</span>
+</pre>
+<p>
+ The rationale is that if there was not a copy constructor from a Source seems
+ reasonable to think that there will not be an assignment operator. So in
+ most of the cases, once we have specialized the convert_to function we recover
+ a reasonable implementation for the <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ function.
+ </p>
+<p>
+ When doing multiple assignments we use to do
+ </p>
+<pre class="programlisting"><span class="identifier">a</span> <span class="special">=</span> <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">c</span><span class="special">;</span>
+</pre>
+<p>
+ With <code class="computeroutput"><span class="identifier">assign_to</span></code> we could do
+ </p>
+<pre class="programlisting"><span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">a</span><span class="special">,</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span> <span class="identifier">c</span><span class="special">));</span>
+</pre>
+<p>
+ and if we find this not really readable we can try with
+ </p>
+<pre class="programlisting"><span class="identifier">mca</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">mca</span><span class="special">(</span><span class="identifier">b</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">c</span><span class="special">;</span>
+</pre>
+<p>
+ The behavior of mca recall the tie function of Boost.Tuple, but instead of
+ allowing multiple assignations, allows a single assign_to call.
+ </p>
+<p>
+ We can even generalize this, so classes or algorithms relying on a member
+ function can be made more generic by relaying on a function. The default
+ function implementation could just to call to the member function with the
+ equivalent prototype, but this is out of the scope of this library.
+ </p>
+<p>
+ So one of the advantages of using this common functions is uniformity. The
+ other is that now we are able to find all the explicit conversions to one
+ type, as we can do with explicit casts.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost.conversion.users_guide"></a> Users' Guide
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.getting_started"> Getting
+ Started</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.getting_started.install">
+ Installing Conversion</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.getting_started.hello_world__">Hello
+ World! </a></span></dt>
+</dl></dd>
+<dt><span class="section">Tutorial</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.using_generic_conversions">Using
+ generic conversions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.using_specific_conversions">Using
+ specific conversions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.how_to_specialize_the_conversion_functions">How
+ to specialize the conversion functions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.how_to_partially_specialize_the_conversion_functions_for_standadr_types_">How
+ to partially specialize the conversion functions for standadr types?</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.how_to_convert_to_types_needing_some_constructors_arguments_">How
+ to convert to types needing some constructors arguments?</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.ext_references"> External
+ Resources</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.users_guide.getting_started"></a><a href="index.html#boost.conversion.users_guide.getting_started" title=" Getting
+ Started"> Getting
+ Started</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.getting_started.install">
+ Installing Conversion</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.getting_started.hello_world__">Hello
+ World! </a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.users_guide.getting_started.install"></a><a href="index.html#boost.conversion.users_guide.getting_started.install" title="
+ Installing Conversion">
+ Installing Conversion</a>
+</h4></div></div></div>
+<a name="boost.conversion.users_guide.getting_started.install.getting_boost_conversion"></a><h5>
+<a name="id4998214"></a>
+ <a href="index.html#boost.conversion.users_guide.getting_started.install.getting_boost_conversion">Getting
+ Boost.Conversion</a>
+ </h5>
+<p>
+ You can get the last stable release of Boost.Conversion by downloading
+ <code class="literal">conversion.zip</code> from the <a href="http://www.boostpro.com/vault/index.php?action=downloadfile&amp;filename=conversion.zip&amp;directory=Utilities&amp;" target="_top">Boost
+ Vault Utilities directory</a>
+ </p>
+<p>
+ You can also access the latest (unstable?) state from the <a href="https://svn.boost.org/svn/boost/sandbox/conversion" target="_top">Boost
+ Sandbox</a>.
+ </p>
+<a name="boost.conversion.users_guide.getting_started.install.building_boost_conversion"></a><h5>
+<a name="id4998265"></a>
+ <a href="index.html#boost.conversion.users_guide.getting_started.install.building_boost_conversion">Building
+ Boost.Conversion</a>
+ </h5>
+<p>
+ There is no need to compile <span class="bold"><strong>Boost.Conversion</strong></span>,
+ since it's a header only library. Just include your Boost header directory
+ in your compiler include path.
+ </p>
+<a name="boost.conversion.users_guide.getting_started.install.requirements"></a><h5>
+<a name="id4998297"></a>
+ Requirements
+ </h5>
+<p>
+ The genric part of <span class="bold"><strong>Boost.Conversion</strong></span> depends
+ only on Boost.Config. Of course it depends on the specific libraries when
+ specific conversion are used.
+ </p>
+<a name="boost.conversion.users_guide.getting_started.install.exceptions_safety"></a><h5>
+<a name="id4998329"></a>
+ <a href="index.html#boost.conversion.users_guide.getting_started.install.exceptions_safety">Exceptions
+ safety</a>
+ </h5>
+<p>
+ All functions in the library are exception-neutral and provide strong guarantee
+ of exception safety as long as the underlying parameters provide it.
+ </p>
+<a name="boost.conversion.users_guide.getting_started.install.thread_safety"></a><h5>
+<a name="id4998355"></a>
+ <a href="index.html#boost.conversion.users_guide.getting_started.install.thread_safety">Thread
+ safety</a>
+ </h5>
+<p>
+ All functions in the library are thread-unsafe except when noted explicitly.
+ </p>
+<a name="boost.conversion.users_guide.getting_started.install.tested_compilers"></a><h5>
+<a name="id4998380"></a>
+ <a href="index.html#boost.conversion.users_guide.getting_started.install.tested_compilers">Tested
+ compilers</a>
+ </h5>
+<p>
+ Currently, <span class="bold"><strong>Boost.Conversion</strong></span> has been tested
+ in the following compilers/platforms:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ GCC 3.4.4 Cygwin
+ </li>
+<li>
+ GCC 3.4.6 Linux
+ </li>
+<li>
+ GCC 4.1.2 Linux
+ </li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Please send any questions, comments and bug reports to boost &lt;at&gt;
+ lists &lt;dot&gt; boost &lt;dot&gt; org.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.users_guide.getting_started.hello_world__"></a><a href="index.html#boost.conversion.users_guide.getting_started.hello_world__" title="Hello
+ World! ">Hello
+ World! </a>
+</h4></div></div></div></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.users_guide.tutorial"></a>Tutorial
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.using_generic_conversions">Using
+ generic conversions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.using_specific_conversions">Using
+ specific conversions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.how_to_specialize_the_conversion_functions">How
+ to specialize the conversion functions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.how_to_partially_specialize_the_conversion_functions_for_standadr_types_">How
+ to partially specialize the conversion functions for standadr types?</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.users_guide.tutorial.how_to_convert_to_types_needing_some_constructors_arguments_">How
+ to convert to types needing some constructors arguments?</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.users_guide.tutorial.using_generic_conversions"></a><a href="index.html#boost.conversion.users_guide.tutorial.using_generic_conversions" title="Using
+ generic conversions">Using
+ generic conversions</a>
+</h4></div></div></div>
+<p>
+ When you need to make a generic explicit conversion or assignation you
+ just need to include the file <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span></code>
+ or <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span></code> and just use the boost conversion
+ function.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="comment">// ...
+</span>
+<span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="number">3.5</span><span class="special">);</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.users_guide.tutorial.using_specific_conversions"></a><a href="index.html#boost.conversion.users_guide.tutorial.using_specific_conversions" title="Using
+ specific conversions">Using
+ specific conversions</a>
+</h4></div></div></div>
+<p>
+ When you need to make a specific conversion you will need to include the
+ specific conversion file. E.g.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">pair</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">pint</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="number">1</span><span class="special">);</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">pdouble</span><span class="special">=</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="special">&gt;(</span><span class="identifier">pint</span><span class="special">);</span>
+</pre>
+<p>
+ Do not forget to include this files when you use a generic class or algorithm
+ using the generic <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ or <code class="computeroutput"><span class="identifier">assign_to</span></code>, otherwise
+ your program should not compile. E.g. if you want to convert a pair of
+ <code class="computeroutput"><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;&gt;</span></code>
+ to a pair of <code class="computeroutput"><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span></code>
+ do not forget to include in addition to the <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">pair</span><span class="special">.</span><span class="identifier">hpp</span></code>
+ the file <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono_posix_time</span><span class="special">.</span><span class="identifier">hpp</span></code>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.users_guide.tutorial.how_to_specialize_the_conversion_functions"></a><a href="index.html#boost.conversion.users_guide.tutorial.how_to_specialize_the_conversion_functions" title="How
+ to specialize the conversion functions">How
+ to specialize the conversion functions</a>
+</h4></div></div></div>
+<p>
+ You can add an overload of <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ and <code class="computeroutput"><span class="identifier">assign_to</span></code> functions
+ as you will do for the swap function for example, but we have to use a
+ trick to allow ADL and avoid infinite recursion and ambiguity. This trick
+ consists in adding a unused parameter representing the target type. E.g.
+ if you want to add an explicit conversion from a type <code class="computeroutput"><span class="identifier">A</span></code>
+ to a type <code class="computeroutput"><span class="identifier">B</span></code> do the following:
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">my_own_namespace</span> <span class="special">{</span>
+ <span class="identifier">B</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">A</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.users_guide.tutorial.how_to_partially_specialize_the_conversion_functions_for_standadr_types_"></a><a href="index.html#boost.conversion.users_guide.tutorial.how_to_partially_specialize_the_conversion_functions_for_standadr_types_" title="How
+ to partially specialize the conversion functions for standadr types?">How
+ to partially specialize the conversion functions for standadr types?</a>
+</h4></div></div></div>
+<p>
+ As it has been explained in the introduction, we can not use ADL for standard
+ types, as we can not add new functions on the standad std namespace. For
+ these types we need to specialize the boost::conversion::convert_to function.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span> <span class="special">&gt;</span>
+<span class="identifier">Target</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;)</span>
+</pre>
+<p>
+ With compilers supporting partial specialization of function templates
+ there is no major problem. For the others, we need to use a trick; as it
+ allows partial specialization of classes we can define <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ by as relying to a specific function of a class, as follows:
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span> <span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">Target</span> <span class="identifier">apply</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span> <span class="special">&gt;</span>
+ <span class="identifier">Target</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;=</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;())</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">partial_specialization_workaround</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span><span class="identifier">Source</span><span class="special">&gt;::</span><span class="identifier">apply</span><span class="special">(</span><span class="identifier">val</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">}}</span>
+</pre>
+<p>
+ So now we can specialize <code class="computeroutput"><span class="identifier">partial_specialization_workaround</span><span class="special">::</span><span class="identifier">convert_to</span></code>
+ for pairs as follows:
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Target2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source2</span><span class="special">)</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target1</span><span class="special">,</span><span class="identifier">Target2</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source1</span><span class="special">,</span><span class="identifier">Source2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Target1</span><span class="special">,</span><span class="identifier">Target2</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Source1</span><span class="special">,</span><span class="identifier">Source2</span><span class="special">&gt;&amp;</span> <span class="identifier">v</span><span class="special">)</span> <span class="special">{</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">first</span><span class="special">),</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">second</span><span class="special">));</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+
+<span class="special">}</span>
+</pre>
+<p>
+ The same applies to the generic <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ function.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span> <span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">To</span><span class="special">&amp;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">Target</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">from</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+<span class="special">}</span>
+<span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span> <span class="special">&gt;</span>
+<span class="identifier">To</span><span class="special">&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">Target</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">partial_specialization_workaround</span><span class="special">::</span><span class="identifier">assign_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span><span class="identifier">Source</span><span class="special">&gt;::</span><span class="identifier">apply</span><span class="special">(</span><span class="identifier">to</span><span class="special">,</span> <span class="identifier">from</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.users_guide.tutorial.how_to_convert_to_types_needing_some_constructors_arguments_"></a><a href="index.html#boost.conversion.users_guide.tutorial.how_to_convert_to_types_needing_some_constructors_arguments_" title="How
+ to convert to types needing some constructors arguments?">How
+ to convert to types needing some constructors arguments?</a>
+</h4></div></div></div>
+<p>
+ Sometimes we need the conversion construct the resulting type with some
+ arguments. This could be the case for example of std::vector, for which
+ we need to pass an allocator to the constructor. In order to maintain the
+ same signature, the library provides a <code class="computeroutput"><span class="identifier">pack</span></code>
+ function that will wrap the Source and the Target constructor parameters
+ in a single parameter. So the overloading must be done on the result of
+ this <code class="computeroutput"><span class="identifier">pack</span></code> function.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.users_guide.ext_references"></a><a href="index.html#boost.conversion.users_guide.ext_references" title=" External
+ Resources"> External
+ Resources</a>
+</h3></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Boost.Convert</span></dt>
+<dd><p>
+ Vladimir Batov. Not yet scheduled
+ </p></dd>
+<dt><span class="term">Boost.Conversion.LexicalCast</span></dt>
+<dd><p>
+ general literal text conversions, such as an int represented as a string,
+ or vice-versa from Kevlin Henney
+ </p></dd>
+<dt><span class="term">Boost.NumericConversion</span></dt>
+<dd><p>
+ Optimized Policy-based Numeric Conversions from Fernando Cacciola.
+ </p></dd>
+<dt><span class="term"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2380.pdf" target="_top"><span class="bold"><strong>N2380 - Explicit Conversion Operator Draft Working Paper (revision
+ 2)</strong></span></a></span></dt>
+<dd><p>
+ Lois Goldthwaite, Michael Wong, Jens Mauer, Alisdair Meredith.
+ </p></dd>
+<dt><span class="term">N2200 - Operator Overloading</span></dt>
+<dd><p>
+ Gary Powell, Doug Gregor, Jaakko Jarvi.
+ </p></dd>
+<dt><span class="term">N1671 - Overloading operator.() & operator.*()</span></dt>
+<dd><p>
+ Gary Powell, Doug Gregor, Jaakko Jarvi.
+ </p></dd>
+<dt><span class="term">N1676 - Non-member overloaded copy assignment operator</span></dt>
+<dd><p>
+ Bronek Kozicki.
+ </p></dd>
+<dt><span class="term">N1694 - A Proposal to Extend the Function Call Operator</span></dt>
+<dd><p>
+ Bronek Kozicki.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost.conversion.reference"></a>Reference
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Header <boost/conversion.hpp></span></dt>
+<dt><span class="section">Core</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.assign_to_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_via_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to_via</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">ca_wrapper</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.pack_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">pack</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations">C++
+ Standard classes specializations</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.complex_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">complex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.pair_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">pair</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.vector_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">vector</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.string_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">string</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations">Boost
+ classes specializations</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.rational_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">rational</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.chrono_posix_time_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono_posix_time</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.interval_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interval</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.optional_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">optional</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.array_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">array</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.tuple_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tuple</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.reference.conversion_hpp"></a> Header <boost/conversion.hpp>
+</h3></div></div></div>
+<p>
+ Include all the core conversion public header files. Note that you will need
+ to include explicitly the C++ standard or Boost specific files when using
+ specific classes.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to_via</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">ca_wrapper</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">pack</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.reference.core"></a>Core
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_hpp.function__convert_to___">Function
+ <code class="computeroutput"><span class="identifier">convert_to</span><span class="special">()</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.assign_to_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.assign_to_hpp.function__assign_to___">Function
+ <code class="computeroutput"><span class="identifier">assign_to</span><span class="special">()</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_via_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to_via</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_via_hpp.function__convert_to_via_____">Function
+ <code class="computeroutput"><span class="identifier">convert_to_via</span><span class="special">&lt;&gt;()</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">ca_wrapper</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____">Function
+ <code class="computeroutput"><span class="identifier">mca</span><span class="special">&lt;&gt;()</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.pack_hpp"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">pack</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.pack_hpp.function__pack_____">Function
+ <code class="computeroutput"><span class="identifier">pack</span><span class="special">&lt;&gt;()</span></code></a></span></dt></dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.core.convert_to_hpp"></a><a href="index.html#boost.conversion.reference.core.convert_to_hpp" title=" Header
+ &lt;boost/conversion/convert_to.hpp&gt;"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_hpp.function__convert_to___">Function
+ <code class="computeroutput"><span class="identifier">convert_to</span><span class="special">()</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">dummy</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">base_tag</span> <span class="special">{};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">type_tag</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{};</span>
+ <span class="special">}</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">type_tag</span><span class="special">;</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">To</span> <span class="identifier">apply</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+ <span class="identifier">To</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="identifier">Target</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">Source</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;=</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;());</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Defines a free function <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ which converts the <code class="computeroutput"><span class="identifier">from</span></code>
+ parameter to a <code class="computeroutput"><span class="identifier">To</span></code> type.
+ The default implementation applies the conversion <code class="computeroutput"><span class="identifier">To</span></code>
+ operator of the <code class="computeroutput"><span class="identifier">From</span></code> class
+ or the copy constructor of the <code class="computeroutput"><span class="identifier">To</span></code>
+ class. Of course if both exist the conversion is ambiguous. A user adapting
+ another type could need to specialize the <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ free function if the default behavior is not satisfactory.
+ </p>
+<p>
+ The user can add the <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ overloading on the namespace of a specific Source. But sometimes as it
+ is the case for the standard classes, we can not add new functions on the
+ std namespace, so we need a different technique.
+ </p>
+<p>
+ The technique is partially specialize on the function <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ on the boost::conversion namespace. For compilers for which we can not
+ partially specialize a function a trick is used: instead of calling directly
+ to the <code class="computeroutput"><span class="identifier">convert_to</span></code> member
+ function, <code class="computeroutput"><span class="identifier">convert_to</span></code> calls
+ to the static operation <code class="computeroutput"><span class="identifier">apply</span></code>
+ on a class with the same name in the namespace __partial_specialization<span class="underline">workaround</span>_. Thus the user can specialize partially
+ this class.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost.conversion.reference.core.convert_to_hpp.function__convert_to___"></a><a href="index.html#boost.conversion.reference.core.convert_to_hpp.function__convert_to___" title="Function
+ convert_to()">Function
+ <code class="computeroutput"><span class="identifier">convert_to</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+<span class="identifier">To</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Converts the from parameter to an instance of the To type, using
+ by default the conversion operator or copy constructor.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Whatever the underlying conversion <code class="computeroutput"><span class="identifier">To</span></code>
+ operator of the <code class="computeroutput"><span class="identifier">From</span></code>
+ class or the copy constructor of the <code class="computeroutput"><span class="identifier">To</span></code>
+ class throws.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.core.assign_to_hpp"></a><a href="index.html#boost.conversion.reference.core.assign_to_hpp" title=" Header
+ &lt;boost/conversion/assign_to.hpp&gt;"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.assign_to_hpp.function__assign_to___">Function
+ <code class="computeroutput"><span class="identifier">assign_to</span><span class="special">()</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">To</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span> <span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">[</span><span class="identifier">N</span><span class="special">],</span><span class="identifier">From</span><span class="special">[</span><span class="identifier">N</span><span class="special">]&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">To</span> <span class="special">(&amp;</span><span class="identifier">to</span><span class="special">)[</span><span class="identifier">N</span><span class="special">],</span> <span class="keyword">const</span> <span class="identifier">From</span><span class="special">(&amp;</span> <span class="identifier">from</span><span class="special">)[</span><span class="identifier">N</span><span class="special">]);</span>
+ <span class="special">};</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">To</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="identifier">Target</span><span class="special">&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">Target</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Source</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;=</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;())</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">::</span><span class="identifier">boost_conversion_impl</span><span class="special">::</span><span class="identifier">assign_to_impl</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span> <span class="identifier">Source</span><span class="special">&gt;(</span><span class="identifier">to</span><span class="special">,</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Defines a free function <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ which assigns the <code class="computeroutput"><span class="identifier">from</span></code>
+ parameter to the <code class="computeroutput"><span class="identifier">to</span></code> parameter.
+ The default implementation applies the the assignment operator of the
+ <code class="computeroutput"><span class="identifier">To</span></code> class. A user adapting
+ another type could need to specialize the <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ free function if the default behavior is not satisfactory.
+ </p>
+<p>
+ The user can add the <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ overloading on the namespace of the Source or Target classes. But sometimes
+ as it is the case for the standard classes, we can not add new functions
+ on the std namespace, so we need a different technique.
+ </p>
+<p>
+ The technique is partially specialize on the function <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ on the boost::conversion namespace. For compilers for which we can not
+ partially specialize a function a trick is used: instead of calling directly
+ to the <code class="computeroutput"><span class="identifier">assign_to</span></code> member
+ function, <code class="computeroutput"><span class="identifier">assign_to</span></code> calls
+ to the static operation apply on a class with the same name in the namespace
+ __partial_specialization<span class="underline">workaround</span>_.
+ This the user can specialize partially this class.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost.conversion.reference.core.assign_to_hpp.function__assign_to___"></a><a href="index.html#boost.conversion.reference.core.assign_to_hpp.function__assign_to___" title="Function
+ assign_to()">Function
+ <code class="computeroutput"><span class="identifier">assign_to</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">To</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Assigns the <code class="computeroutput"><span class="identifier">from</span></code>
+ parameter to the <code class="computeroutput"><span class="identifier">to</span></code>
+ parameter, using by default the assignment operator of the <code class="computeroutput"><span class="identifier">To</span></code> class.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Whatever the underlying the assignment operator of the <code class="computeroutput"><span class="identifier">To</span></code> class throws.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.core.convert_to_via_hpp"></a><a href="index.html#boost.conversion.reference.core.convert_to_via_hpp" title="
+ Header &lt;boost/conversion/convert_to_via.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to_via</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.convert_to_via_hpp.function__convert_to_via_____">Function
+ <code class="computeroutput"><span class="identifier">convert_to_via</span><span class="special">&lt;&gt;()</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Via</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+ <span class="identifier">To</span> <span class="identifier">convert_to_via</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;(</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Via</span><span class="special">&gt;(</span><span class="identifier">val</span><span class="special">));</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost.conversion.reference.core.convert_to_via_hpp.function__convert_to_via_____"></a><a href="index.html#boost.conversion.reference.core.convert_to_via_hpp.function__convert_to_via_____" title="Function
+ convert_to_via&lt;&gt;()">Function
+ <code class="computeroutput"><span class="identifier">convert_to_via</span><span class="special">&lt;&gt;()</span></code></a>
+</h5></div></div></div>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Converts the from parameter to an instance of the To type using
+ a intermediary Via type.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Whatever the underlying conversions functions throw.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.core.ca_wrapper_hpp"></a><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp" title=" Header
+ &lt;boost/conversion/ca_wrapper.hpp&gt;"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">ca_wrapper</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____">Function
+ <code class="computeroutput"><span class="identifier">mca</span><span class="special">&lt;&gt;()</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="char">'implementation_dependent&lt;T&gt;'</span> <span class="identifier">mca</span><span class="special">(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">r</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____"></a><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____" title="Function
+ mca&lt;&gt;()">Function
+ <code class="computeroutput"><span class="identifier">mca</span><span class="special">&lt;&gt;()</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_">Template
+ Class <code class="computeroutput"><span class="identifier">implementation_dependent</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="char">'implementation_dependent&lt;T&gt;'</span> <span class="identifier">mca</span><span class="special">(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">r</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns a implementation dependent class able to transform conversion
+ by convert_to call and assignments by assign_to calls.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_"></a><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_" title="Template
+ Class implementation_dependent">Template
+ Class <code class="computeroutput"><span class="identifier">implementation_dependent</span></code></a>
+</h6></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Constructor</span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_.conversion_operator">Conversion
+ operator</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_.assignment_operator">Assignment
+ operator</a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">implementation_dependent</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">implementation_dependent</span><span class="special">(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">r</span><span class="special">);</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">operator</span> <span class="identifier">U</span><span class="special">();</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">=(</span><span class="identifier">U</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">u</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_.constructor"></a>Constructor
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">implementation_dependent</span><span class="special">(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">r</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Stores the reference to type.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_.conversion_operator"></a><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_.conversion_operator" title="Conversion
+ operator">Conversion
+ operator</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">operator</span> <span class="identifier">U</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call to the <code class="computeroutput"><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span></code> on the stored reference.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Whatever <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ throws.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_.assignment_operator"></a><a href="index.html#boost.conversion.reference.core.ca_wrapper_hpp.function__mca_____.template_class__implementation_dependent_.assignment_operator" title="Assignment
+ operator">Assignment
+ operator</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">=(</span><span class="identifier">U</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">u</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Call to the <code class="computeroutput"><span class="identifier">assign_to</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">U</span><span class="special">&gt;</span></code> with the stored reference
+ and the passed parameter <code class="computeroutput"><span class="identifier">u</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Whatever <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ throws.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.core.pack_hpp"></a><a href="index.html#boost.conversion.reference.core.pack_hpp" title=" Header
+ &lt;boost/conversion/pack.hpp&gt;"> Header
+ <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">pack</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="index.html#boost.conversion.reference.core.pack_hpp.function__pack_____">Function
+ <code class="computeroutput"><span class="identifier">pack</span><span class="special">&lt;&gt;()</span></code></a></span></dt></dl></div>
+<p>
+ The result of the <code class="computeroutput"><span class="identifier">pack</span></code>
+ function is equivalent to a fusion sequence containing reference_warpper's
+ instead of C++ reference (&amp;) as this are not allowed.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">result_of</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">pack</span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">fusion</span><span class="special">::</span><span class="identifier">sequence</span><span class="special">&lt;</span>
+ <span class="identifier">reference_wrapper</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">&gt;,</span> <span class="identifier">reference_wrapper</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span> <span class="special">...&gt;</span>
+ <span class="special">&gt;</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
+ <span class="special">}</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...&gt;</span>
+ <span class="keyword">typename</span> <span class="identifier">result_of_pack</span><span class="special">&lt;</span><span class="identifier">T1</span> <span class="keyword">const</span><span class="special">,</span> <span class="identifier">T2</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">pack</span><span class="special">(</span>
+ <span class="identifier">T1</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...&gt;</span>
+ <span class="keyword">typename</span> <span class="identifier">result_of_pack</span><span class="special">&lt;</span><span class="identifier">T1</span> <span class="keyword">const</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...&gt;::</span><span class="identifier">type</span> <span class="identifier">pack</span><span class="special">(</span><span class="identifier">T1</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="special">...);</span>
+
+ <span class="special">...</span>
+
+<span class="special">}</span> <span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost.conversion.reference.core.pack_hpp.function__pack_____"></a><a href="index.html#boost.conversion.reference.core.pack_hpp.function__pack_____" title="Function
+ pack&lt;&gt;()">Function
+ <code class="computeroutput"><span class="identifier">pack</span><span class="special">&lt;&gt;()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">result_of_pack</span><span class="special">&lt;</span><span class="identifier">T1</span> <span class="keyword">const</span><span class="special">,</span> <span class="identifier">T2</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">pack</span><span class="special">(</span>
+ <span class="identifier">T1</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">);</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">result_of_pack</span><span class="special">&lt;</span><span class="identifier">T1</span> <span class="keyword">const</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">pack</span><span class="special">(</span>
+ <span class="identifier">T1</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns a packed type from the template parameters.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.reference.c___standard_classes_specializations"></a><a href="index.html#boost.conversion.reference.c___standard_classes_specializations" title="C++
+ Standard classes specializations">C++
+ Standard classes specializations</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.complex_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">complex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.pair_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">pair</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.vector_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">vector</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.string_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">string</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.c___standard_classes_specializations.complex_hpp"></a><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.complex_hpp" title="
+ Header &lt;boost/conversion/std/complex.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">complex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between complex of convertible
+ types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&amp;</span> <span class="identifier">apply</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">);</span>
+ <span class="special">};</span>
+
+ <span class="special">}}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.c___standard_classes_specializations.pair_hpp"></a><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.pair_hpp" title="
+ Header &lt;boost/conversion/std/pair.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">pair</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between pairs of convertible types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;&amp;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;&amp
;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="special">}}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.c___standard_classes_specializations.vector_hpp"></a><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.vector_hpp" title="
+ Header &lt;boost/conversion/std/vector.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">vector</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between std::vector of convertible
+ types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A2</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">A1</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">A2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">A1</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">A2</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A2</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">A1</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">A2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">A1</span><span class="special">&gt;&amp;</span> <span class="identifier">apply</span><span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">A1</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">A2</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A2</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">A1</span><span class="special">&gt;,</span>
+ <span class="keyword">typename</span> <span class="identifier">result_of_pack</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">A2</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">,</span> <span class="identifier">A1</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span>
+ <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">A1</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span>
+ <span class="keyword">typename</span> <span class="identifier">result_of_pack</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">A2</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">,</span> <span class="identifier">A1</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">pack</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="special">}}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.c___standard_classes_specializations.string_hpp"></a><a href="index.html#boost.conversion.reference.c___standard_classes_specializations.string_hpp" title="
+ Header &lt;boost/conversion/std/string.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">std</span><span class="special">/</span><span class="identifier">string</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions to std::string.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Alloc</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;,</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">}</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Alloc</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;,</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;&amp;</span> <span class="identifier">apply</span><span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Alloc</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">T</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Alloc</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">to</span>
+ <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+ <span class="special">};</span>
+ <span class="special">}}</span>
+<span class="special">}</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.reference.boost_classes_specializations"></a><a href="index.html#boost.conversion.reference.boost_classes_specializations" title="Boost
+ classes specializations">Boost
+ classes specializations</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.rational_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">rational</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.chrono_posix_time_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono_posix_time</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.interval_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interval</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.optional_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">optional</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.array_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">array</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.reference.boost_classes_specializations.tuple_hpp">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tuple</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.boost_classes_specializations.rational_hpp"></a><a href="index.html#boost.conversion.reference.boost_classes_specializations.rational_hpp" title="
+ Header &lt;boost/conversion/boost/rational.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">rational</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between rational of convertible
+ types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">&gt;</span>
+ <span class="identifier">rational</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">rational</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">rational</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">&gt;</span>
+ <span class="identifier">rational</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">rational</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">rational</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">rational</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.boost_classes_specializations.chrono_posix_time_hpp"></a><a href="index.html#boost.conversion.reference.boost_classes_specializations.chrono_posix_time_hpp" title="
+ Header &lt;boost/conversion/boost/chrono_posix_time.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono_posix_time</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between chrono and posix_time
+ time and duration types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);;</span>
+
+<span class="special">}</span>
+<span class="keyword">namespace</span> <span class="identifier">posix_time</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+
+<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span><span class="special">&amp;</span> <span class="identifier">fro
m</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+
+<span class="keyword">namespace</span> <span class="identifier">posix_time</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">time_duration</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">time_duration</span><span class="special">&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">time_duration</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.boost_classes_specializations.interval_hpp"></a><a href="index.html#boost.conversion.reference.boost_classes_specializations.interval_hpp" title="
+ Header &lt;boost/conversion/boost/interval.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">interval</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between intervals of convertible
+ types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">numeric</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">PT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">PU</span><span class="special">&gt;</span>
+ <span class="identifier">interval</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">PT</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">interval</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">,</span><span class="identifier">PU</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">interval</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">PT</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">PT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">PU</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">interval</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">PT</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">interval</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">PT</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">interval</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">,</span><span class="identifier">PU</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">interval</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span><span class="identifier">PT</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.boost_classes_specializations.optional_hpp"></a><a href="index.html#boost.conversion.reference.boost_classes_specializations.optional_hpp" title="
+ Header &lt;boost/conversion/boost/optional.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">optional</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between optional of convertible
+ types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.boost_classes_specializations.array_hpp"></a><a href="index.html#boost.conversion.reference.boost_classes_specializations.array_hpp" title="
+ Header &lt;boost/conversion/boost/array.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">array</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between arrays of convertible
+ types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span>
+ <span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">N</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">N</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);;</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span>
+ <span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">N</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">N</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">N</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.reference.boost_classes_specializations.tuple_hpp"></a><a href="index.html#boost.conversion.reference.boost_classes_specializations.tuple_hpp" title="
+ Header &lt;boost/conversion/boost/tuple.hpp&gt;">
+ Header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tuple</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
+</h4></div></div></div>
+<p>
+ Include this file when using conversions between fusion::tuple of convertible
+ types.
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">namespace</span> <span class="identifier">fusion</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">&gt;</span>
+ <span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">&gt;</span>
+ <span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U3</span><span class="special">&gt;</span>
+ <span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">T3</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">,</span><span class="identifier">U3</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">T3</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);;</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U3</span><span class="special">&gt;</span>
+ <span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">T3</span><span class="special">&gt;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">T3</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">fusion</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">,</span><span clas
s="identifier">U3</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">,</span><span class="identifier">T3</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);;</span>
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost.conversion.examples"></a>Examples
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.examples.chrono__time_point_and_posix_time__ptime">chrono::time_point
+ and posix_time::ptime</a></span></dt>
+<dt><span class="section">boost::optional</span></dt>
+<dt><span class="section">std::pair</span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.examples.chrono__time_point_and_posix_time__ptime"></a><a href="index.html#boost.conversion.examples.chrono__time_point_and_posix_time__ptime" title="chrono::time_point
+ and posix_time::ptime">chrono::time_point
+ and posix_time::ptime</a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#ifndef</span> <span class="identifier">BOOST_CONVERT_TO_CHRONO_TIME_POINT_TO_POSIX_TIME_PTIME__HPP</span>
+<span class="preprocessor">#define</span> <span class="identifier">BOOST_CONVERT_TO_CHRONO_TIME_POINT_TO_POSIX_TIME_PTIME__HPP</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">date_time</span><span class="special">/</span><span class="identifier">posix_time</span><span class="special">/</span><span class="identifier">posix_time_types</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">date_time</span><span class="special">/</span><span class="identifier">posix_time</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">config</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+ <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_NO_FUNCTION_TEMPLATE_ORDERING</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">,</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span> <span class="identifier">apply</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">time_point_t</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">nanoseconds</span> <span class="identifier">duration_t</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration_t</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep_t</span><span class="special">;</span>
+ <span class="identifier">rep_t</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special">&lt;</span><span class="identifier">duration_t</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()).</span><span class="identifier">count</span><span class="special">();</span>
+ <span class="identifier">rep_t</span> <span class="identifier">sec</span> <span class="special">=</span> <span class="identifier">d</span><span class="special">/</span><span class="number">1000000000</span><span class="special">;</span>
+ <span class="identifier">rep_t</span> <span class="identifier">nsec</span> <span class="special">=</span> <span class="identifier">d</span><span class="special">%</span><span class="number">1000000000</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">from_time_t</span><span class="special">(</span><span class="number">0</span><span class="special">)+</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">seconds</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="keyword">long</span><span class="special">&gt;(</span><span class="identifier">sec</span><span class="special">))+</span>
+<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_DATE_TIME_HAS_NANOSECONDS</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="identifier">nsec</span><span class="special">);</span>
+<span class="preprocessor">#else</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">((</span><span class="identifier">nsec</span><span class="special">+</span><span class="number">500</span><span class="special">)/</span><span class="number">1000</span><span class="special">);</span>
+<span class="preprocessor">#endif</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">,</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;,</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span> <span class="identifier">time_since_epoch</span><span class="special">=</span><span class="identifier">from</span><span class="special">-</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">from_time_t</span><span class="special">(</span><span class="number">0</span><span class="special">);</span>
+ <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">t</span><span class="special">=</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">time_since_epoch</span><span class="special">.</span><span class="identifier">total_seconds</span><span class="special">());</span>
+ <span class="keyword">long</span> <span class="identifier">nsec</span><span class="special">=</span><span class="identifier">time_since_epoch</span><span class="special">.</span><span class="identifier">fractional_seconds</span><span class="special">()*(</span><span class="number">1000000000</span><span class="special">/</span><span class="identifier">time_since_epoch</span><span class="special">.</span><span class="identifier">ticks_per_second</span><span class="special">());</span>
+ <span class="keyword">return</span> <span class="identifier">t</span><span class="special">+</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="identifier">nsec</span><span class="special">);</span>
+
+ <span class="special">}</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;,</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">from</span><span cl
ass="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;(</span><span class="identifier">from</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+ <span class="special">}}</span>
+ <span class="preprocessor">#else</span>
+ <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;)</span>
+ <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">time_point_t</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">nanoseconds</span> <span class="identifier">duration_t</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration_t</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep_t</span><span class="special">;</span>
+ <span class="identifier">rep_t</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special">&lt;</span><span class="identifier">duration_t</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()).</span><span class="identifier">count</span><span class="special">();</span>
+ <span class="identifier">rep_t</span> <span class="identifier">sec</span> <span class="special">=</span> <span class="identifier">d</span><span class="special">/</span><span class="number">1000000000</span><span class="special">;</span>
+ <span class="identifier">rep_t</span> <span class="identifier">nsec</span> <span class="special">=</span> <span class="identifier">d</span><span class="special">%</span><span class="number">1000000000</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">from_time_t</span><span class="special">(</span><span class="number">0</span><span class="special">)+</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">seconds</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="keyword">long</span><span class="special">&gt;(</span><span class="identifier">sec</span><span class="special">))+</span>
+<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_DATE_TIME_HAS_NANOSECONDS</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="identifier">nsec</span><span class="special">);</span>
+<span class="preprocessor">#else</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">((</span><span class="identifier">nsec</span><span class="special">+</span><span class="number">500</span><span class="special">)/</span><span class="number">1000</span><span class="special">);</span>
+<span class="preprocessor">#endif</span>
+ <span class="special">}</span>
+
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span>
+ <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;(</span><span class="identifier">from</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="special">}</span>
+ <span class="keyword">namespace</span> <span class="identifier">posix_time</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;)</span>
+ <span class="special">{</span>
+ <span class="identifier">time_duration</span> <span class="keyword">const</span> <span class="identifier">time_since_epoch</span><span class="special">=</span><span class="identifier">from</span><span class="special">-</span><span class="identifier">from_time_t</span><span class="special">(</span><span class="number">0</span><span class="special">);</span>
+ <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">t</span><span class="special">=</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">time_since_epoch</span><span class="special">.</span><span class="identifier">total_seconds</span><span class="special">());</span>
+ <span class="keyword">long</span> <span class="identifier">nsec</span><span class="special">=</span><span class="identifier">time_since_epoch</span><span class="special">.</span><span class="identifier">fractional_seconds</span><span class="special">()*(</span><span class="number">1000000000</span><span class="special">/</span><span class="identifier">time_since_epoch</span><span class="special">.</span><span class="identifier">ticks_per_second</span><span class="special">());</span>
+ <span class="keyword">return</span> <span class="identifier">t</span><span class="special">+</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="identifier">nsec</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">ptime</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span>
+ <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">ptime</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="special">}</span>
+ <span class="preprocessor">#endif</span>
+<span class="special">}</span>
+
+<span class="preprocessor">#endif</span>
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.examples.boost__optional"></a>boost::optional
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#ifndef</span> <span class="identifier">BOOST_CONVERT_TO_OPTIONAL__HPP</span>
+<span class="preprocessor">#define</span> <span class="identifier">BOOST_CONVERT_TO_OPTIONAL__HPP</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">optional</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">none</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">config</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+
+ <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_NO_FUNCTION_TEMPLATE_ORDERING</span>
+ <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;,</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">(</span><span class="identifier">from</span><span class="special">?</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">get</span><span class="special">())):</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;());</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;,</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;&amp;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">from</span><span class="special">?</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">get</span><span class="special">()):</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;();</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+
+ <span class="special">}}</span>
+ <span class="preprocessor">#else</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;)</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="special">(</span><span class="identifier">from</span><span class="special">?</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">get</span><span class="special">())):</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;());</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+ <span class="keyword">inline</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;&amp;</span> <span class="identifier">assign_to</span><span class="special">(</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Source</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span>
+ <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span> <span class="special">=</span> <span class="identifier">from</span><span class="special">?</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">get</span><span class="special">()):</span><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;();</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="preprocessor">#endif</span>
+<span class="special">}</span>
+
+<span class="preprocessor">#endif</span>
+
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.examples.std__pair"></a>std::pair
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#ifndef</span> <span class="identifier">BOOST_CONVERT_TO_PAIR__HPP</span>
+<span class="preprocessor">#define</span> <span class="identifier">BOOST_CONVERT_TO_PAIR__HPP</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">utility</span><span class="special">&gt;</span>
+<span class="comment">//#include &lt;boost/conversion/convert_to.hpp&gt;
+</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+
+ <span class="comment">// std namespace can not be overloaded
+</span> <span class="keyword">namespace</span> <span class="identifier">partial_specialization_workaround</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">convert_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">first</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">second</span><span class="special">));</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U2</span><span class="special">&gt;</span>
+ <span class="keyword">struct</span> <span class="identifier">assign_to</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">inline</span> <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;&amp;</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span><span class="identifier">T2</span><span class="special">&gt;&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span><span class="identifier">U2<
/span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">to</span><span class="special">.</span><span class="identifier">first</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">first</span><span class="special">);</span>
+ <span class="identifier">to</span><span class="special">.</span><span class="identifier">second</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">second</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">to</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="special">};</span>
+ <span class="special">}</span>
+<span class="special">}}</span>
+
+<span class="preprocessor">#endif</span>
+
+</pre>
+<p>
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost.conversion.appendices"></a>Appendices
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Appendix A: History</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_5_0__may_30__2010____adding_pack_expression_"><span class="bold"><strong>Version 0.5.0, May 30, 2010</strong></span> <span class="emphasis"><em>Adding pack
+ expression</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_4_0__october_27__2009____applying_the_same_technique_that_boost__swap_applies_making_use_of_adl_"><span class="bold"><strong>Version 0.4.0, October 27, 2009</strong></span> <span class="emphasis"><em>Applying
+ the same technique that boost::swap applies making use of ADL</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_3_0__october_22__2009____changing_the_order_of__to__and__from__parameters_on___assign_to___function___added__mca__function_"><span class="bold"><strong>Version 0.3.0, October 22, 2009</strong></span> <span class="emphasis"><em>Changing
+ the order of <code class="computeroutput"><span class="identifier">to</span></code> and <code class="computeroutput"><span class="identifier">from</span></code> parameters on <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ function + Added <code class="computeroutput"><span class="identifier">mca</span></code> function</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_2_0__mai_16__2009____adding_array___fusion__tuples___adaptation_to_boost_1_39_"><span class="bold"><strong>Version 0.2.0, Mai 16, 2009</strong></span> <span class="emphasis"><em>Adding array
+ + fusion::tuples + Adaptation to Boost 1.39</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_1_0__april_16__2009____announcement_of_conversions_"><span class="bold"><strong>Version 0.1.0, April 16, 2009</strong></span> <span class="emphasis"><em>Announcement
+ of Conversions</em></span></a></span></dt>
+</dl></dd>
+<dt><span class="section"> Appendix B: Rationale</span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.implementation"> Appendix
+ C: Implementation Notes</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.acknowledgements"> Appendix
+ D: Acknowledgements</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_e__tests">Appendix
+ E: Tests</a></span></dt>
+<dd><dl>
+<dt><span class="section">Builtins</span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_e__tests.intrinsic_conversions">Intrinsic
+ Conversions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_e__tests.extrinsic_conversions">Extrinsic
+ Conversions</a></span></dt>
+<dt><span class="section">Std</span></dt>
+<dt><span class="section">Boost</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_f__tickets">Appendix
+ F: Tickets</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.todo"> Appendix F: Future
+ plans</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.appendices.history"></a> Appendix A: History
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_5_0__may_30__2010____adding_pack_expression_"><span class="bold"><strong>Version 0.5.0, May 30, 2010</strong></span> <span class="emphasis"><em>Adding pack
+ expression</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_4_0__october_27__2009____applying_the_same_technique_that_boost__swap_applies_making_use_of_adl_"><span class="bold"><strong>Version 0.4.0, October 27, 2009</strong></span> <span class="emphasis"><em>Applying
+ the same technique that boost::swap applies making use of ADL</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_3_0__october_22__2009____changing_the_order_of__to__and__from__parameters_on___assign_to___function___added__mca__function_"><span class="bold"><strong>Version 0.3.0, October 22, 2009</strong></span> <span class="emphasis"><em>Changing
+ the order of <code class="computeroutput"><span class="identifier">to</span></code> and <code class="computeroutput"><span class="identifier">from</span></code> parameters on <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ function + Added <code class="computeroutput"><span class="identifier">mca</span></code> function</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_2_0__mai_16__2009____adding_array___fusion__tuples___adaptation_to_boost_1_39_"><span class="bold"><strong>Version 0.2.0, Mai 16, 2009</strong></span> <span class="emphasis"><em>Adding array
+ + fusion::tuples + Adaptation to Boost 1.39</em></span></a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.history.__version_0_1_0__april_16__2009____announcement_of_conversions_"><span class="bold"><strong>Version 0.1.0, April 16, 2009</strong></span> <span class="emphasis"><em>Announcement
+ of Conversions</em></span></a></span></dt>
+</dl></div>
+<div class="itemizedlist"><ul type="disc"><li>
+ Add conversion between std::vector of explicitly convertible types.
+ </li></ul></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.history.__version_0_5_0__may_30__2010____adding_pack_expression_"></a><a href="index.html#boost.conversion.appendices.history.__version_0_5_0__may_30__2010____adding_pack_expression_" title="Version 0.5.0, May 30, 2010 Adding pack
+ expression"><span class="bold"><strong>Version 0.5.0, May 30, 2010</strong></span> <span class="emphasis"><em>Adding pack
+ expression</em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>New Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Added a pack funcrion able to pack the Source and the Target constructor
+ arguments in one parameter.
+ </li>
+<li>
+ Added conversion between std::vector of explicitly convertible types.
+ </li>
+<li>
+ Added is_convertible_to metafunction. Inherits: If an imaginary lvalue
+ of type From is convertible to type To using convert_to then inherits
+ from true_type, otherwise inherits from false_type.
+ </li>
+</ul></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">From</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">To</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">is_convertible</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">true_type</span><span class="special">-</span><span class="keyword">or</span><span class="special">-</span><span class="identifier">false_type</span> <span class="special">{};</span>
+</pre>
+<div class="itemizedlist"><ul type="disc"><li>
+ Added is_asignable_to metafunction.
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.history.__version_0_4_0__october_27__2009____applying_the_same_technique_that_boost__swap_applies_making_use_of_adl_"></a><a href="index.html#boost.conversion.appendices.history.__version_0_4_0__october_27__2009____applying_the_same_technique_that_boost__swap_applies_making_use_of_adl_" title="Version 0.4.0, October 27, 2009 Applying
+ the same technique that boost::swap applies making use of ADL"><span class="bold"><strong>Version 0.4.0, October 27, 2009</strong></span> <span class="emphasis"><em>Applying
+ the same technique that boost::swap applies making use of ADL</em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>New Features:</strong></span>
+ </p>
+<p>
+ A <code class="computeroutput"><span class="identifier">Source</span></code> class is convertible
+ to a <code class="computeroutput"><span class="identifier">Target</span></code> class if:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Either: A function with the signature <code class="computeroutput"><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;(</span><span class="identifier">Source</span>
+ <span class="keyword">const</span><span class="special">&amp;,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span>
+ <span class="keyword">const</span><span class="special">&amp;)</span></code>
+ is available via argument dependent lookup
+ </li>
+<li>
+ Or: A template specialization of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">conversion</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">,</span> <span class="identifier">Source</span><span class="special">&gt;</span></code> exists for <code class="computeroutput"><span class="identifier">Target</span></code>
+ and <code class="computeroutput"><span class="identifier">Source</span></code>
+ </li>
+<li>
+ Or: <code class="computeroutput"><span class="identifier">Target</span></code> is copy
+ constructible from <code class="computeroutput"><span class="identifier">Source</span></code>
+ (default implementation)
+ </li>
+</ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.history.__version_0_3_0__october_22__2009____changing_the_order_of__to__and__from__parameters_on___assign_to___function___added__mca__function_"></a><a href="index.html#boost.conversion.appendices.history.__version_0_3_0__october_22__2009____changing_the_order_of__to__and__from__parameters_on___assign_to___function___added__mca__function_" title="Version 0.3.0, October 22, 2009 Changing
+ the order of to and from parameters on assign_to
+ function + Added mca function"><span class="bold"><strong>Version 0.3.0, October 22, 2009</strong></span> <span class="emphasis"><em>Changing
+ the order of <code class="computeroutput"><span class="identifier">to</span></code> and <code class="computeroutput"><span class="identifier">from</span></code> parameters on <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ function + Added <code class="computeroutput"><span class="identifier">mca</span></code> function</em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Incompatibility:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Changing the order of <code class="computeroutput"><span class="identifier">to</span></code>
+ and <code class="computeroutput"><span class="identifier">from</span></code> parameters
+ on <code class="computeroutput"><span class="identifier">assign_to</span></code>.
+ </li>
+<li>
+ Now <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">convert_to</span><span class="special">.</span><span class="identifier">hpp</span></code> and <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">/</span><span class="identifier">assign_to</span><span class="special">.</span><span class="identifier">hpp</span></code>
+ files are separated.
+ </li>
+</ul></div>
+<p>
+ <span class="bold"><strong>New Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Added <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">conversion</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> global file.
+ </li>
+<li>
+ Added <code class="computeroutput"><span class="identifier">mca</span><span class="special">()</span></code>
+ function.
+ </li>
+<li>
+ Added <code class="computeroutput"><span class="identifier">convert_to_via</span></code>
+ function.
+ </li>
+</ul></div>
+<p>
+ <span class="bold"><strong>Test:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ Added test for the new features
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.history.__version_0_2_0__mai_16__2009____adding_array___fusion__tuples___adaptation_to_boost_1_39_"></a><a href="index.html#boost.conversion.appendices.history.__version_0_2_0__mai_16__2009____adding_array___fusion__tuples___adaptation_to_boost_1_39_" title="Version 0.2.0, Mai 16, 2009 Adding array
+ + fusion::tuples + Adaptation to Boost 1.39"><span class="bold"><strong>Version 0.2.0, Mai 16, 2009</strong></span> <span class="emphasis"><em>Adding array
+ + fusion::tuples + Adaptation to Boost 1.39</em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>New Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between Boost.Fusion sequences of explicitly convertible
+ types.
+ </li>
+</ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.history.__version_0_1_0__april_16__2009____announcement_of_conversions_"></a><a href="index.html#boost.conversion.appendices.history.__version_0_1_0__april_16__2009____announcement_of_conversions_" title="Version 0.1.0, April 16, 2009 Announcement
+ of Conversions"><span class="bold"><strong>Version 0.1.0, April 16, 2009</strong></span> <span class="emphasis"><em>Announcement
+ of Conversions</em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ a generic <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ function which can be specialized by the user to make explicit conversion
+ between unrelated types.
+ </li>
+<li>
+ a generic <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ function which can be specialized by the user to make explicit assignation
+ between unrelated types.
+ </li>
+<li>
+ conversion between C-arrays of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code>
+ and Streamable types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">optional</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rational</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interval</span></code>
+ of explicitly convertible types.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ptime</span></code>.
+ </li>
+<li>
+ conversion between <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">time_duration</span></code>.
+ </li>
+</ul></div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.appendices.rationale"></a> Appendix B: Rationale
+</h3></div></div></div>
+<a name="boost.conversion.appendices.rationale.trick_to_avoid_recursion_on_the_convert_to_calls"></a><h4>
+<a name="id5022677"></a>
+ <a href="index.html#boost.conversion.appendices.rationale.trick_to_avoid_recursion_on_the_convert_to_calls">Trick
+ to avoid recursion on the convert_to calls</a>
+ </h4>
+<p>
+ The implementation of this utility contains various workarounds:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ <code class="computeroutput"><span class="identifier">conversion_impl</span></code> is put
+ outside the boost namespace, to avoid infinite recursion (causing stack
+ overflow) when converting objects of a primitive type.
+ </li>
+<li>
+ <code class="computeroutput"><span class="identifier">conversion_impl</span></code> has a
+ using-directive <code class="computeroutput"><span class="keyword">using</span> <span class="keyword">namespace</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">conversion</span><span class="special">;</span></code>,
+ rather than a using-declaration, because some compilers (including MSVC
+ 7.1, Borland 5.9.3, and Intel 8.1) don't do argument-dependent lookup
+ when it has a using-declaration instead.
+ </li>
+<li>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span></code> has an additional template
+ argument, a tag, to avoid ambiguity between the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">conversion</span><span class="special">::</span><span class="identifier">convert_to</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span></code> and the when converting
+ from objects of a Boost type that does not have its own <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span></code> overload. This additional
+ argument is a reference to a base tag class <code class="computeroutput"><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span></code> for the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span></code>
+ and a reference derived tag class <code class="computeroutput"><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span></code> for all others.
+ </li>
+</ul></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">dummy</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">base_tag</span> <span class="special">{};</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">type_tag</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">{};</span>
+<span class="special">}</span>
+</pre>
+<p>
+ In this way
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+<span class="identifier">Target</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">Source</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">=</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;())</span> <span class="special">{</span>
+</pre>
+<p>
+ would be never chosen when called in this context
+ </p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">conversion</span><span class="special">;</span>
+<span class="keyword">return</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">from</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;());</span>
+</pre>
+<p>
+ as the library defines
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">conversion</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+ <span class="identifier">To</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">To</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;);</span>
+<span class="special">}</span>
+</pre>
+<a name="boost.conversion.appendices.rationale.trick_to_avoid_the_use_of_the_tag_on_the_user_side"></a><h4>
+<a name="id5023585"></a>
+ <a href="index.html#boost.conversion.appendices.rationale.trick_to_avoid_the_use_of_the_tag_on_the_user_side">Trick
+ to avoid the use of the tag on the user side</a>
+ </h4>
+<p>
+ The tag type is there to avoid infinite recursion, but it is quite cumbersome
+ at the user side.
+ </p>
+<pre class="programlisting"><span class="identifier">a</span> <span class="special">=</span> <span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span> <span class="identifier">dummy</span><span class="special">::</span><span class="identifier">type_tag</span><span class="special">&lt;</span><span class="identifier">A</span><span class="special">&gt;());</span>
+</pre>
+<p>
+ To avoid to pass it as parameter the tag parameter has a default value boost::dummy::base_tag&lt;Target&gt;().
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Target</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Source</span><span class="special">&gt;</span>
+<span class="identifier">Target</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">convert_to</span><span class="special">(</span><span class="identifier">Source</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">=</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">dummy</span><span class="special">::</span><span class="identifier">base_tag</span><span class="special">&lt;</span><span class="identifier">Target</span><span cl
ass="special">&gt;())</span> <span class="special">{</span>
+</pre>
+<p>
+ This default value needs however to give the Target template parameter
+ </p>
+<pre class="programlisting"><span class="identifier">a</span><span class="special">=</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">A</span><span class="special">&gt;(</span><span class="identifier">b</span><span class="special">);</span>
+</pre>
+<a name="boost.conversion.appendices.rationale.mathematical_background"></a><h4>
+<a name="id5023933"></a>
+ <a href="index.html#boost.conversion.appendices.rationale.mathematical_background">Mathematical
+ background</a>
+ </h4>
+<p>
+ Let be
+ </p>
+<pre class="programlisting"><span class="identifier">A</span> <span class="identifier">a</span><span class="special">,</span><span class="identifier">a2</span><span class="special">;</span>
+<span class="identifier">B</span> <span class="identifier">b</span><span class="special">;</span>
+<span class="identifier">C</span> <span class="identifier">c</span><span class="special">;</span>
+</pre>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Reflexive: A is convertible to A if it is CopyConstructible or a specialization
+ of convert_to is provided.
+ </li>
+<li>
+ Anti-Symetric : A convertible to B don't implies B convertible to A
+ </li>
+<li>
+ Loss of precision: Conversions can loss precision but not at infinitum
+ </li>
+</ul></div>
+<p>
+ Two convertible types don't loss precision if
+ </p>
+<pre class="programlisting"><span class="identifier">b</span> <span class="special">=</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">);</span>
+<span class="identifier">a2</span> <span class="special">=</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">A</span><span class="special">&gt;(</span><span class="identifier">b</span><span class="special">);</span>
+<span class="identifier">assert</span><span class="special">(</span><span class="identifier">a</span><span class="special">==</span><span class="identifier">a2</span><span class="special">);</span>
+</pre>
+<p>
+ If they can loss precision they satisfy
+ </p>
+<pre class="programlisting"><span class="identifier">b</span> <span class="special">=</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">&gt;(</span><span class="identifier">a</span><span class="special">)</span>
+<span class="identifier">a2</span> <span class="special">=</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">A</span><span class="special">&gt;(</span><span class="identifier">b</span><span class="special">)</span>
+<span class="identifier">assert</span><span class="special">(</span><span class="identifier">a</span><span class="special">==</span><span class="identifier">a2</span> <span class="special">||</span> <span class="identifier">ct</span><span class="special">(</span><span class="identifier">a2</span><span class="special">)==</span><span class="identifier">b</span>
+</pre>
+<div class="itemizedlist"><ul type="disc"><li>
+ Transitive: A convertible to B &amp;&amp; B convertible to C implies
+ A convertible to C
+ </li></ul></div>
+<p>
+ The implementation could use a intermediary B b to make the conversion or
+ make the conversion directly.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;&gt;</span>
+<span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span><span class="identifier">A</span><span class="special">&gt;(</span><span class="keyword">const</span> <span class="identifier">C</span><span class="special">&amp;</span> <span class="identifier">c</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">A</span><span class="special">&gt;(</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">&gt;(</span><span class="identifier">c</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The library provides a convert_to_via function which helps to implement that.
+ </p>
+<a name="boost.conversion.appendices.rationale.ambiguity_of_multiple_overloadins"></a><h4>
+<a name="id5024467"></a>
+ <a href="index.html#boost.conversion.appendices.rationale.ambiguity_of_multiple_overloadins">Ambiguity
+ of multiple overloadins</a>
+ </h4>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/src/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Ambiguity of multiple overloadins
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.appendices.implementation"></a><a href="index.html#boost.conversion.appendices.implementation" title=" Appendix
+ C: Implementation Notes"> Appendix
+ C: Implementation Notes</a>
+</h3></div></div></div>
+<a name="boost.conversion.appendices.implementation.why__code__phrase_role__identifier__convert_to__phrase___code__between_tuples_is_not_implemented_using__code__phrase_role__identifier__boost__phrase__phrase_role__special______phrase__phrase_role__identifier__fusion__phrase__phrase_role__special______phrase__phrase_role__identifier__transform__phrase___code__"></a><h4>
+<a name="id5024517"></a>
+ <a href="index.html#boost.conversion.appendices.implementation.why__code__phrase_role__identifier__convert_to__phrase___code__between_tuples_is_not_implemented_using__code__phrase_role__identifier__boost__phrase__phrase_role__special______phrase__phrase_role__identifier__fusion__phrase__phrase_role__special______phrase__phrase_role__identifier__transform__phrase___code__">Why
+ <code class="computeroutput"><span class="identifier">convert_to</span></code> between tuples
+ is not implemented using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">fusion</span><span class="special">::</span><span class="identifier">transform</span></code>?</a>
+ </h4>
+<p>
+ <code class="computeroutput"><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code> is
+ a kind of transformation, so the natural implementation of <code class="computeroutput"><span class="identifier">convert_to</span></code> for homogeneous containers could
+ be to use the transform function.
+ </p>
+<p>
+ This can not be applied to heterogeneous containers as tuples because the
+ function change with the type.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.appendices.acknowledgements"></a><a href="index.html#boost.conversion.appendices.acknowledgements" title=" Appendix
+ D: Acknowledgements"> Appendix
+ D: Acknowledgements</a>
+</h3></div></div></div>
+<p>
+ Thanks to Vladimir Batov proposing Boost.StringConversion which was the source
+ of inspiration of this generic library. Thanks to Edward Diener to showing
+ me indirectly that multiple assignments should be taken in account. Thanks
+ to Jeffrey Hellrung to showing me that Boost.Conversion should use also ADL.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.appendices.appendix_e__tests"></a><a href="index.html#boost.conversion.appendices.appendix_e__tests" title="Appendix
+ E: Tests">Appendix
+ E: Tests</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Builtins</span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_e__tests.intrinsic_conversions">Intrinsic
+ Conversions</a></span></dt>
+<dt><span class="section"><a href="index.html#boost.conversion.appendices.appendix_e__tests.extrinsic_conversions">Extrinsic
+ Conversions</a></span></dt>
+<dt><span class="section">Std</span></dt>
+<dt><span class="section">Boost</span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.appendix_e__tests.builtins"></a>Builtins
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ convert_to_with_builtin_types
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ works for builting types
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ assign_to_with_builtin_types
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ works for builtin types
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ assign_to_transitive
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ Use of <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ transitively
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ mca_assign_to_with_builtin_types
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">mca</span></code> <code class="computeroutput"><span class="identifier">works</span></code> for builtin types
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ mca_assign_to_transitive
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ use of <code class="computeroutput"><span class="identifier">mca</span></code> to
+ multiple assignments
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.appendix_e__tests.intrinsic_conversions"></a><a href="index.html#boost.conversion.appendices.appendix_e__tests.intrinsic_conversions" title="Intrinsic
+ Conversions">Intrinsic
+ Conversions</a>
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ convert_to_with_implicit_constructor
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ works when there is an implicit constructor
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_with_explicit_constructor
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ works when there is an explicit constructor
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_with_conversion_operator
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ works when there is an conversion operator
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ assign_to_with_assignment_operator
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ works when there is an assignment operator
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ assign_to_with_assignment_operator_and_implicit_constructor
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ works when there is an assignment operator and implicit constructor
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ assign_to_with_assignment_operator_and_conversion_operator
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ works when there is an assignment operator and a conversion operator
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ mca_with_assignment_operator
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">mca</span></code> works
+ when there is an assignment operator
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ mca_with_assignment_operator_and_implicit_constructor
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">mca</span></code> works
+ when there is an assignment operator and implicit constructor
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ mca_with_assignment_operator_and_conversion_operator
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">mca</span></code> works
+ when there is an assignment operator and a conversion operator
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.appendix_e__tests.extrinsic_conversions"></a><a href="index.html#boost.conversion.appendices.appendix_e__tests.extrinsic_conversions" title="Extrinsic
+ Conversions">Extrinsic
+ Conversions</a>
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ explicit_convert_to
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ works when <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ is overloaded
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ explicit_assign_to
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ works when <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ is overloaded
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ explicit_mca
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">mca</span></code> works
+ when <code class="computeroutput"><span class="identifier">assign_to</span></code>
+ is overloaded
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.appendix_e__tests.std"></a>Std
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ convert_to_pair
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_complex
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_vector
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_string
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code> works when the parameter
+ defines the <code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;&lt;</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_from_string
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ from <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code> works when the parameter
+ defines the <code class="computeroutput"><span class="keyword">operator</span><span class="special">&gt;&gt;</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost.conversion.appendices.appendix_e__tests.boost"></a>Boost
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ convert_to_rational
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rational</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_interval
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interval</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_optional
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">optional</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_time_point
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span></code> from boost::posix_time::ptime
+ works
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_ptime
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span></code> from boost::chrono::system_clock::time_point
+ works
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_duration
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span></code> from <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span></code> works
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_time_duration
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span></code> from <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span></code> works
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_array
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ convert_to_tuple
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check <code class="computeroutput"><span class="identifier">convert_to</span></code>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span></code> works when the parameters
+ are convertible
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.appendices.appendix_f__tickets"></a><a href="index.html#boost.conversion.appendices.appendix_f__tickets" title="Appendix
+ F: Tickets">Appendix
+ F: Tickets</a>
+</h3></div></div></div></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost.conversion.appendices.todo"></a><a href="index.html#boost.conversion.appendices.todo" title=" Appendix F: Future
+ plans"> Appendix F: Future
+ plans</a>
+</h3></div></div></div>
+<a name="boost.conversion.appendices.todo.tasks_to_do_before_review"></a><h4>
+<a name="id5027145"></a>
+ <a href="index.html#boost.conversion.appendices.todo.tasks_to_do_before_review">Tasks
+ to do before review</a>
+ </h4>
+<a name="boost.conversion.appendices.todo.for_later_releases"></a><h4>
+<a name="id5027168"></a>
+ <a href="index.html#boost.conversion.appendices.todo.for_later_releases">For later
+ releases</a>
+ </h4>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ conversion between types for which lexical_cast works.
+ </li>
+<li>
+ conversion between types for which numeric_cast works.
+ </li>
+</ul></div>
+<a name="boost.conversion.appendices.todo.make_a_proposal_to_the_c___standard"></a><h4>
+<a name="id5027209"></a>
+ <a href="index.html#boost.conversion.appendices.todo.make_a_proposal_to_the_c___standard">Make
+ a proposal to the C++ standard</a>
+ </h4>
+<p>
+ C++1x has added explicit conversion operators, but they must always be defined
+ in the source class. The same applies to the assignment operator, it must
+ be defined on the Target class.
+ </p>
+<p>
+ What it will interesting is to be able to add constructors and assignments
+ operators to the class std::pair, so we can say that two pairs are convertible
+ if the parameters are explicitly convertible using a convert_to function
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">U</span> <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span>
+<span class="comment">//requires HasConvertTo&lt;T1, const U&amp;&gt; &amp;&amp; HasConvertTo&lt;T2, const V&amp;&gt;
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">U</span> <span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;&amp;</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">&gt;(</span><span class="identifier">p</span><span class="special">.</span><span class="identifier">first</span><span class="special">),</span> <span class="identifier">convert_to</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">&gt;(</span><span class="identifier">p</span><span class="special">.</span><span class="identifier">second</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+<p>
+ But this is not possible. We can not add operations to a class.
+ </p>
+<p>
+ Another possibility could be to make an evolution to the standard, so the
+ convertible concept takes car of extrinsic conversions. We could be able
+ to implicitly or explicitly add extrinsic conversion operators between unrelated
+ types. Non-member assignment operators could also be specialized.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+<span class="keyword">operator</span> <span class="identifier">To</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">val</span><span class="special">);</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">From</span> <span class="special">&gt;</span>
+<span class="identifier">To</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">To</span><span class="special">&amp;</span> <span class="identifier">to</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">From</span><span class="special">&amp;</span> <span class="identifier">from</span><span class="special">);</span>
+</pre>
+<p>
+ For example we could define the explicit conversion from as chrono::time_point&lt;Clock,
+ Duration&gt; to posix_time::ptime follows
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">&gt;</span>
+<span class="keyword">explicit</span> <span class="keyword">operator</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;&amp;</span> <span class="identifier">from</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;</span> <span class="identifier">time_point_t</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">nanoseconds</span> <span class="identifier">duration_t</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">duration_t</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep_t</span><span class="special">;</span>
+ <span class="identifier">rep_t</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special">&lt;</span><span class="identifier">duration_t</span><span class="special">&gt;(</span><span class="identifier">from</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()).</span><span class="identifier">count</span><span class="special">();</span>
+ <span class="identifier">rep_t</span> <span class="identifier">sec</span> <span class="special">=</span> <span class="identifier">d</span><span class="special">/</span><span class="number">1000000000</span><span class="special">;</span>
+ <span class="identifier">rep_t</span> <span class="identifier">nsec</span> <span class="special">=</span> <span class="identifier">d</span><span class="special">%</span><span class="number">1000000000</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">from_time_t</span><span class="special">(</span><span class="number">0</span><span class="special">)+</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">seconds</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="keyword">long</span><span class="special">&gt;(</span><span class="identifier">sec</span><span class="special">))+</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="identifier">nsec</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ With this explicit conversion and the equivalen for duration, the actual
+ definition of std::pair will allows to
+ </p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">&lt;</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">&gt;,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">tp_dur_pair</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span><span class="special">&gt;</span> <span class="identifier">ppt</span><span class="special">;</span>
+<span class="identifier">ppt</span> <span class="special">=</span> <span class="identifier">tp_dur_pair</span><span class="special">;</span>
+</pre>
+</div>
+</div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: May 28, 2010 at 09:08:56 GMT</small></p></td>
+<td align="left"><p><small>Last revised: September 23, 2010 at 19:30:01 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>
-<div class="spirit-nav"><a accesskey="n" href="boost/conversion/overview.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"></div>
 </body>
 </html>

Modified: sandbox/conversion/libs/conversion/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/conversion/libs/conversion/doc/html/standalone_HTML.manifest (original)
+++ sandbox/conversion/libs/conversion/doc/html/standalone_HTML.manifest 2010-09-23 15:35:35 EDT (Thu, 23 Sep 2010)
@@ -1,24 +1 @@
 index.html
-boost/conversion/overview.html
-boost/conversion/overview/motivation.html
-boost/conversion/users_guide.html
-boost/conversion/users_guide/getting_started.html
-boost/conversion/users_guide/tutorial.html
-boost/conversion/users_guide/ext_references.html
-boost/conversion/reference.html
-boost/conversion/reference/conversion_hpp.html
-boost/conversion/reference/core.html
-boost/conversion/reference/c___standard_classes_specializations.html
-boost/conversion/reference/boost_classes_specializations.html
-boost/conversion/examples.html
-boost/conversion/examples/chrono__time_point_and_posix_time__ptime.html
-boost/conversion/examples/boost__optional.html
-boost/conversion/examples/std__pair.html
-boost/conversion/appendices.html
-boost/conversion/appendices/history.html
-boost/conversion/appendices/rationale.html
-boost/conversion/appendices/implementation.html
-boost/conversion/appendices/acknowledgements.html
-boost/conversion/appendices/appendix_e__tests.html
-boost/conversion/appendices/appendix_f__tickets.html
-boost/conversion/appendices/todo.html


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk