libstdc++
enable_special_members.h
Go to the documentation of this file.
1// <bits/enable_special_members.h> -*- C++ -*-
2
3// Copyright (C) 2013-2016 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file bits/enable_special_members.h
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly.
28 */
29
30#ifndef _ENABLE_SPECIAL_MEMBERS_H
31#define _ENABLE_SPECIAL_MEMBERS_H 1
32
33#pragma GCC system_header
34
35namespace std _GLIBCXX_VISIBILITY(default)
36{
37_GLIBCXX_BEGIN_NAMESPACE_VERSION
38
39/**
40 * @brief A mixin helper to conditionally enable or disable the default
41 * constructor.
42 * @sa _Enable_special_members
43 */
44template<bool _Switch, typename _Tag = void>
46
47
48/**
49 * @brief A mixin helper to conditionally enable or disable the default
50 * destructor.
51 * @sa _Enable_special_members
52 */
53template<bool _Switch, typename _Tag = void>
55
56/**
57 * @brief A mixin helper to conditionally enable or disable the copy/move
58 * special members.
59 * @sa _Enable_special_members
60 */
61template<bool _Copy, bool _CopyAssignment,
62 bool _Move, bool _MoveAssignment,
63 typename _Tag = void>
65
66/**
67 * @brief A mixin helper to conditionally enable or disable the special
68 * members.
69 *
70 * The @c _Tag type parameter is to make mixin bases unique and thus avoid
71 * ambiguities.
72 */
73template<bool _Default, bool _Destructor,
74 bool _Copy, bool _CopyAssignment,
75 bool _Move, bool _MoveAssignment,
76 typename _Tag = void>
78 : private _Enable_default_constructor<_Default, _Tag>,
79 private _Enable_destructor<_Destructor, _Tag>,
80 private _Enable_copy_move<_Copy, _CopyAssignment,
81 _Move, _MoveAssignment,
82 _Tag>
83 { };
84
85// Boilerplate follows.
86
87template<typename _Tag>
90
94
97 {
105 };
106
107template<typename _Tag>
109 {
110 constexpr _Enable_copy_move() noexcept = default;
117 };
118
119template<typename _Tag>
121 {
122 constexpr _Enable_copy_move() noexcept = default;
129 };
130
131template<typename _Tag>
133 {
134 constexpr _Enable_copy_move() noexcept = default;
141 };
142
143template<typename _Tag>
145 {
146 constexpr _Enable_copy_move() noexcept = default;
153 };
154
155template<typename _Tag>
157 {
158 constexpr _Enable_copy_move() noexcept = default;
165 };
166
167template<typename _Tag>
169 {
170 constexpr _Enable_copy_move() noexcept = default;
177 };
178
179template<typename _Tag>
181 {
182 constexpr _Enable_copy_move() noexcept = default;
189 };
190
191template<typename _Tag>
193 {
194 constexpr _Enable_copy_move() noexcept = default;
201 };
202
203template<typename _Tag>
205 {
206 constexpr _Enable_copy_move() noexcept = default;
213 };
214
215template<typename _Tag>
217 {
218 constexpr _Enable_copy_move() noexcept = default;
225 };
226
227template<typename _Tag>
229 {
230 constexpr _Enable_copy_move() noexcept = default;
237 };
238
239template<typename _Tag>
241 {
242 constexpr _Enable_copy_move() noexcept = default;
249 };
250
251template<typename _Tag>
253 {
254 constexpr _Enable_copy_move() noexcept = default;
261 };
262
263template<typename _Tag>
265 {
266 constexpr _Enable_copy_move() noexcept = default;
273 };
274
275_GLIBCXX_END_NAMESPACE_VERSION
276} // namespace std
277
278#endif // _ENABLE_SPECIAL_MEMBERS_H
ISO C++ entities toplevel namespace is std.
A mixin helper to conditionally enable or disable the default constructor.
A mixin helper to conditionally enable or disable the default destructor.
A mixin helper to conditionally enable or disable the copy/move special members.
A mixin helper to conditionally enable or disable the special members.