@@ -594,7 +594,8 @@ public:
594
594
_LIBCPP_HIDE_FROM_ABI __node_value_type& __get_value () { return __value_; }
595
595
596
596
template <class ... _Args>
597
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_node (_Args&&... __args) : __value_(std::forward<_Args>(__args)...) {}
597
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_node (_Args&&... __args)
598
+ : __value_(std::forward<_Args>(__args)...) {}
598
599
// TODO: libcxx26
599
600
// _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_node(__node_value_type && args): __value_{args} { }
600
601
~__tree_node () = delete ;
@@ -882,17 +883,23 @@ public:
882
883
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __end_node_pointer __end_node () const _NOEXCEPT {
883
884
return pointer_traits<__end_node_pointer>::pointer_to (const_cast <__end_node_t &>(__end_node_));
884
885
}
885
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_allocator& __node_alloc () _NOEXCEPT { return __node_alloc_; }
886
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_allocator& __node_alloc () _NOEXCEPT {
887
+ return __node_alloc_;
888
+ }
886
889
887
890
private:
888
891
_LIBCPP_HIDE_FROM_ABI const __node_allocator& __node_alloc () const _NOEXCEPT { return __node_alloc_; }
889
892
890
893
public:
891
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type __alloc () const _NOEXCEPT { return allocator_type (__node_alloc ()); }
894
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type __alloc () const _NOEXCEPT {
895
+ return allocator_type (__node_alloc ());
896
+ }
892
897
893
898
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size () const _NOEXCEPT { return __size_; }
894
899
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare& value_comp () _NOEXCEPT { return __value_comp_; }
895
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const value_compare& value_comp () const _NOEXCEPT { return __value_comp_; }
900
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const value_compare& value_comp () const _NOEXCEPT {
901
+ return __value_comp_;
902
+ }
896
903
897
904
public:
898
905
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer __root () const _NOEXCEPT {
@@ -961,9 +968,13 @@ public:
961
968
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 ~__tree ();
962
969
963
970
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin () _NOEXCEPT { return iterator (__begin_node_); }
964
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin () const _NOEXCEPT { return const_iterator (__begin_node_); }
971
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin () const _NOEXCEPT {
972
+ return const_iterator (__begin_node_);
973
+ }
965
974
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end () _NOEXCEPT { return iterator (__end_node ()); }
966
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end () const _NOEXCEPT { return const_iterator (__end_node ()); }
975
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end () const _NOEXCEPT {
976
+ return const_iterator (__end_node ());
977
+ }
967
978
968
979
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size () const _NOEXCEPT {
969
980
return std::min<size_type>(__node_traits::max_size (__node_alloc ()), numeric_limits<difference_type >::max ());
@@ -1825,75 +1836,79 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
1825
1836
if (__child == nullptr ) {
1826
1837
__node_holder __h = __construct_node (std::forward<_Args>(__args)...);
1827
1838
1828
- /*
1829
- error: cannot convert
1830
- '__node_holder'
1831
- (aka
1832
- ' unique_ptr<
1833
- __tree_node<
1834
- std::__value_type<int, double>,
1835
- min_pointer<void, std::integral_constant<unsigned long, 0> >
1836
- >,
1837
- __tree_node_destructor<
1838
- min_allocator<
1839
- std::__tree_node<
1839
+ /*
1840
+ error: cannot convert
1841
+ '__node_holder'
1842
+ (aka
1843
+ ' unique_ptr<
1844
+ __tree_node<
1840
1845
std::__value_type<int, double>,
1841
1846
min_pointer<void, std::integral_constant<unsigned long, 0> >
1847
+ >,
1848
+ __tree_node_destructor<
1849
+ min_allocator<
1850
+ std::__tree_node<
1851
+ std::__value_type<int, double>,
1852
+ min_pointer<void, std::integral_constant<unsigned long, 0> >
1853
+ >
1854
+ >
1842
1855
>
1843
1856
>
1844
- >
1845
- >
1846
- '
1847
- )
1848
- to 'double' without a conversion operator
1849
- */
1857
+ '
1858
+ )
1859
+ to 'double' without a conversion operator
1860
+ */
1850
1861
// double d2 =static_cast<double>(__h);
1851
1862
// (void)d2;
1852
1863
1853
- /*
1854
- error: cannot convert 'pointer'
1855
- (aka
1856
- ' min_pointer<
1857
- std::__tree_node<
1858
- std::__value_type<int, double>,
1859
- min_pointer<void, std::integral_constant<unsigned long, 0>>
1860
- >
1861
- >
1862
- ') to 'double' without a conversion operator
1863
- */
1864
+ /*
1865
+ error: cannot convert 'pointer'
1866
+ (aka
1867
+ ' min_pointer<
1868
+ std::__tree_node<
1869
+ std::__value_type<int, double>,
1870
+ min_pointer<void, std::integral_constant<unsigned long, 0>>
1871
+ >
1872
+ >
1873
+ ') to 'double' without a conversion operator
1874
+ */
1864
1875
// double d =static_cast<double>(__h.get());
1865
1876
// (void)d;
1866
1877
1867
- /*
1868
- error: cannot convert '__node_base_pointer' (aka
1869
- ' min_pointer<
1870
- std::__tree_node_base<
1871
- min_pointer<void, std::integral_constant<unsigned long, 0>>
1872
- >,
1873
- std::integral_constant<unsigned long, 0>
1874
- >
1875
- ') to 'double' without a conversion operator
1876
- */
1878
+ /*
1879
+ error: cannot convert '__node_base_pointer' (aka
1880
+ ' min_pointer<
1881
+ std::__tree_node_base<
1882
+ min_pointer<void, std::integral_constant<unsigned long, 0>>
1883
+ >,
1884
+ std::integral_constant<unsigned long, 0>
1885
+ >
1886
+ ') to 'double' without a conversion operator
1887
+ */
1877
1888
1878
- // __node_base_pointer xxx = nullptr;
1879
- // (void)xxx;
1889
+ // __node_base_pointer xxx = nullptr;
1890
+ // (void)xxx;
1880
1891
// double d3 =static_cast<double>(xxx);
1881
1892
// (void)d3;
1882
1893
1883
1894
// __node_base_pointer __foo = static_cast<__node_base_pointer>(__h.get());
1884
1895
// (void)__foo;
1885
1896
// __maybe_unused__ __node_base_pointer __foo2 = __node_base_pointer(__h.get());
1886
1897
1887
- /*
1888
- error: cannot convert '__tree<std::__value_type<int, double>, std::__map_value_compare<int, std::pair<const int, double>, std::less<int>, true>, min_allocator<std::pair<const int, double>>>::__node_holder' (aka 'unique_ptr<__tree_node<std::__value_type<int, double>, min_pointer<void, std::integral_constant<unsigned long, 0>>>, __tree_node_destructor<min_allocator<std::__tree_node<std::__value_type<int, double>, min_pointer<void, std::integral_constant<unsigned long, 0>>>>>>') to 'double' without a conversion operator
1889
- */
1898
+ /*
1899
+ error: cannot convert '__tree<std::__value_type<int, double>, std::__map_value_compare<int, std::pair<const int,
1900
+ double>, std::less<int>, true>, min_allocator<std::pair<const int, double>>>::__node_holder' (aka
1901
+ 'unique_ptr<__tree_node<std::__value_type<int, double>, min_pointer<void, std::integral_constant<unsigned long,
1902
+ 0>>>, __tree_node_destructor<min_allocator<std::__tree_node<std::__value_type<int, double>, min_pointer<void,
1903
+ std::integral_constant<unsigned long, 0>>>>>>') to 'double' without a conversion operator
1904
+ */
1890
1905
// __tree<_Tp, _Compare, _Allocator>::__node_holder __tmp_nh;
1891
1906
// double __xxx = static_cast<double>(__tmp_nh);
1892
1907
1893
-
1894
- /*
1895
- error: cannot convert 'pointer' (aka 'min_pointer<std::__tree_node<std::__value_type<int, double>, min_pointer<void, std::integral_constant<unsigned long, 0>>>>') to 'double' without a conversion operator
1896
- */
1908
+ /*
1909
+ error: cannot convert 'pointer' (aka 'min_pointer<std::__tree_node<std::__value_type<int, double>, min_pointer<void,
1910
+ std::integral_constant<unsigned long, 0>>>>') to 'double' without a conversion operator
1911
+ */
1897
1912
// __tree<_Tp, _Compare, _Allocator>::__node_holder __tmp_nh;
1898
1913
// double __xxx = static_cast<double>(__tmp_nh.get());
1899
1914
@@ -1906,18 +1921,16 @@ error: cannot convert 'pointer' (aka 'min_pointer<std::__tree_node<std::__value_
1906
1921
'std::__tree_node_base<min_pointer<void>>'
1907
1922
*/
1908
1923
1909
- if (__libcpp_is_constant_evaluated ()){
1910
-
1911
- typename __tree<_Tp, _Compare, _Allocator>::__node_holder::pointer cast = static_cast <
1912
- __tree<_Tp, _Compare, _Allocator>::__node_holder::pointer>(__h.get ());
1913
- __node_base_pointer base = // static_cast<__node_base_pointer>(cast);
1914
- std::__static_fancy_pointer_cast<__node_base_pointer>(cast);
1915
-
1924
+ if (__libcpp_is_constant_evaluated ()) {
1925
+ typename __tree<_Tp, _Compare, _Allocator>::__node_holder::pointer cast =
1926
+ static_cast < __tree<_Tp, _Compare, _Allocator>::__node_holder::pointer>(__h.get ());
1927
+ __node_base_pointer base = // static_cast<__node_base_pointer>(cast);
1928
+ std::__static_fancy_pointer_cast<__node_base_pointer>(cast);
1916
1929
1917
- __insert_node_at (__parent, __child, base);
1918
- } else {
1919
- __insert_node_at (__parent, __child, static_cast <__node_base_pointer>(__h.get ()));
1920
- }
1930
+ __insert_node_at (__parent, __child, base);
1931
+ } else {
1932
+ __insert_node_at (__parent, __child, static_cast <__node_base_pointer>(__h.get ()));
1933
+ }
1921
1934
1922
1935
__r = __h.release ();
1923
1936
__inserted = true ;
@@ -2333,8 +2346,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26
2333
2346
__rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_ );
2334
2347
else
2335
2348
return _Pp (iterator (__rt),
2336
- iterator (__rt->__right_ != nullptr ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min (__rt->__right_ ))
2337
- : __result));
2349
+ iterator (__rt->__right_ != nullptr
2350
+ ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min (__rt->__right_ ))
2351
+ : __result));
2338
2352
}
2339
2353
return _Pp (iterator (__result), iterator (__result));
2340
2354
}
@@ -2356,8 +2370,9 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const {
2356
2370
else
2357
2371
return _Pp (
2358
2372
const_iterator (__rt),
2359
- const_iterator (
2360
- __rt->__right_ != nullptr ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min (__rt->__right_ )) : __result));
2373
+ const_iterator (__rt->__right_ != nullptr
2374
+ ? std::__static_fancy_pointer_cast<__end_node_pointer>(std::__tree_min (__rt->__right_ ))
2375
+ : __result));
2361
2376
}
2362
2377
return _Pp (const_iterator (__result), const_iterator (__result));
2363
2378
}
0 commit comments