8#ifndef INCLUDED_BSLMF_MOVABLEREF
9#define INCLUDED_BSLMF_MOVABLEREF
651#include <bslscm_version.h>
670#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \
671 defined(BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES)
672#define BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
680#if defined(BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES)
687# define BSLMF_MOVABLEREF_DEDUCE(...) \
688 ::BloombergLP::bslmf::MovableRef_Deduced<__VA_ARGS__>
690# define BSLMF_MOVABLEREF_DEDUCE(...) \
691 ::BloombergLP::bslmf::MovableRef<__VA_ARGS__>
697struct MovableRefUtil;
701template <
class t_TYPE>
702struct MovableRefUtil_AddLvalueReference;
705template <
class t_TYPE>
706struct MovableRefUtil_AddMovableReference;
709template <
class t_TYPE>
710struct MovableRefUtil_Decay;
713template <
class t_TYPE>
714struct MovableRefUtil_PropertyTraits;
717template <
class t_TYPE>
718struct MovableRefUtil_RemoveReference;
720#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
723template <
class t_TYPE>
724struct MovableRef_Helper;
732#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
736template <
class t_TYPE>
737using MovableRef =
typename MovableRef_Helper<t_TYPE>::type;
750template <
class t_TYPE>
777 operator t_TYPE&()
const;
799 template <
class t_TYPE>
807 template <
class t_TYPE>
816 template <
class t_TYPE>
824 template <
class t_TYPE>
834 template <
class t_TYPE>
844 template <
class t_TYPE>
862 template <
class t_TYPE>
867#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
868 template <
class t_TYPE>
869 static typename bsl::remove_reference<t_TYPE>::type&
access(
872 template <
class t_TYPE>
874 template <
class t_TYPE>
887#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
888 template <
class t_TYPE>
893 template <
class t_TYPE>
895 template <
class t_TYPE>
910 template <
class t_TYPE>
931 template <
class t_TYPE>
942#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
943 return static_cast<typename bsl::remove_reference<t_TYPE>::type&&
>(
951#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
960template <
class t_TYPE>
961struct MovableRef_Helper {
968 using type = t_TYPE&&;
977template <
class t_TYPE,
980using MovableRef_Deduced = t_TYPE&&;
992#ifndef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
995template <
class t_TYPE>
997MovableRef<t_TYPE>::MovableRef(t_TYPE *pointer)
1004template <
class t_TYPE>
1017#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
1020template <
class t_TYPE>
1030template <
class t_TYPE>
1037template <
class t_TYPE>
1046#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
1048template <
class t_TYPE>
1053 return static_cast<typename bsl::remove_reference<t_TYPE>::type&&
>(rvalue);
1058template <
class t_TYPE>
1065template <
class t_TYPE>
1079#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
1083template <
class t_TYPE>
1096template <
class t_TYPE>
1106template <
class t_TYPE>
1117template <
class t_TYPE>
1125template <
class t_TYPE>
1130template <
class t_TYPE>
1135template <
class t_TYPE>
1140template <
class t_TYPE>
1144template <
class t_TYPE>
1148template <
class t_TYPE>
1152template <
class t_TYPE>
1162#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
1168template <
class t_TYPE>
1174template <
class t_TYPE>
1180template <
class t_TYPE>
1186template <
class t_TYPE>
1192template <
class t_TYPE>
1198template <
class t_TYPE>
1204template <
class t_TYPE>
1210template <
class t_TYPE>
1214template <
class t_TYPE>
1218template <
class t_TYPE>
1222template <
class t_TYPE>
1232#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
1240template <
class t_TYPE>
1270template <
class t_TYPE>
1276template <
class t_TYPE>
1282template <
class t_TYPE>
1288template <
class t_TYPE>
1294template <
class t_TYPE>
1300template <
class t_TYPE>
1306template <
class t_TYPE>
1310template <
class t_TYPE>
1314template <
class t_TYPE>
1318template <
class t_TYPE>
1328#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
1337template <
class t_TYPE>
1367template <
class t_TYPE>
1373template <
class t_TYPE>
1379template <
class t_TYPE>
1385template <
class t_TYPE>
1391template <
class t_TYPE>
1397template <
class t_TYPE>
1403template <
class t_TYPE>
1407template <
class t_TYPE>
1411template <
class t_TYPE>
1415template <
class t_TYPE>
1425#ifdef BSLMF_MOVABLEREF_USES_RVALUE_REFERENCES
1440template <
class t_TYPE>
1444#elif !defined(BSLS_PLATFORM_CMP_IBM) || BSLS_PLATFORM_CMP_VERSION > 4097
1451template <
class t_TYPE>
1453:
bsl::decay<typename MovableRefUtil_RemoveReference<t_TYPE>::type> {
1491template <class t_TYPE, bool t_IS_FUNCTION = bsl::is_function<t_TYPE>::value>
1492struct MovableRefUtil_DecayImp;
1494template <
class t_TYPE>
1495struct MovableRefUtil_DecayImp<t_TYPE, false>
1499template <
class t_TYPE>
1500struct MovableRefUtil_DecayImp<t_TYPE, true> {
1501 typedef t_TYPE *type;
1504template <
class t_TYPE>
1505struct MovableRefUtil_Decay : MovableRefUtil_DecayImp<t_TYPE> {
1508template <
class t_TYPE>
1509struct MovableRefUtil_Decay<t_TYPE&> : MovableRefUtil_DecayImp<t_TYPE> {
1512template <
class t_TYPE>
1513struct MovableRefUtil_Decay<MovableRef<t_TYPE> >
1514: MovableRefUtil_DecayImp<t_TYPE> {
1517template <
class t_TYPE>
1518struct MovableRefUtil_Decay<MovableRef<t_TYPE>&>
1519: MovableRefUtil_DecayImp<t_TYPE> {
1522template <
class t_TYPE>
1523struct MovableRefUtil_Decay<const MovableRef<t_TYPE> >
1524: MovableRefUtil_DecayImp<t_TYPE> {
1527template <
class t_TYPE>
1528struct MovableRefUtil_Decay<const MovableRef<t_TYPE>&>
1529: MovableRefUtil_DecayImp<t_TYPE> {
1532template <
class t_TYPE>
1533struct MovableRefUtil_Decay<volatile MovableRef<t_TYPE> >;
1536template <
class t_TYPE>
1537struct MovableRefUtil_Decay<volatile MovableRef<t_TYPE>&>;
1540template <
class t_TYPE>
1541struct MovableRefUtil_Decay<const volatile MovableRef<t_TYPE> >;
1544template <
class t_TYPE>
1545struct MovableRefUtil_Decay<const volatile MovableRef<t_TYPE>&>;
Definition bslmf_decay.h:157
Definition bslmf_movableref.h:751
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_CONSTEXPR
Definition bsls_keyword.h:588
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
Definition bdlbb_blob.h:576
Definition bslmf_addlvaluereference.h:126
Definition bslmf_enableif.h:525
Definition bslmf_integralconstant.h:244
Definition bslmf_iscopyconstructible.h:242
Definition bslmf_islvaluereference.h:125
Definition bslmf_isnothrowmoveconstructible.h:358
Definition bslmf_isreference.h:137
Definition bslmf_isrvaluereference.h:126
Definition bslmf_movableref.h:835
Definition bslmf_movableref.h:845
Definition bslmf_movableref.h:863
Definition bslmf_movableref.h:801
Definition bslmf_movableref.h:809
Definition bslmf_movableref.h:817
Definition bslmf_movableref.h:825
t_TYPE & type
Definition bslmf_movableref.h:1285
t_TYPE & type
Definition bslmf_movableref.h:1291
t_TYPE & type
Definition bslmf_movableref.h:1297
t_TYPE & type
Definition bslmf_movableref.h:1303
const void type
Definition bslmf_movableref.h:1255
const volatile void type
Definition bslmf_movableref.h:1267
t_TYPE & type
Definition bslmf_movableref.h:1279
void type
Definition bslmf_movableref.h:1249
volatile void type
Definition bslmf_movableref.h:1261
forward declaration
Definition bslmf_movableref.h:1271
t_TYPE & type
Definition bslmf_movableref.h:1273
bslmf::MovableRef< t_TYPE > type
Definition bslmf_movableref.h:1382
bslmf::MovableRef< t_TYPE > type
Definition bslmf_movableref.h:1388
bslmf::MovableRef< t_TYPE > type
Definition bslmf_movableref.h:1394
bslmf::MovableRef< t_TYPE > type
Definition bslmf_movableref.h:1400
const void type
Definition bslmf_movableref.h:1352
const volatile void type
Definition bslmf_movableref.h:1364
t_TYPE & type
Definition bslmf_movableref.h:1376
void type
Definition bslmf_movableref.h:1346
volatile void type
Definition bslmf_movableref.h:1358
forward declaration
Definition bslmf_movableref.h:1368
bslmf::MovableRef< t_TYPE > type
Definition bslmf_movableref.h:1370
forward declaration
Definition bslmf_movableref.h:1453
bsl::true_type IsReference
Definition bslmf_movableref.h:1122
bsl::true_type IsMovableReference
Definition bslmf_movableref.h:1121
bsl::false_type IsLvalueReference
Definition bslmf_movableref.h:1120
bsl::false_type IsMovableReference
Definition bslmf_movableref.h:1110
bsl::true_type IsReference
Definition bslmf_movableref.h:1111
bsl::true_type IsLvalueReference
Definition bslmf_movableref.h:1109
forward declaration
Definition bslmf_movableref.h:1097
bsl::false_type IsLvalueReference
Definition bslmf_movableref.h:1099
bsl::false_type IsReference
Definition bslmf_movableref.h:1101
bsl::false_type IsMovableReference
Definition bslmf_movableref.h:1100
t_TYPE type
Definition bslmf_movableref.h:1189
t_TYPE type
Definition bslmf_movableref.h:1195
t_TYPE type
Definition bslmf_movableref.h:1201
t_TYPE type
Definition bslmf_movableref.h:1207
t_TYPE type
Definition bslmf_movableref.h:1183
forward declaration
Definition bslmf_movableref.h:1175
t_TYPE type
Definition bslmf_movableref.h:1177
Definition bslmf_movableref.h:791
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1060
static bsl::enable_if<!bsl::is_copy_constructible< t_TYPE >::value||bsl::is_nothrow_move_constructible< t_TYPE >::value, MovableRef< t_TYPE > >::type move_if_noexcept(t_TYPE &lvalue) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:936
static t_TYPE & access(t_TYPE &ref) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1032
static bsl::enable_if<!bsl::is_nothrow_move_constructible< t_TYPE >::value &&bsl::is_copy_constructible< t_TYPE >::value, constt_TYPE & >::type move_if_noexcept(t_TYPE &lvalue) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:915
static TYPE * addressOf(TYPE &obj)
Definition bsls_util.h:305