BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslmf_ispair.h
Go to the documentation of this file.
1
/// @file bslmf_ispair.h
2
///
3
/// The content of this file has been pre-processed for Doxygen.
4
///
5
6
7
// bslmf_ispair.h -*-C++-*-
8
#ifndef INCLUDED_BSLMF_ISPAIR
9
#define INCLUDED_BSLMF_ISPAIR
10
11
#include <
bsls_ident.h
>
12
BSLS_IDENT
(
"$Id: $"
)
13
14
/// @defgroup bslmf_ispair bslmf_ispair
15
/// @brief Provide a compile-time check for the bsl::pair type.
16
/// @addtogroup bsl
17
/// @{
18
/// @addtogroup bslmf
19
/// @{
20
/// @addtogroup bslmf_ispair
21
/// @{
22
///
23
/// <h1> Outline </h1>
24
/// * <a href="#bslmf_ispair-purpose"> Purpose</a>
25
/// * <a href="#bslmf_ispair-classes"> Classes </a>
26
/// * <a href="#bslmf_ispair-description"> Description </a>
27
/// * <a href="#bslmf_ispair-usage-notes"> Usage notes </a>
28
///
29
/// # Purpose {#bslmf_ispair-purpose}
30
/// Provide a compile-time check for the bsl::pair type.
31
///
32
/// # Classes {#bslmf_ispair-classes}
33
///
34
/// - bslmf::IsPair: meta-function for determining the bsl::pair type.
35
///
36
/// @see
37
///
38
/// # Description {#bslmf_ispair-description}
39
/// This component defines a simple template structure used to
40
/// evaluate whether it's parameter is a `bsl::pair` type. A `t_TYPE` that has
41
/// this trait fulfills the following requirements, where `mX` is a modifiable
42
/// object and `X` a non-modifiable object of `t_TYPE`:
43
/// @code
44
/// Valid expression Type
45
/// ---------------- ----
46
/// t_TYPE::first_type
47
/// t_TYPE::second_type
48
///
49
/// mX.first first_type
50
/// mX.second second_type
51
/// X.first const first_type
52
/// X.second const second_type
53
/// @endcode
54
/// Note that `first` and `second` are *not* member functions, but data members.
55
///
56
/// ## Usage notes {#bslmf_ispair-usage-notes}
57
///
58
///
59
/// The `bslmf::IsPair` trait is not used to construct pair objects, as a pair
60
/// behaves like any other type w.r.t. the constructors and `bslma::Allocator`.
61
/// Nevertheless, it is used for different purposes in libraries that depend on
62
/// `bslalg`. For instance, some libraries use it for printing (a pair does not
63
/// have a printing method, but it is possible to use the trait to forward the
64
/// call to `print` to its two members if they both have the printable trait).
65
/// @}
66
/** @} */
67
/** @} */
68
69
/** @addtogroup bsl
70
* @{
71
*/
72
/** @addtogroup bslmf
73
* @{
74
*/
75
/** @addtogroup bslmf_ispair
76
* @{
77
*/
78
79
#include <bslscm_version.h>
80
81
#include <
bslmf_integralconstant.h
>
82
83
84
85
namespace
bslmf
{
86
87
template
<
class
t_TYPE>
88
struct
IsPair
:
bsl::false_type
{};
89
90
}
// close package namespace
91
92
93
#endif
94
95
// ----------------------------------------------------------------------------
96
// Copyright 2013 Bloomberg Finance L.P.
97
//
98
// Licensed under the Apache License, Version 2.0 (the "License");
99
// you may not use this file except in compliance with the License.
100
// You may obtain a copy of the License at
101
//
102
// http://www.apache.org/licenses/LICENSE-2.0
103
//
104
// Unless required by applicable law or agreed to in writing, software
105
// distributed under the License is distributed on an "AS IS" BASIS,
106
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
107
// See the License for the specific language governing permissions and
108
// limitations under the License.
109
// ----------------------------- END-OF-FILE ----------------------------------
110
111
/** @} */
112
/** @} */
113
/** @} */
bslmf_integralconstant.h
bsls_ident.h
BSLS_IDENT
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition
bsls_ident.h:238
bslmf
Definition
bdlbb_blob.h:579
bsl::integral_constant
Definition
bslmf_integralconstant.h:261
bslmf::IsPair
Definition
bslmf_ispair.h:88
doxygen_input
bde
groups
bsl
bslmf
bslmf_ispair.h
Generated by
1.9.8