SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
-PREDEFINED = U_EXPORT2= U_STABLE= U_DRAFT= U_INTERNAL= U_SYSTEM= U_DEPRECATED= U_OBSOLETE= U_CALLCONV= U_CDECL_BEGIN= U_CDECL_END= U_NO_THROW=\ "U_NAMESPACE_BEGIN=namespace icu{" "U_NAMESPACE_END=}" U_SHOW_CPLUSPLUS_API=1 U_DEFINE_LOCAL_OPEN_POINTER()= U_IN_DOXYGEN=1 U_OVERRIDE=override U_FINAL=final UCONFIG_ENABLE_PLUGINS=1 U_CHAR16_IS_TYPEDEF=0 U_CPLUSPLUS_VERSION=11 U_HAVE_RVALUE_REFERENCES=1 U_WCHAR_IS_UTF16
+PREDEFINED = U_EXPORT2= U_STABLE= U_DRAFT= U_INTERNAL= U_SYSTEM= U_DEPRECATED= U_OBSOLETE= U_CALLCONV= U_CDECL_BEGIN= U_CDECL_END= U_NO_THROW=\ "U_NAMESPACE_BEGIN=namespace icu{" "U_NAMESPACE_END=}" U_SHOW_CPLUSPLUS_API=1 U_DEFINE_LOCAL_OPEN_POINTER()= U_IN_DOXYGEN=1 U_OVERRIDE=override U_FINAL=final UCONFIG_ENABLE_PLUGINS=1 U_CHAR16_IS_TYPEDEF=0 U_CPLUSPLUS_VERSION=11 U_WCHAR_IS_UTF16
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
* @param p simple pointer to an array of T items that is adopted
*/
explicit LocalMemory(T *p=NULL) : LocalPointerBase<T>(p) {}
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move constructor, leaves src with isNull().
* @param src source smart pointer
LocalMemory(LocalMemory<T> &&src) U_NOEXCEPT : LocalPointerBase<T>(src.ptr) {
src.ptr=NULL;
}
-#endif
/**
* Destructor deletes the memory it owns.
*/
~LocalMemory() {
uprv_free(LocalPointerBase<T>::ptr);
}
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move assignment operator, leaves src with isNull().
* The behavior is undefined if *this and src are the same object.
LocalMemory<T> &operator=(LocalMemory<T> &&src) U_NOEXCEPT {
return moveFrom(src);
}
-#endif
/**
* Move assignment, leaves src with isNull().
* The behavior is undefined if *this and src are the same object.
errorCode=U_MEMORY_ALLOCATION_ERROR;
}
}
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move constructor, leaves src with isNull().
* @param src source smart pointer
LocalPointer(LocalPointer<T> &&src) U_NOEXCEPT : LocalPointerBase<T>(src.ptr) {
src.ptr=NULL;
}
-#endif
/**
* Destructor deletes the object it owns.
* @stable ICU 4.4
~LocalPointer() {
delete LocalPointerBase<T>::ptr;
}
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move assignment operator, leaves src with isNull().
* The behavior is undefined if *this and src are the same object.
LocalPointer<T> &operator=(LocalPointer<T> &&src) U_NOEXCEPT {
return moveFrom(src);
}
-#endif
// do not use #ifndef U_HIDE_DRAFT_API for moveFrom, needed by non-draft API
/**
* Move assignment, leaves src with isNull().
errorCode=U_MEMORY_ALLOCATION_ERROR;
}
}
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move constructor, leaves src with isNull().
* @param src source smart pointer
LocalArray(LocalArray<T> &&src) U_NOEXCEPT : LocalPointerBase<T>(src.ptr) {
src.ptr=NULL;
}
-#endif
/**
* Destructor deletes the array it owns.
* @stable ICU 4.4
~LocalArray() {
delete[] LocalPointerBase<T>::ptr;
}
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move assignment operator, leaves src with isNull().
* The behavior is undefined if *this and src are the same object.
LocalArray<T> &operator=(LocalArray<T> &&src) U_NOEXCEPT {
return moveFrom(src);
}
-#endif
// do not use #ifndef U_HIDE_DRAFT_API for moveFrom, needed by non-draft API
/**
* Move assignment, leaves src with isNull().
* @see LocalPointer
* @stable ICU 4.4
*/
-#if U_HAVE_RVALUE_REFERENCES
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction) \
class LocalPointerClassName : public LocalPointerBase<Type> { \
public: \
ptr=p; \
} \
}
-#else
-#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction) \
- class LocalPointerClassName : public LocalPointerBase<Type> { \
- public: \
- using LocalPointerBase<Type>::operator*; \
- using LocalPointerBase<Type>::operator->; \
- explicit LocalPointerClassName(Type *p=NULL) : LocalPointerBase<Type>(p) {} \
- ~LocalPointerClassName() { closeFunction(ptr); } \
- LocalPointerClassName &moveFrom(LocalPointerClassName &src) U_NOEXCEPT { \
- if (ptr != NULL) { closeFunction(ptr); } \
- LocalPointerBase<Type>::ptr=src.ptr; \
- src.ptr=NULL; \
- return *this; \
- } \
- void swap(LocalPointerClassName &other) U_NOEXCEPT { \
- Type *temp=LocalPointerBase<Type>::ptr; \
- LocalPointerBase<Type>::ptr=other.ptr; \
- other.ptr=temp; \
- } \
- friend inline void swap(LocalPointerClassName &p1, LocalPointerClassName &p2) U_NOEXCEPT { \
- p1.swap(p2); \
- } \
- void adoptInstead(Type *p) { \
- if (ptr != NULL) { closeFunction(ptr); } \
- ptr=p; \
- } \
- }
-#endif
U_NAMESPACE_END
};
#endif
-/**
- * \def U_HAVE_RVALUE_REFERENCES
- * Set to 1 if the compiler supports rvalue references.
- * C++11 feature, necessary for move constructor & move assignment.
- * @internal
- */
-#ifdef U_HAVE_RVALUE_REFERENCES
- /* Use the predefined value. */
-#elif U_CPLUSPLUS_VERSION >= 11 || __has_feature(cxx_rvalue_references) \
- || defined(__GXX_EXPERIMENTAL_CXX0X__) \
- || (defined(_MSC_VER) && _MSC_VER >= 1600) /* Visual Studio 2010 */
-# define U_HAVE_RVALUE_REFERENCES 1
-#else
-# define U_HAVE_RVALUE_REFERENCES 0
-#endif
-
/**
* \def U_NOEXCEPT
* "noexcept" if supported, otherwise empty.
*/
UnicodeString &fastCopyFrom(const UnicodeString &src);
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move assignment operator, might leave src in bogus state.
* This string will have the same contents and state that the source string had.
UnicodeString &operator=(UnicodeString &&src) U_NOEXCEPT {
return moveFrom(src);
}
-#endif
+
// do not use #ifndef U_HIDE_DRAFT_API for moveFrom, needed by non-draft API
/**
* Move assignment, might leave src in bogus state.
*/
UnicodeString(const UnicodeString& that);
-#if U_HAVE_RVALUE_REFERENCES
/**
* Move constructor, might leave src in bogus state.
* This string will have the same contents and state that the source string had.
* @stable ICU 56
*/
UnicodeString(UnicodeString &&src) U_NOEXCEPT;
-#endif
/**
* 'Substring' constructor from tail of source string.
copyFrom(that);
}
-#if U_HAVE_RVALUE_REFERENCES
UnicodeString::UnicodeString(UnicodeString &&src) U_NOEXCEPT {
fUnion.fFields.fLengthAndFlags = kShortString;
moveFrom(src);
}
-#endif
UnicodeString::UnicodeString(const UnicodeString& that,
int32_t srcStart) {
if(s3.getAlias() != p1 || s1.isValid()) {
errln("LocalPointer.moveFrom() did not move");
}
-#if U_HAVE_RVALUE_REFERENCES
infoln("TestLocalPointerMoveSwap() with rvalue references");
s1 = static_cast<LocalPointer<UnicodeString> &&>(s3);
if(s1.getAlias() != p1 || s3.isValid()) {
if(s4.getAlias() != p2 || s2.isValid()) {
errln("LocalPointer move constructor did not move");
}
-#else
- infoln("TestLocalPointerMoveSwap() without rvalue references");
-#endif
// Move self assignment leaves the object valid but in an undefined state.
// Do it to make sure there is no crash,
if(a3.getAlias() != p1 || a1.isValid()) {
errln("LocalArray.moveFrom() did not move");
}
-#if U_HAVE_RVALUE_REFERENCES
infoln("TestLocalArrayMoveSwap() with rvalue references");
a1 = static_cast<LocalArray<UnicodeString> &&>(a3);
if(a1.getAlias() != p1 || a3.isValid()) {
if(a4.getAlias() != p2 || a2.isValid()) {
errln("LocalArray move constructor did not move");
}
-#else
- infoln("TestLocalArrayMoveSwap() without rvalue references");
-#endif
// Move self assignment leaves the object valid but in an undefined state.
// Do it to make sure there is no crash,
if(f3.getAlias() != p1 || f1.isValid()) {
errln("LocalUNormalizer2Pointer.moveFrom() did not move");
}
-#if U_HAVE_RVALUE_REFERENCES
infoln("TestLocalXyzPointerMoveSwap() with rvalue references");
f1 = static_cast<LocalUNormalizer2Pointer &&>(f3);
if(f1.getAlias() != p1 || f3.isValid()) {
if(f4.getAlias() != p2 || f2.isValid()) {
errln("LocalUNormalizer2Pointer move constructor did not move");
}
-#else
- infoln("TestLocalXyzPointerMoveSwap() without rvalue references");
-#endif
// Move self assignment leaves the object valid but in an undefined state.
// Do it to make sure there is no crash,
// but do not check for any particular resulting value.
if(s6.getBuffer() != abc || s6.length() != 3) {
errln("UnicodeString.moveFrom(alias) did not move");
}
-#if U_HAVE_RVALUE_REFERENCES
infoln("TestMoveSwap() with rvalue references");
s1 = static_cast<UnicodeString &&>(s6);
if(s1.getBuffer() != abc || s1.length() != 3) {
if(s7.getBuffer() != p || s7.length() != 100 || !s4.isBogus()) {
errln("UnicodeString move constructor did not move");
}
-#else
- infoln("TestMoveSwap() without rvalue references");
- UnicodeString s7;
-#endif
// Move self assignment leaves the object valid but in an undefined state.
// Do it to make sure there is no crash,