BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslalg_hasstliterators.h
Go to the documentation of this file.
1/// @file bslalg_hasstliterators.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslalg_hasstliterators.h -*-C++-*-
8#ifndef INCLUDED_BSLALG_HASSTLITERATORS
9#define INCLUDED_BSLALG_HASSTLITERATORS
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslalg_hasstliterators bslalg_hasstliterators
15/// @brief Provide a tag type used to detect STL-like iterators traits.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslalg
19/// @{
20/// @addtogroup bslalg_hasstliterators
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslalg_hasstliterators-purpose"> Purpose</a>
25/// * <a href="#bslalg_hasstliterators-classes"> Classes </a>
26/// * <a href="#bslalg_hasstliterators-description"> Description </a>
27///
28/// # Purpose {#bslalg_hasstliterators-purpose}
29/// Provide a tag type used to detect STL-like iterators traits.
30///
31/// # Classes {#bslalg_hasstliterators-classes}
32///
33/// - bslalg::HasStlIterators: tag type to detect STL-like iterators traits
34///
35/// @see bslmf_detecttestedtraits, bslalg_typetraithasstliterators
36///
37/// # Description {#bslalg_hasstliterators-description}
38/// This component defines a tag type `HasStlIterators` derived
39/// from `bslmf::DetectNestedTrait` type. The type defines a metafunction that
40/// detects if a class has STL-like iterators, and provides a type
41/// `HasStilIterators<TYPE>::value` which aliases `true_type` if `TYPE` has
42/// STL-like iterators, and `false_type` otherwise.
43///
44/// A `TYPE` that has this trait fulfills the following requirements, where `mX`
45/// is a modifiable object and `X` a non-modifiable object of `TYPE`:
46/// @code
47/// Valid expression Type Note
48/// ---------------- ---- ----
49/// TYPE::iterator Iterator type (has 'operator->',
50/// 'operator*', and possibly more
51/// depending on the iterator
52/// category).
53///
54/// TYPE::const_iterator Iterator type (has 'operator->',
55/// 'operator*', and possibly more
56/// depending on the iterator
57/// category). The value type of this
58/// iterator is not modifiable.
59///
60/// mX.begin() iterator Similar to standard containers
61/// mX.end() iterator
62/// X.begin() const_iterator
63/// X.end() const_iterator
64/// X.cbegin() const_iterator
65/// X.cend() const_iterator
66/// @endcode
67/// @}
68/** @} */
69/** @} */
70
71/** @addtogroup bsl
72 * @{
73 */
74/** @addtogroup bslalg
75 * @{
76 */
77/** @addtogroup bslalg_hasstliterators
78 * @{
79 */
80
81#include <bslscm_version.h>
82
84
85
86
87namespace bslalg {
88
89 //=======================
90 // struct HasStlIterators
91 //=======================
92
93/// This class detects if the specified class `TYPE` has STL-like iterators.
94/// If the class `TYPE` provides STL-like iterators then
95/// `HasStlIterators<TYPE>::value == true`, and
96/// `HasStlIterators<TYPE>::value == false` otherwise.
97template <class TYPE>
98struct HasStlIterators : bslmf::DetectNestedTrait<TYPE, HasStlIterators>
99{
100};
101
102} // close package namespace
103
104
105
106#endif
107
108// ----------------------------------------------------------------------------
109// Copyright 2016 Bloomberg Finance L.P.
110//
111// Licensed under the Apache License, Version 2.0 (the "License");
112// you may not use this file except in compliance with the License.
113// You may obtain a copy of the License at
114//
115// http://www.apache.org/licenses/LICENSE-2.0
116//
117// Unless required by applicable law or agreed to in writing, software
118// distributed under the License is distributed on an "AS IS" BASIS,
119// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
120// See the License for the specific language governing permissions and
121// limitations under the License.
122// ----------------------------- END-OF-FILE ----------------------------------
123
124/** @} */
125/** @} */
126/** @} */
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlc_flathashmap.h:1805
Definition bslalg_hasstliterators.h:99
Definition bslmf_detectnestedtrait.h:464