forked from boostorg/type_traits
Type_traits.detection idiom: flesh out docs and add history.
This commit is contained in:
@ -21,4 +21,20 @@ __compat Requires C++11 variadic templates and C++11 template aliases.
|
||||
|
||||
__header `#include <boost/type_traits/detected.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
Suppose you wish to determine whether a type has a `size()` const-member function, then given the meta-functions:
|
||||
|
||||
template <class T>
|
||||
using size_member_tester = decltype(std::declval<const T&>().size());
|
||||
|
||||
template <class T>
|
||||
using size_member_t = boost::detected_t<size_member_tester, T >;
|
||||
|
||||
|
||||
Then the type `size_member_t<T>` is an alias for `size_member_tester<T>` if the operation is valid, and an alias for
|
||||
`boost::nonesuch` otherwise.
|
||||
|
||||
See also: __is_detected, __is_detected_convertible, __is_detected_exact.
|
||||
|
||||
[endsect]
|
||||
|
@ -29,10 +29,17 @@ __header `#include <boost/type_traits/detected_or.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
Suppose we wish to declare a type that represents the difference between two values of type T, it should be
|
||||
T::difference_type if such a type exists, or std::ptrdiff_t otherwise:
|
||||
|
||||
template<class T>
|
||||
using difference_t = typename T::difference_type;
|
||||
|
||||
template<class T>
|
||||
using difference_type = boost::detected_or_t<std::ptrdiff_t, difference_t, T>;
|
||||
|
||||
Now the type `difference_type<T>` gives us what we need.
|
||||
|
||||
See also: __is_detected, __is_detected_convertible, __is_detected_exact.
|
||||
|
||||
[endsect]
|
||||
|
@ -7,6 +7,10 @@
|
||||
|
||||
[section:history History]
|
||||
|
||||
[h4 Boost 1.67.0]
|
||||
|
||||
* Added new traits __detected, __detected_or, __is_detected, __is_detected_convertible, and __is_detected_exact.
|
||||
|
||||
[h4 Boost 1.64.0]
|
||||
|
||||
* Added new trait __make_void.
|
||||
|
@ -39,7 +39,7 @@
|
||||
This version of type traits library is based on contributions by Adobe Systems
|
||||
Inc, David Abrahams, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Thorsten Ottosen, Robert
|
||||
Ramey, Jeremy Siek and Antony Polukhin.
|
||||
Ramey, Jeremy Siek, Antony Polukhin and Glen Fernandes.
|
||||
</p>
|
||||
<p>
|
||||
Mat Marcus and Jesse Jones invented, and <a href="http://opensource.adobe.com/project4/project.shtml" target="_top">published
|
||||
|
@ -28,6 +28,18 @@
|
||||
</h2></div></div></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h0"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_67_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_67_0">Boost
|
||||
1.67.0</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
Added new traits <a class="link" href="reference/detected.html" title="detected">detected</a>,
|
||||
<a class="link" href="reference/detected_or.html" title="detected_or">detected_or</a>,
|
||||
<a class="link" href="reference/is_detected.html" title="is_detected">is_detected</a>,
|
||||
<a class="link" href="reference/is_detected_convertible.html" title="is_detected_convertible">is_detected_convertible</a>,
|
||||
and <a class="link" href="reference/is_detected_exact.html" title="is_detected_exact">is_detected_exact</a>.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h1"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_64_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_64_0">Boost
|
||||
1.64.0</a>
|
||||
</h5>
|
||||
@ -35,7 +47,7 @@
|
||||
Added new trait <a class="link" href="reference/make_void.html" title="make_void">make_void</a>.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h1"></a>
|
||||
<a name="boost_typetraits.history.h2"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_60_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_60_0">Boost
|
||||
1.60.0</a>
|
||||
</h5>
|
||||
@ -58,7 +70,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h2"></a>
|
||||
<a name="boost_typetraits.history.h3"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_58_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_58_0">Boost
|
||||
1.58.0</a>
|
||||
</h5>
|
||||
@ -73,7 +85,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h3"></a>
|
||||
<a name="boost_typetraits.history.h4"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_57_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_57_0">Boost
|
||||
1.57.0</a>
|
||||
</h5>
|
||||
@ -87,7 +99,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h4"></a>
|
||||
<a name="boost_typetraits.history.h5"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_56_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_56_0">Boost
|
||||
1.56.0</a>
|
||||
</h5>
|
||||
@ -96,7 +108,7 @@
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/9474" target="_top">#9474</a>.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h5"></a>
|
||||
<a name="boost_typetraits.history.h6"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_55_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_55_0">Boost
|
||||
1.55.0</a>
|
||||
</h5>
|
||||
@ -104,7 +116,7 @@
|
||||
Added new trait <a class="link" href="reference/is_copy_constructible.html" title="is_copy_constructible">is_copy_constructible</a>.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h6"></a>
|
||||
<a name="boost_typetraits.history.h7"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_54_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_54_0">Boost
|
||||
1.54.0</a>
|
||||
</h5>
|
||||
@ -115,7 +127,7 @@
|
||||
<a class="link" href="reference/has_trivial_move_constructor.html" title="has_trivial_move_constructor">has_trivial_move_constructor</a>.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h7"></a>
|
||||
<a name="boost_typetraits.history.h8"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_47_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_47_0">Boost
|
||||
1.47.0</a>
|
||||
</h5>
|
||||
@ -130,7 +142,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h8"></a>
|
||||
<a name="boost_typetraits.history.h9"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_45_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_45_0">Boost
|
||||
1.45.0</a>
|
||||
</h5>
|
||||
@ -147,7 +159,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h9"></a>
|
||||
<a name="boost_typetraits.history.h10"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_44_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_44_0">Boost
|
||||
1.44.0</a>
|
||||
</h5>
|
||||
@ -164,7 +176,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_typetraits.history.h10"></a>
|
||||
<a name="boost_typetraits.history.h11"></a>
|
||||
<span class="phrase"><a name="boost_typetraits.history.boost_1_42_0"></a></span><a class="link" href="history.html#boost_typetraits.history.boost_1_42_0">Boost
|
||||
1.42.0</a>
|
||||
</h5>
|
||||
|
@ -41,6 +41,8 @@
|
||||
<dt><span class="section"><a href="reference/copy_cv.html">copy_cv</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/decay.html">decay</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/declval.html">declval</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/detected.html">detected</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/detected_or.html">detected_or</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/extent.html">extent</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/floating_point_promotion.html">floating_point_promotion</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/function_traits.html">function_traits</a></span></dt>
|
||||
@ -115,6 +117,9 @@
|
||||
<dt><span class="section"><a href="reference/is_copy_constructible.html">is_copy_constructible</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_default_constructible.html">is_default_constructible</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_destructible.html">is_destructible</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_detected.html">is_detected</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_detected_convertible.html">is_detected_convertible</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_detected_exact.html">is_detected_exact</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_empty.html">is_empty</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_enum.html">is_enum</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/is_final.html">is_final</a></span></dt>
|
||||
@ -148,6 +153,7 @@
|
||||
<dt><span class="section"><a href="reference/make_signed.html">make_signed</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/make_unsigned.html">make_unsigned</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/make_void.html">make_void</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/nonesuch.html">nonesuch</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/promote.html">promote</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/rank.html">rank</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/remove_all_extents.html">remove_all_extents</a></span></dt>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="decay.html" title="decay">
|
||||
<link rel="next" href="extent.html" title="extent">
|
||||
<link rel="next" href="detected.html" title="detected">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="decay.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="extent.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="decay.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="detected.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -60,7 +60,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="decay.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="extent.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="decay.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="detected.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
88
doc/html/boost_typetraits/reference/detected.html
Normal file
88
doc/html/boost_typetraits/reference/detected.html
Normal file
@ -0,0 +1,88 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>detected</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="declval.html" title="declval">
|
||||
<link rel="next" href="detected_or.html" title="detected_or">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="declval.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="detected_or.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.detected"></a><a class="link" href="detected.html" title="detected">detected</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">detected_t</span> <span class="special">=</span> <em class="replaceable"><code>see-below</code></em><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Aliases:</strong></span> <code class="computeroutput"><span class="identifier">Op</span><span class="special"><</span><span class="identifier">Args</span><span class="special">...></span></code> if it is a valid template-id, otherwise
|
||||
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">nonesuch</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>C++ Standard Paper:</strong></span> <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf" target="_top">N4502</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Compiler Compatibility:</strong></span> Requires C++11 variadic
|
||||
templates and C++11 template aliases.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">detected</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
Suppose you wish to determine whether a type has a <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code> const-member function, then given the meta-functions:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">size_member_tester</span> <span class="special">=</span> <span class="keyword">decltype</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">declval</span><span class="special"><</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&>().</span><span class="identifier">size</span><span class="special">());</span>
|
||||
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">size_member_t</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">detected_t</span><span class="special"><</span><span class="identifier">size_member_tester</span><span class="special">,</span> <span class="identifier">T</span> <span class="special">>;</span>
|
||||
</pre>
|
||||
<p>
|
||||
Then the type <code class="computeroutput"><span class="identifier">size_member_t</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
|
||||
is an alias for <code class="computeroutput"><span class="identifier">size_member_tester</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
|
||||
if the operation is valid, and an alias for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">nonesuch</span></code>
|
||||
otherwise.
|
||||
</p>
|
||||
<p>
|
||||
See also: <a class="link" href="is_detected.html" title="is_detected">is_detected</a>,
|
||||
<a class="link" href="is_detected_convertible.html" title="is_detected_convertible">is_detected_convertible</a>,
|
||||
<a class="link" href="is_detected_exact.html" title="is_detected_exact">is_detected_exact</a>.
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="declval.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="detected_or.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
102
doc/html/boost_typetraits/reference/detected_or.html
Normal file
102
doc/html/boost_typetraits/reference/detected_or.html
Normal file
@ -0,0 +1,102 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>detected_or</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="detected.html" title="detected">
|
||||
<link rel="next" href="extent.html" title="extent">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="detected.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="extent.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.detected_or"></a><a class="link" href="detected_or.html" title="detected_or">detected_or</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">Default</span><span class="special">,</span> <span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">detected_or</span> <span class="special">=</span> <em class="replaceable"><code>see-below</code></em><span class="special">;</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">Default</span><span class="special">,</span> <span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">detected_or_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">detected_or</span><span class="special"><</span><span class="identifier">Default</span><span class="special">,</span> <span class="identifier">Op</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">...>::</span><span class="identifier">type</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Aliases:</strong></span> An unspecified type with two public
|
||||
member type definitions:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="identifier">value_t</span></code> is <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>
|
||||
if <code class="computeroutput"><span class="identifier">Op</span><span class="special"><</span><span class="identifier">Args</span><span class="special">...></span></code>
|
||||
is a valid template-id, otherwise <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="identifier">type</span></code> is <code class="computeroutput"><span class="identifier">Op</span><span class="special"><</span><span class="identifier">Args</span><span class="special">...></span></code>
|
||||
if it is a valid template-id, otherwise <code class="computeroutput"><span class="identifier">Default</span></code>
|
||||
</li>
|
||||
</ul></div>
|
||||
<p>
|
||||
<span class="bold"><strong>C++ Standard Paper:</strong></span> <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf" target="_top">N4502</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Compiler Compatibility:</strong></span> Requires C++11 variadic
|
||||
templates and C++11 template aliases.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">detected_or</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
Suppose we wish to declare a type that represents the difference between
|
||||
two values of type T, it should be T::difference_type if such a type exists,
|
||||
or std::ptrdiff_t otherwise:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">difference_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">difference_type</span><span class="special">;</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">difference_type</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">detected_or_t</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span><span class="special">,</span> <span class="identifier">difference_t</span><span class="special">,</span> <span class="identifier">T</span><span class="special">>;</span>
|
||||
</pre>
|
||||
<p>
|
||||
Now the type <code class="computeroutput"><span class="identifier">difference_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
|
||||
gives us what we need.
|
||||
</p>
|
||||
<p>
|
||||
See also: <a class="link" href="is_detected.html" title="is_detected">is_detected</a>,
|
||||
<a class="link" href="is_detected_convertible.html" title="is_detected_convertible">is_detected_convertible</a>,
|
||||
<a class="link" href="is_detected_exact.html" title="is_detected_exact">is_detected_exact</a>.
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="detected.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="extent.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -6,7 +6,7 @@
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="declval.html" title="declval">
|
||||
<link rel="prev" href="detected_or.html" title="detected_or">
|
||||
<link rel="next" href="floating_point_promotion.html" title="floating_point_promotion">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="declval.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="detected_or.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -107,7 +107,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="declval.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="detected_or.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="floating_point_promotion.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="is_default_constructible.html" title="is_default_constructible">
|
||||
<link rel="next" href="is_empty.html" title="is_empty">
|
||||
<link rel="next" href="is_detected.html" title="is_detected">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_default_constructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_empty.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="is_default_constructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_detected.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -63,7 +63,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_default_constructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_empty.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="is_default_constructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_detected.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
94
doc/html/boost_typetraits/reference/is_detected.html
Normal file
94
doc/html/boost_typetraits/reference/is_detected.html
Normal file
@ -0,0 +1,94 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>is_detected</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="is_destructible.html" title="is_destructible">
|
||||
<link rel="next" href="is_detected_convertible.html" title="is_detected_convertible">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_destructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_detected_convertible.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.is_detected"></a><a class="link" href="is_detected.html" title="is_detected">is_detected</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">is_detected</span> <span class="special">=</span> <em class="replaceable"><code>see-below</code></em><span class="special">;</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_detected_v</span> <span class="special">=</span> <span class="identifier">is_detected</span><span class="special"><</span><span class="identifier">Op</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">...>::</span><span class="identifier">value</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Aliases:</strong></span> If <code class="computeroutput"><span class="identifier">Op</span><span class="special"><</span><span class="identifier">Args</span><span class="special">...></span></code> is a valid template-id, aliases <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
|
||||
otherwise aliases <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>C++ Standard Paper:</strong></span> <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf" target="_top">N4502</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Compiler Compatibility:</strong></span> Requires C++11 variadic
|
||||
templates and C++11 template aliases.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">is_detected</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
Suppose we wish to "reset" a value of type T, if the type has a
|
||||
<code class="computeroutput"><span class="identifier">clear</span><span class="special">()</span></code>
|
||||
member function then we should call it, otherwise we should assign a default
|
||||
constructed value:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">clear_t</span> <span class="special">=</span> <span class="keyword">decltype</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">declval</span><span class="special"><</span><span class="identifier">T</span><span class="special">&>().</span><span class="identifier">clear</span><span class="special">());</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">void</span> <span class="identifier">clear</span><span class="special">(</span><span class="identifier">T</span><span class="special">&</span> <span class="identifier">value</span><span class="special">)</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">if</span> <span class="keyword">constexpr</span> <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_detected_v</span><span class="special"><</span><span class="identifier">clear_t</span><span class="special">,</span> <span class="identifier">T</span><span class="special">>)</span> <span class="special">{</span>
|
||||
<span class="identifier">value</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
|
||||
<span class="special">}</span> <span class="keyword">else</span> <span class="special">{</span>
|
||||
<span class="identifier">value</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">();</span>
|
||||
<span class="special">}</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<p>
|
||||
See also: <a class="link" href="is_detected_convertible.html" title="is_detected_convertible">is_detected_convertible</a>,
|
||||
<a class="link" href="is_detected_exact.html" title="is_detected_exact">is_detected_exact</a>.
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_destructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_detected_convertible.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,84 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>is_detected_convertible</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="is_detected.html" title="is_detected">
|
||||
<link rel="next" href="is_detected_exact.html" title="is_detected_exact">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_detected.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_detected_exact.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.is_detected_convertible"></a><a class="link" href="is_detected_convertible.html" title="is_detected_convertible">is_detected_convertible</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">is_detected_convertible</span> <span class="special">=</span> <span class="identifier">is_convertible</span><span class="special"><</span><span class="identifier">detected_t</span><span class="special"><</span><span class="identifier">Op</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">...>,</span> <span class="identifier">To</span><span class="special">>;</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_detected_convertible_v</span> <span class="special">=</span> <span class="identifier">is_detected_convertible</span><span class="special"><</span><span class="identifier">Op</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">...>::</span><span class="identifier">value</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>C++ Standard Paper:</strong></span> <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf" target="_top">N4502</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Compiler Compatibility:</strong></span> Requires C++11 variadic
|
||||
templates and C++11 template aliases.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">is_detected_convertible</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
The type <code class="computeroutput"><span class="identifier">is_detected_convertible</span><span class="special"><</span><span class="identifier">To</span><span class="special">,</span> <span class="identifier">Op</span><span class="special">,</span>
|
||||
<span class="identifier">Args</span><span class="special">></span></code>
|
||||
is an alias for <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>
|
||||
if the result of <code class="computeroutput"><span class="identifier">Op</span><span class="special"><</span><span class="identifier">Args</span><span class="special">></span></code>
|
||||
is convertible to type <code class="computeroutput"><span class="identifier">To</span></code>.
|
||||
Otherwise it's the type <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>;
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">size_type_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">size_type</span><span class="special">;</span>
|
||||
|
||||
<span class="keyword">static_assert</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_detected_convertible_v</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">size_type_t</span><span class="special">,</span> <span class="identifier">T</span><span class="special">>);</span>
|
||||
</pre>
|
||||
<p>
|
||||
See also: <a class="link" href="is_detected.html" title="is_detected">is_detected</a>,
|
||||
<a class="link" href="is_detected_exact.html" title="is_detected_exact">is_detected_exact</a>.
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_detected.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_detected_exact.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
84
doc/html/boost_typetraits/reference/is_detected_exact.html
Normal file
84
doc/html/boost_typetraits/reference/is_detected_exact.html
Normal file
@ -0,0 +1,84 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>is_detected_exact</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="is_detected_convertible.html" title="is_detected_convertible">
|
||||
<link rel="next" href="is_empty.html" title="is_empty">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_detected_convertible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_empty.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.is_detected_exact"></a><a class="link" href="is_detected_exact.html" title="is_detected_exact">is_detected_exact</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">Expected</span><span class="special">,</span> <span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">is_detected_exact</span> <span class="special">=</span> <span class="identifier">is_same</span><span class="special"><</span><span class="identifier">Expected</span><span class="special">,</span> <span class="identifier">detected_t</span><span class="special"><</span><span class="identifier">Op</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">...></span> <span class="special">>;</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">Expected</span><span class="special">,</span> <span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span><span class="special">...></span> <span class="keyword">class</span> <span class="identifier">Op</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">></span>
|
||||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_detected_exact_v</span> <span class="special">=</span> <span class="identifier">is_detected_exact</span><span class="special"><</span><span class="identifier">Op</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">...>::</span><span class="identifier">value</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>C++ Standard Paper:</strong></span> <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf" target="_top">N4502</a>
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Compiler Compatibility:</strong></span> Requires C++11 variadic
|
||||
templates and C++11 template aliases.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">is_detected_exact</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
The type <code class="computeroutput"><span class="identifier">is_detected_exact</span><span class="special"><</span><span class="identifier">To</span><span class="special">,</span> <span class="identifier">Op</span><span class="special">,</span>
|
||||
<span class="identifier">Args</span><span class="special">></span></code>
|
||||
is an alias for <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>
|
||||
if the result of <code class="computeroutput"><span class="identifier">Op</span><span class="special"><</span><span class="identifier">Args</span><span class="special">></span></code>
|
||||
is type <code class="computeroutput"><span class="identifier">To</span></code>. Otherwise it's
|
||||
the type <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>;
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Examples:</strong></span>
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">using</span> <span class="identifier">difference_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">T</span><span class="special">::</span><span class="identifier">difference_type</span><span class="special">;</span>
|
||||
|
||||
<span class="keyword">static_assert</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_detected_exact_v</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span><span class="special">,</span> <span class="identifier">difference_t</span><span class="special">,</span> <span class="identifier">T</span><span class="special">>);</span>
|
||||
</pre>
|
||||
<p>
|
||||
See also: <a class="link" href="is_detected.html" title="is_detected">is_detected</a>,
|
||||
<a class="link" href="is_detected_convertible.html" title="is_detected_convertible">is_detected_convertible</a>.
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_detected_convertible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_empty.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -6,7 +6,7 @@
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="is_destructible.html" title="is_destructible">
|
||||
<link rel="prev" href="is_detected_exact.html" title="is_detected_exact">
|
||||
<link rel="next" href="is_enum.html" title="is_enum">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_destructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_enum.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="is_detected_exact.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_enum.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -96,7 +96,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_destructible.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_enum.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="is_detected_exact.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_enum.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="make_unsigned.html" title="make_unsigned">
|
||||
<link rel="next" href="promote.html" title="promote">
|
||||
<link rel="next" href="nonesuch.html" title="nonesuch">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="nonesuch.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -173,7 +173,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="nonesuch.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
62
doc/html/boost_typetraits/reference/nonesuch.html
Normal file
62
doc/html/boost_typetraits/reference/nonesuch.html
Normal file
@ -0,0 +1,62 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>nonesuch</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="make_void.html" title="make_void">
|
||||
<link rel="next" href="promote.html" title="promote">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_void.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_typetraits.reference.nonesuch"></a><a class="link" href="nonesuch.html" title="nonesuch">nonesuch</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">nonesuch</span> <span class="special">{</span>
|
||||
<span class="identifier">nonesuch</span><span class="special">()</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
|
||||
<span class="special">~</span><span class="identifier">nonesuch</span><span class="special">()</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
|
||||
<span class="identifier">nonesuch</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">nonesuch</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
|
||||
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">nonesuch</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"><span class="preprocessor">#include</span>
|
||||
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">nonesuch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<p>
|
||||
Type <code class="computeroutput"><span class="identifier">nonesuch</span></code> is a placeholder
|
||||
type used when the detection idiom fails - see <a class="link" href="detected.html" title="detected">detected</a>.
|
||||
</p>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
|
||||
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
|
||||
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
|
||||
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
|
||||
Watanabe<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_void.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -6,7 +6,7 @@
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="make_void.html" title="make_void">
|
||||
<link rel="prev" href="nonesuch.html" title="nonesuch">
|
||||
<link rel="next" href="rank.html" title="rank">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_void.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="nonesuch.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -131,7 +131,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_void.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="nonesuch.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -97,6 +97,8 @@
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/copy_cv.html">copy_cv</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/decay.html">decay</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/declval.html">declval</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/detected.html">detected</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/detected_or.html">detected_or</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/extent.html">extent</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/floating_point_promotion.html">floating_point_promotion</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/function_traits.html">function_traits</a></span></dt>
|
||||
@ -171,6 +173,9 @@
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_copy_constructible.html">is_copy_constructible</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_default_constructible.html">is_default_constructible</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_destructible.html">is_destructible</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_detected.html">is_detected</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_detected_convertible.html">is_detected_convertible</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_detected_exact.html">is_detected_exact</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_empty.html">is_empty</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_enum.html">is_enum</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_final.html">is_final</a></span></dt>
|
||||
@ -204,6 +209,7 @@
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/make_signed.html">make_signed</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/make_unsigned.html">make_unsigned</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/make_void.html">make_void</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/nonesuch.html">nonesuch</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/promote.html">promote</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/rank.html">rank</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/remove_all_extents.html">remove_all_extents</a></span></dt>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1658477"></a>Class Index</h2></div></div></div>
|
||||
<a name="id1660500"></a>Class Index</h2></div></div></div>
|
||||
<p><a class="link" href="s11.html#idx_id_0">A</a> <a class="link" href="s11.html#idx_id_2">C</a> <a class="link" href="s11.html#idx_id_3">D</a> <a class="link" href="s11.html#idx_id_4">E</a> <a class="link" href="s11.html#idx_id_5">F</a> <a class="link" href="s11.html#idx_id_6">H</a> <a class="link" href="s11.html#idx_id_7">I</a> <a class="link" href="s11.html#idx_id_8">M</a> <a class="link" href="s11.html#idx_id_9">N</a> <a class="link" href="s11.html#idx_id_10">O</a> <a class="link" href="s11.html#idx_id_11">P</a> <a class="link" href="s11.html#idx_id_12">R</a> <a class="link" href="s11.html#idx_id_13">T</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
@ -299,10 +299,13 @@
|
||||
<dt>
|
||||
<a name="idx_id_9"></a><span class="term">N</span>
|
||||
</dt>
|
||||
<dd><div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none">
|
||||
<dd><div class="index"><ul class="index" style="list-style-type: none; ">
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/nonesuch.html" title="nonesuch"><span class="index-entry-level-0">nonesuch</span></a></p></li>
|
||||
<li class="listitem" style="list-style-type: none">
|
||||
<p><span class="index-entry-level-0">no_operator</span></p>
|
||||
<div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li></ul></div>
|
||||
</li></ul></div></dd>
|
||||
</li>
|
||||
</ul></div></dd>
|
||||
<dt>
|
||||
<a name="idx_id_10"></a><span class="term">O</span>
|
||||
</dt>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1660788"></a>Typedef Index</h2></div></div></div>
|
||||
<a name="id1663998"></a>Typedef Index</h2></div></div></div>
|
||||
<p><a class="link" href="s12.html#idx_id_21">F</a> <a class="link" href="s12.html#idx_id_28">R</a> <a class="link" href="s12.html#idx_id_29">T</a> <a class="link" href="s12.html#idx_id_31">V</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1660992"></a>Macro Index</h2></div></div></div>
|
||||
<a name="id1664189"></a>Macro Index</h2></div></div></div>
|
||||
<p><a class="link" href="s13.html#idx_id_33">B</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1664150"></a>Index</h2></div></div></div>
|
||||
<a name="id1662629"></a>Index</h2></div></div></div>
|
||||
<p><a class="link" href="s14.html#idx_id_48">A</a> <a class="link" href="s14.html#idx_id_49">B</a> <a class="link" href="s14.html#idx_id_50">C</a> <a class="link" href="s14.html#idx_id_51">D</a> <a class="link" href="s14.html#idx_id_52">E</a> <a class="link" href="s14.html#idx_id_53">F</a> <a class="link" href="s14.html#idx_id_54">H</a> <a class="link" href="s14.html#idx_id_55">I</a> <a class="link" href="s14.html#idx_id_56">M</a> <a class="link" href="s14.html#idx_id_57">N</a> <a class="link" href="s14.html#idx_id_58">O</a> <a class="link" href="s14.html#idx_id_59">P</a> <a class="link" href="s14.html#idx_id_60">R</a> <a class="link" href="s14.html#idx_id_61">T</a> <a class="link" href="s14.html#idx_id_62">U</a> <a class="link" href="s14.html#idx_id_63">V</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
@ -846,10 +846,13 @@
|
||||
<dt>
|
||||
<a name="idx_id_57"></a><span class="term">N</span>
|
||||
</dt>
|
||||
<dd><div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none">
|
||||
<dd><div class="index"><ul class="index" style="list-style-type: none; ">
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/nonesuch.html" title="nonesuch"><span class="index-entry-level-0">nonesuch</span></a></p></li>
|
||||
<li class="listitem" style="list-style-type: none">
|
||||
<p><span class="index-entry-level-0">no_operator</span></p>
|
||||
<div class="index"><ul class="index" style="list-style-type: none; "><li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/category/value_traits/operators.html" title="Operator Type Traits"><span class="index-entry-level-1">Operator Type Traits</span></a></p></li></ul></div>
|
||||
</li></ul></div></dd>
|
||||
</li>
|
||||
</ul></div></dd>
|
||||
<dt>
|
||||
<a name="idx_id_58"></a><span class="term">O</span>
|
||||
</dt>
|
||||
|
@ -26,6 +26,9 @@ __header `#include <boost/type_traits/is_detected.hpp>`
|
||||
|
||||
__examples
|
||||
|
||||
Suppose we wish to "reset" a value of type T, if the type has a `clear()` member function then we should call
|
||||
it, otherwise we should assign a default constructed value:
|
||||
|
||||
template<class T>
|
||||
using clear_t = decltype(boost::declval<T&>().clear());
|
||||
|
||||
@ -39,4 +42,6 @@ __examples
|
||||
}
|
||||
}
|
||||
|
||||
See also: __is_detected_convertible, __is_detected_exact.
|
||||
|
||||
[endsect]
|
||||
|
@ -21,6 +21,9 @@ __compat Requires C++11 variadic templates and C++11 template aliases.
|
||||
|
||||
__header `#include <boost/type_traits/is_detected_convertible.hpp>`
|
||||
|
||||
The type `is_detected_convertible<To, Op, Args>` is an alias for __true_type if the result of
|
||||
`Op<Args>` is convertible to type `To`. Otherwise it's the type __false_type;
|
||||
|
||||
__examples
|
||||
|
||||
template<class T>
|
||||
@ -28,4 +31,7 @@ __examples
|
||||
|
||||
static_assert(boost::is_detected_convertible_v<std::size_t, size_type_t, T>);
|
||||
|
||||
See also: __is_detected, __is_detected_exact.
|
||||
|
||||
|
||||
[endsect]
|
||||
|
@ -21,6 +21,10 @@ __compat Requires C++11 variadic templates and C++11 template aliases.
|
||||
|
||||
__header `#include <boost/type_traits/is_detected_exact.hpp>`
|
||||
|
||||
The type `is_detected_exact<To, Op, Args>` is an alias for __true_type if the result of
|
||||
`Op<Args>` is type `To`. Otherwise it's the type __false_type;
|
||||
|
||||
|
||||
__examples
|
||||
|
||||
template<class T>
|
||||
@ -28,4 +32,6 @@ __examples
|
||||
|
||||
static_assert(boost::is_detected_exact_v<std::ptrdiff_t, difference_t, T>);
|
||||
|
||||
See also: __is_detected, __is_detected_convertible.
|
||||
|
||||
[endsect]
|
||||
|
@ -18,4 +18,6 @@ or copy at http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
__header `#include <boost/type_traits/nonesuch.hpp>`
|
||||
|
||||
Type `nonesuch` is a placeholder type used when the detection idiom fails - see __detected.
|
||||
|
||||
[endsect]
|
||||
|
Reference in New Issue
Block a user