Skip to content

Commit ad93746

Browse files
committed
runs clang-format properly
1 parent 66282c1 commit ad93746

File tree

1 file changed

+77
-93
lines changed

1 file changed

+77
-93
lines changed

libcxx/include/__split_buffer

Lines changed: 77 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -175,31 +175,32 @@ public:
175175
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
176176
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>);
177177

178-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
179-
if (__data_.first() == nullptr) {
180-
if (__data_.begin() != nullptr)
181-
return false;
178+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
179+
if (__data_.first() == nullptr) {
180+
if (__data_.begin() != nullptr)
181+
return false;
182182

183-
if (!__data_.empty())
184-
return false;
183+
if (!__data_.empty())
184+
return false;
185185

186-
if (__data_.capacity() != 0)
187-
return false;
186+
if (__data_.capacity() != 0)
187+
return false;
188188

189-
return true;
190-
} else {
191-
if (__data_.begin() < __data_.first())
192-
return false;
189+
return true;
190+
} else {
191+
if (__data_.begin() < __data_.first())
192+
return false;
193193

194-
if (__data_.capacity() < __data_.size())
195-
return false;
194+
if (__data_.capacity() < __data_.size())
195+
return false;
196196

197-
if (__data_.end() < __data_.begin())
198-
return false;
197+
if (__data_.end() < __data_.begin())
198+
return false;
199199

200-
return true;
201-
}
200+
return true;
201+
}
202202
}
203+
203204
private:
204205
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)
205206
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
@@ -228,45 +229,35 @@ private:
228229
};
229230

230231
#ifdef _LIBCPP_ABI_SIZE_BASED_VECTOR
231-
template<class _Tp, class _Allocatior>
232+
template <class _Tp, class _Allocatior>
232233
struct __split_buffer<_Tp, _Allocator>::__layout {
233-
// private:
234-
pointer __first_ = nullptr;
235-
pointer __begin_ = nullptr;
234+
// private:
235+
pointer __first_ = nullptr;
236+
pointer __begin_ = nullptr;
236237
size_type __size_ = 0;
237-
size_type __cap_ = 0;
238+
size_type __cap_ = 0;
238239
_LIBCPP_NO_UNIQUE_ADDRESS allocator_type __alloc_;
240+
239241
public:
240242
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __layout() = default;
241243

242244
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __layout(const allocator_type& __alloc)
243-
: __alloc_(__alloc)
244-
{}
245+
: __alloc_(__alloc) {}
245246

246247
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer first() _NOEXCEPT;
247248
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer first() const _NOEXCEPT;
248249
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer begin() _NOEXCEPT;
249250
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer begin() const _NOEXCEPT;
250251

251-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() _NOEXCEPT {
252-
return __begin_ + __size_;
253-
}
252+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() _NOEXCEPT { return __begin_ + __size_; }
254253

255-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() const _NOEXCEPT {
256-
return __begin_ + __size_;
257-
}
254+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() const _NOEXCEPT { return __begin_ + __size_; }
258255

259-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
260-
return __size_;
261-
}
256+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size_; }
262257

263-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {
264-
return __size_ == 0;
265-
}
258+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __size_ == 0; }
266259

267-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {
268-
return __cap_;
269-
}
260+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT { return __cap_; }
270261

271262
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __update_first(pointer __new_first) _NOEXCEPT;
272263

@@ -298,15 +289,13 @@ public:
298289
return __cap_ - __size_ - __front_spare();
299290
}
300291

301-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {
302-
return __begin_[__size_ - 1];
303-
}
292+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT { return __begin_[__size_ - 1]; }
304293

305294
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
306295
return __begin_[__size_ - 1];
307296
}
308297

309-
template<class _Data2>
298+
template <class _Data2>
310299
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator(_Data2& __other) _NOEXCEPT {
311300
std::swap(__first_, __other.__first_);
312301
std::swap(__begin_, __other.__begin_);
@@ -322,54 +311,47 @@ public:
322311
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __reset() _NOEXCEPT {
323312
__first_ = nullptr;
324313
__begin_ = nullptr;
325-
__size_ = 0;
326-
__cap_ = 0;
314+
__size_ = 0;
315+
__cap_ = 0;
327316
}
328317

329318
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_without_alloc(__layout const& __other)
330-
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value)
331-
{
319+
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
332320
__first_ = __other.__first_;
333321
__begin_ = __other.__begin_;
334-
__cap_ = __other.__cap_;
335-
__size_ = __other.__size_;
322+
__cap_ = __other.__cap_;
323+
__size_ = __other.__size_;
336324
}
337325
};
338326
#else
339-
template<class _Tp, class _Allocator>
327+
template <class _Tp, class _Allocator>
340328
struct __split_buffer<_Tp, _Allocator>::__layout {
341-
// private:
329+
// private:
342330
pointer __first_ = nullptr;
343331
pointer __begin_ = nullptr;
344-
pointer __end_ = nullptr;
332+
pointer __end_ = nullptr;
345333
_LIBCPP_COMPRESSED_PAIR(pointer, __cap_ = nullptr, allocator_type, __alloc_);
334+
346335
public:
347336
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __layout() = default;
348337

349338
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __layout(const allocator_type& __alloc)
350-
: __alloc_(__alloc)
351-
{}
339+
: __alloc_(__alloc) {}
352340

353341
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer first() _NOEXCEPT;
354342
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer first() const _NOEXCEPT;
355343
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer begin() _NOEXCEPT;
356344
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer begin() const _NOEXCEPT;
357345

358-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() _NOEXCEPT {
359-
return __end_;
360-
}
346+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() _NOEXCEPT { return __end_; }
361347

362-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() const _NOEXCEPT {
363-
return __end_;
364-
}
348+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer end() const _NOEXCEPT { return __end_; }
365349

366350
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
367351
return static_cast<size_type>(__end_ - __begin_);
368352
}
369353

370-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {
371-
return __begin_ == __end_;
372-
}
354+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return __begin_ == __end_; }
373355

374356
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {
375357
return static_cast<size_type>(__cap_ - __first_);
@@ -396,15 +378,11 @@ public:
396378
return static_cast<size_type>(__cap_ - __end_);
397379
}
398380

399-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {
400-
return *(__end_ - 1);
401-
}
381+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT { return *(__end_ - 1); }
402382

403-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
404-
return *(__end_ - 1);
405-
}
383+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT { return *(__end_ - 1); }
406384

407-
template<class _OtherLayout>
385+
template <class _OtherLayout>
408386
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __swap_without_allocator(_OtherLayout& __other) _NOEXCEPT {
409387
std::swap(__first_, __other.__first_);
410388
std::swap(__begin_, __other.__begin_);
@@ -420,53 +398,59 @@ public:
420398
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __reset() _NOEXCEPT {
421399
__first_ = nullptr;
422400
__begin_ = nullptr;
423-
__end_ = nullptr;
424-
__cap_ = nullptr;
401+
__end_ = nullptr;
402+
__cap_ = nullptr;
425403
}
426404

427405
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_without_alloc(__layout const& __other)
428-
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value)
429-
{
406+
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
430407
__first_ = __other.__first_;
431408
__begin_ = __other.__begin_;
432-
__cap_ = __other.__cap_;
433-
__end_ = __other.__end_;
409+
__cap_ = __other.__cap_;
410+
__end_ = __other.__end_;
434411
}
435412
};
436413
#endif
437414

438-
template<class _Tp, class _Allocator>
439-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __split_buffer<_Tp, _Allocator>::__layout::__update_first(pointer __new_first) _NOEXCEPT {
440-
__first_ = __new_first;
415+
template <class _Tp, class _Allocator>
416+
_LIBCPP_CONSTEXPR_SINCE_CXX20
417+
_LIBCPP_HIDE_FROM_ABI void __split_buffer<_Tp, _Allocator>::__layout::__update_first(pointer __new_first) _NOEXCEPT {
418+
__first_ = __new_first;
441419
}
442420

443-
template<class _Tp, class _Allocator>
444-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __split_buffer<_Tp, _Allocator>::__layout::__update_begin(pointer __new_begin) _NOEXCEPT {
421+
template <class _Tp, class _Allocator>
422+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
423+
__split_buffer<_Tp, _Allocator>::__layout::__update_begin(pointer __new_begin) _NOEXCEPT {
445424
__begin_ = __new_begin;
446425
}
447426

448-
template<class _Tp, class _Allocator>
449-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto __split_buffer<_Tp, _Allocator>::__layout::first() _NOEXCEPT -> pointer {
427+
template <class _Tp, class _Allocator>
428+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto __split_buffer<_Tp, _Allocator>::__layout::first() _NOEXCEPT
429+
-> pointer {
450430
return __first_;
451431
}
452432

453-
template<class _Tp, class _Allocator>
454-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto __split_buffer<_Tp, _Allocator>::__layout::first() const _NOEXCEPT -> const_pointer {
433+
template <class _Tp, class _Allocator>
434+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto
435+
__split_buffer<_Tp, _Allocator>::__layout::first() const _NOEXCEPT -> const_pointer {
455436
return __first_;
456437
}
457438

458-
template<class _Tp, class _Allocator>
459-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto __split_buffer<_Tp, _Allocator>::__layout::begin() _NOEXCEPT -> pointer {
439+
template <class _Tp, class _Allocator>
440+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto __split_buffer<_Tp, _Allocator>::__layout::begin() _NOEXCEPT
441+
-> pointer {
460442
return __begin_;
461443
}
462444

463-
template<class _Tp, class _Allocator>
464-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto __split_buffer<_Tp, _Allocator>::__layout::begin() const _NOEXCEPT -> const_pointer {
445+
template <class _Tp, class _Allocator>
446+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto
447+
__split_buffer<_Tp, _Allocator>::__layout::begin() const _NOEXCEPT -> const_pointer {
465448
return __begin_;
466449
}
467450

468-
template<class _Tp, class _Allocator>
469-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto __split_buffer<_Tp, _Allocator>::__layout::__front_spare() const _NOEXCEPT -> size_type {
451+
template <class _Tp, class _Allocator>
452+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI auto
453+
__split_buffer<_Tp, _Allocator>::__layout::__front_spare() const _NOEXCEPT -> size_type {
470454
return static_cast<size_type>(__begin_ - __first_);
471455
}
472456

@@ -573,7 +557,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
573557
if (__cap > 0) {
574558
auto __allocation = std::__allocate_at_least(__data_.__alloc_, __cap);
575559
__data_.__update_first(__allocation.ptr);
576-
__cap = __allocation.count;
560+
__cap = __allocation.count;
577561
}
578562

579563
__data_.__update_begin(__data_.first() + __start);

0 commit comments

Comments
 (0)