Skip to content
Permalink
Browse files

Example conversion for `deque`, using [[maybe_trivially_relocatable]].

  • Loading branch information...
Quuxplusone committed Nov 19, 2018
1 parent 0533994 commit 5945ccee2f7bb30fbb4e3a7cf9308ee8145c758b
Showing with 13 additions and 5 deletions.
  1. +8 −0 include/__config
  2. +1 −1 include/__split_buffer
  3. +4 −4 include/deque
@@ -1281,6 +1281,14 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_HAS_NO_IS_AGGREGATE
#endif

#ifndef _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE
#if __has_extension(trivially_relocatable)
#define _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE [[clang::maybe_trivially_relocatable]]
#else
#define _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE
#endif
#endif

#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
#define _LIBCPP_HAS_NO_COROUTINES
#endif
@@ -25,7 +25,7 @@ protected:
};

template <class _Tp, class _Allocator = allocator<_Tp> >
struct __split_buffer
struct _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE __split_buffer
: private __split_buffer_common<true>
{
private:
@@ -173,8 +173,8 @@ _LIBCPP_PUSH_MACROS

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp, class _Allocator> class __deque_base;
template <class _Tp, class _Allocator = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS deque;
template <class _Tp, class _Allocator> class _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE __deque_base;
template <class _Tp, class _Allocator = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE deque;

template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
class _DiffType, _DiffType _BlockSize>
@@ -921,7 +921,7 @@ __deque_base_common<__b>::__throw_out_of_range() const
}

template <class _Tp, class _Allocator>
class __deque_base
class _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE __deque_base
: protected __deque_base_common<true>
{
__deque_base(const __deque_base& __c);
@@ -1191,7 +1191,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
}

template <class _Tp, class _Allocator /*= allocator<_Tp>*/>
class _LIBCPP_TEMPLATE_VIS deque
class _LIBCPP_TEMPLATE_VIS _LIBCPP_MAYBE_TRIVIALLY_RELOCATABLE deque
: private __deque_base<_Tp, _Allocator>
{
public:

0 comments on commit 5945cce

Please sign in to comment.
You can’t perform that action at this time.