Warning, file /include/QtCore/q17memory.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003 #ifndef Q17MEMORY_H
0004 #define Q17MEMORY_H
0005
0006 #include <QtCore/qexceptionhandling.h>
0007 #include <QtCore/qtconfigmacros.h>
0008
0009 #include <iterator>
0010 #include <memory>
0011
0012 QT_BEGIN_NAMESPACE
0013
0014 namespace q17 {
0015
0016 #if !defined(Q_OS_VXWORKS)
0017 using std::uninitialized_value_construct;
0018 #else
0019 namespace _detail {
0020 template <typename T>
0021 void *voidify(T &t) {
0022
0023 return const_cast<void*>(static_cast<const volatile void*>(std::addressof(t)));
0024 }
0025 }
0026
0027
0028
0029 template <typename ForwardIt>
0030 void uninitialized_value_construct(ForwardIt first, ForwardIt last)
0031 {
0032 auto current = first;
0033 using ValueType = typename std::iterator_traits<ForwardIt>::value_type;
0034 QT_TRY {
0035 for (; current != last; ++current)
0036 ::new (_detail::voidify(*current)) ValueType();
0037 } QT_CATCH(...) {
0038 std::destroy(first, current);
0039 QT_RETHROW;
0040 }
0041 }
0042 #endif
0043 }
0044
0045 QT_END_NAMESPACE
0046
0047 #endif