Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | ////////////////////////////////////////////////////////////////////////////// |
| 2 | // |
| 3 | // (C) Copyright Ion Gaztanaga 2012-2012. |
| 4 | // Distributed under the Boost Software License, Version 1.0. |
| 5 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
| 7 | // |
| 8 | // See http://www.boost.org/libs/move for documentation. |
| 9 | // |
| 10 | ////////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | //! \file core.hpp |
| 13 | //! This header implements macros to define movable classes and |
| 14 | //! move-aware functions |
| 15 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 16 | #ifndef NDNBOOST_MOVE_CORE_HPP |
| 17 | #define NDNBOOST_MOVE_CORE_HPP |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 18 | |
| 19 | #include <ndnboost/move/detail/config_begin.hpp> |
| 20 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 21 | #ifdef NDNBOOST_NO_CXX11_DELETED_FUNCTIONS |
| 22 | #define NDNBOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 23 | private:\ |
| 24 | TYPE(TYPE &);\ |
| 25 | TYPE& operator=(TYPE &);\ |
| 26 | // |
| 27 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 28 | #define NDNBOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 29 | public:\ |
| 30 | TYPE(TYPE const &) = delete;\ |
| 31 | TYPE& operator=(TYPE const &) = delete;\ |
| 32 | private:\ |
| 33 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 34 | #endif //NDNBOOST_NO_CXX11_DELETED_FUNCTIONS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 35 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 36 | #if defined(NDNBOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(NDNBOOST_MOVE_DOXYGEN_INVOKED) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 37 | |
| 38 | #include <ndnboost/move/detail/meta_utils.hpp> |
| 39 | |
| 40 | //Move emulation rv breaks standard aliasing rules so add workarounds for some compilers |
| 41 | #if defined(__GNUC__) && (__GNUC__ >= 4) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 42 | #define NDNBOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 43 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 44 | #define NDNBOOST_MOVE_ATTRIBUTE_MAY_ALIAS |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 45 | #endif |
| 46 | |
| 47 | namespace ndnboost { |
| 48 | |
| 49 | ////////////////////////////////////////////////////////////////////////////// |
| 50 | // |
| 51 | // struct rv |
| 52 | // |
| 53 | ////////////////////////////////////////////////////////////////////////////// |
| 54 | template <class T> |
| 55 | class rv |
| 56 | : public ::ndnboost::move_detail::if_c |
| 57 | < ::ndnboost::move_detail::is_class_or_union<T>::value |
| 58 | , T |
| 59 | , ::ndnboost::move_detail::empty |
| 60 | >::type |
| 61 | { |
| 62 | rv(); |
| 63 | ~rv(); |
| 64 | rv(rv const&); |
| 65 | void operator=(rv const&); |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 66 | } NDNBOOST_MOVE_ATTRIBUTE_MAY_ALIAS; |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 67 | |
| 68 | |
| 69 | ////////////////////////////////////////////////////////////////////////////// |
| 70 | // |
| 71 | // move_detail::is_rv |
| 72 | // |
| 73 | ////////////////////////////////////////////////////////////////////////////// |
| 74 | |
| 75 | namespace move_detail { |
| 76 | |
| 77 | template <class T> |
| 78 | struct is_rv |
| 79 | : ::ndnboost::move_detail::integral_constant<bool, false> |
| 80 | {}; |
| 81 | |
| 82 | template <class T> |
| 83 | struct is_rv< rv<T> > |
| 84 | : ::ndnboost::move_detail::integral_constant<bool, true> |
| 85 | {}; |
| 86 | |
| 87 | template <class T> |
| 88 | struct is_rv< const rv<T> > |
| 89 | : ::ndnboost::move_detail::integral_constant<bool, true> |
| 90 | {}; |
| 91 | |
| 92 | } //namespace move_detail { |
| 93 | |
| 94 | ////////////////////////////////////////////////////////////////////////////// |
| 95 | // |
| 96 | // has_move_emulation_enabled |
| 97 | // |
| 98 | ////////////////////////////////////////////////////////////////////////////// |
| 99 | template<class T> |
| 100 | struct has_move_emulation_enabled |
| 101 | : ::ndnboost::move_detail::is_convertible< T, ::ndnboost::rv<T>& > |
| 102 | {}; |
| 103 | |
| 104 | template<class T> |
| 105 | struct has_move_emulation_enabled<T&> |
| 106 | : ::ndnboost::move_detail::integral_constant<bool, false> |
| 107 | {}; |
| 108 | |
| 109 | template<class T> |
| 110 | struct has_move_emulation_enabled< ::ndnboost::rv<T> > |
| 111 | : ::ndnboost::move_detail::integral_constant<bool, false> |
| 112 | {}; |
| 113 | |
| 114 | } //namespace ndnboost { |
| 115 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 116 | #define NDNBOOST_RV_REF(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 117 | ::ndnboost::rv< TYPE >& \ |
| 118 | // |
| 119 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 120 | #define NDNBOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 121 | ::ndnboost::rv< TYPE<ARG1, ARG2> >& \ |
| 122 | // |
| 123 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 124 | #define NDNBOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 125 | ::ndnboost::rv< TYPE<ARG1, ARG2, ARG3> >& \ |
| 126 | // |
| 127 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 128 | #define NDNBOOST_RV_REF_BEG\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 129 | ::ndnboost::rv< \ |
| 130 | // |
| 131 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 132 | #define NDNBOOST_RV_REF_END\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 133 | >& \ |
| 134 | // |
| 135 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 136 | #define NDNBOOST_FWD_REF(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 137 | const TYPE & \ |
| 138 | // |
| 139 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 140 | #define NDNBOOST_COPY_ASSIGN_REF(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 141 | const ::ndnboost::rv< TYPE >& \ |
| 142 | // |
| 143 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 144 | #define NDNBOOST_COPY_ASSIGN_REF_BEG \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 145 | const ::ndnboost::rv< \ |
| 146 | // |
| 147 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 148 | #define NDNBOOST_COPY_ASSIGN_REF_END \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 149 | >& \ |
| 150 | // |
| 151 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 152 | #define NDNBOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 153 | const ::ndnboost::rv< TYPE<ARG1, ARG2> >& \ |
| 154 | // |
| 155 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 156 | #define NDNBOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 157 | const ::ndnboost::rv< TYPE<ARG1, ARG2, ARG3> >& \ |
| 158 | // |
| 159 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 160 | #define NDNBOOST_CATCH_CONST_RLVALUE(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 161 | const ::ndnboost::rv< TYPE >& \ |
| 162 | // |
| 163 | |
| 164 | ////////////////////////////////////////////////////////////////////////////// |
| 165 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 166 | // NDNBOOST_MOVABLE_BUT_NOT_COPYABLE |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 167 | // |
| 168 | ////////////////////////////////////////////////////////////////////////////// |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 169 | #define NDNBOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\ |
| 170 | NDNBOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 171 | public:\ |
| 172 | operator ::ndnboost::rv<TYPE>&() \ |
| 173 | { return *static_cast< ::ndnboost::rv<TYPE>* >(this); }\ |
| 174 | operator const ::ndnboost::rv<TYPE>&() const \ |
| 175 | { return *static_cast<const ::ndnboost::rv<TYPE>* >(this); }\ |
| 176 | private:\ |
| 177 | // |
| 178 | |
| 179 | ////////////////////////////////////////////////////////////////////////////// |
| 180 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 181 | // NDNBOOST_COPYABLE_AND_MOVABLE |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 182 | // |
| 183 | ////////////////////////////////////////////////////////////////////////////// |
| 184 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 185 | #define NDNBOOST_COPYABLE_AND_MOVABLE(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 186 | public:\ |
| 187 | TYPE& operator=(TYPE &t)\ |
| 188 | { this->operator=(static_cast<const ::ndnboost::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\ |
| 189 | public:\ |
| 190 | operator ::ndnboost::rv<TYPE>&() \ |
| 191 | { return *static_cast< ::ndnboost::rv<TYPE>* >(this); }\ |
| 192 | operator const ::ndnboost::rv<TYPE>&() const \ |
| 193 | { return *static_cast<const ::ndnboost::rv<TYPE>* >(this); }\ |
| 194 | private:\ |
| 195 | // |
| 196 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 197 | #define NDNBOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 198 | public:\ |
| 199 | operator ::ndnboost::rv<TYPE>&() \ |
| 200 | { return *static_cast< ::ndnboost::rv<TYPE>* >(this); }\ |
| 201 | operator const ::ndnboost::rv<TYPE>&() const \ |
| 202 | { return *static_cast<const ::ndnboost::rv<TYPE>* >(this); }\ |
| 203 | private:\ |
| 204 | // |
| 205 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 206 | #else //NDNBOOST_NO_CXX11_RVALUE_REFERENCES |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 207 | |
| 208 | //Compiler workaround detection |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 209 | #if !defined(NDNBOOST_MOVE_DOXYGEN_INVOKED) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 210 | #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__) |
| 211 | //Pre-standard rvalue binding rules |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 212 | #define NDNBOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 213 | #elif defined(_MSC_VER) && (_MSC_VER == 1600) |
| 214 | //Standard rvalue binding rules but with some bugs |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 215 | #define NDNBOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 216 | //Use standard library for MSVC to avoid namespace issues as |
| 217 | //some move calls in the STL are not fully qualified. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 218 | //#define NDNBOOST_MOVE_USE_STANDARD_LIBRARY_MOVE |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 219 | #endif |
| 220 | #endif |
| 221 | |
| 222 | //! This macro marks a type as movable but not copyable, disabling copy construction |
| 223 | //! and assignment. The user will need to write a move constructor/assignment as explained |
| 224 | //! in the documentation to fully write a movable but not copyable class. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 225 | #define NDNBOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\ |
| 226 | NDNBOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 227 | public:\ |
| 228 | typedef int boost_move_emulation_t;\ |
| 229 | // |
| 230 | |
| 231 | //! This macro marks a type as copyable and movable. |
| 232 | //! The user will need to write a move constructor/assignment and a copy assignment |
| 233 | //! as explained in the documentation to fully write a copyable and movable class. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 234 | #define NDNBOOST_COPYABLE_AND_MOVABLE(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 235 | // |
| 236 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 237 | #if !defined(NDNBOOST_MOVE_DOXYGEN_INVOKED) |
| 238 | #define NDNBOOST_COPYABLE_AND_MOVABLE_ALT(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 239 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 240 | #endif //#if !defined(NDNBOOST_MOVE_DOXYGEN_INVOKED) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 241 | |
| 242 | namespace ndnboost { |
| 243 | |
| 244 | //!This trait yields to a compile-time true boolean if T was marked as |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 245 | //!NDNBOOST_MOVABLE_BUT_NOT_COPYABLE or NDNBOOST_COPYABLE_AND_MOVABLE and |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 246 | //!rvalue references are not available on the platform. False otherwise. |
| 247 | template<class T> |
| 248 | struct has_move_emulation_enabled |
| 249 | { |
| 250 | static const bool value = false; |
| 251 | }; |
| 252 | |
| 253 | } //namespace ndnboost{ |
| 254 | |
| 255 | //!This macro is used to achieve portable syntax in move |
| 256 | //!constructors and assignments for classes marked as |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 257 | //!NDNBOOST_COPYABLE_AND_MOVABLE or NDNBOOST_MOVABLE_BUT_NOT_COPYABLE |
| 258 | #define NDNBOOST_RV_REF(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 259 | TYPE && \ |
| 260 | // |
| 261 | |
| 262 | //!This macro is used to achieve portable syntax in move |
| 263 | //!constructors and assignments for template classes marked as |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 264 | //!NDNBOOST_COPYABLE_AND_MOVABLE or NDNBOOST_MOVABLE_BUT_NOT_COPYABLE. |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 265 | //!As macros have problems with comma-separatd template arguments, |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 266 | //!the template argument must be preceded with NDNBOOST_RV_REF_START |
| 267 | //!and ended with NDNBOOST_RV_REF_END |
| 268 | #define NDNBOOST_RV_REF_BEG\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 269 | \ |
| 270 | // |
| 271 | |
| 272 | //!This macro is used to achieve portable syntax in move |
| 273 | //!constructors and assignments for template classes marked as |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 274 | //!NDNBOOST_COPYABLE_AND_MOVABLE or NDNBOOST_MOVABLE_BUT_NOT_COPYABLE. |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 275 | //!As macros have problems with comma-separatd template arguments, |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 276 | //!the template argument must be preceded with NDNBOOST_RV_REF_START |
| 277 | //!and ended with NDNBOOST_RV_REF_END |
| 278 | #define NDNBOOST_RV_REF_END\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 279 | && \ |
| 280 | |
| 281 | //!This macro is used to achieve portable syntax in copy |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 282 | //!assignment for classes marked as NDNBOOST_COPYABLE_AND_MOVABLE. |
| 283 | #define NDNBOOST_COPY_ASSIGN_REF(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 284 | const TYPE & \ |
| 285 | // |
| 286 | |
| 287 | //! This macro is used to implement portable perfect forwarding |
| 288 | //! as explained in the documentation. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 289 | #define NDNBOOST_FWD_REF(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 290 | TYPE && \ |
| 291 | // |
| 292 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 293 | #if !defined(NDNBOOST_MOVE_DOXYGEN_INVOKED) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 294 | /// @cond |
| 295 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 296 | #define NDNBOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 297 | TYPE<ARG1, ARG2> && \ |
| 298 | // |
| 299 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 300 | #define NDNBOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 301 | TYPE<ARG1, ARG2, ARG3> && \ |
| 302 | // |
| 303 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 304 | #define NDNBOOST_COPY_ASSIGN_REF_BEG \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 305 | const \ |
| 306 | // |
| 307 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 308 | #define NDNBOOST_COPY_ASSIGN_REF_END \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 309 | & \ |
| 310 | // |
| 311 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 312 | #define NDNBOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 313 | const TYPE<ARG1, ARG2> & \ |
| 314 | // |
| 315 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 316 | #define NDNBOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 317 | const TYPE<ARG1, ARG2, ARG3>& \ |
| 318 | // |
| 319 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 320 | #define NDNBOOST_CATCH_CONST_RLVALUE(TYPE)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 321 | const TYPE & \ |
| 322 | // |
| 323 | |
| 324 | /// @endcond |
| 325 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 326 | #endif //#if !defined(NDNBOOST_MOVE_DOXYGEN_INVOKED) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 327 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 328 | #endif //NDNBOOST_NO_CXX11_RVALUE_REFERENCES |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 329 | |
| 330 | #include <ndnboost/move/detail/config_end.hpp> |
| 331 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 332 | #endif //#ifndef NDNBOOST_MOVE_CORE_HPP |