Make typedef private and rename it so older versions of msvc don't erroneously treat the typedef like it's in scope when doing template instantiation

This commit is contained in:
Christian Mazakas
2023-02-13 09:10:21 -08:00
parent b8ff76f4ab
commit 0c93fbc330

View File

@ -38,24 +38,24 @@ struct node_handle_base
{ {
protected: protected:
using type_policy=TypePolicy; using type_policy=TypePolicy;
using value_type=typename type_policy::value_type;
using element_type=typename type_policy::element_type; using element_type=typename type_policy::element_type;
public: public:
using allocator_type = Allocator; using allocator_type = Allocator;
private: private:
value_type* p_=nullptr; using node_value_type=typename type_policy::value_type;
node_value_type* p_=nullptr;
BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS opt_storage<Allocator> a_; BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS opt_storage<Allocator> a_;
protected: protected:
value_type& element()noexcept node_value_type& element()noexcept
{ {
BOOST_ASSERT(!empty()); BOOST_ASSERT(!empty());
return *p_; return *p_;
} }
value_type const& element()const noexcept node_value_type const& element()const noexcept
{ {
BOOST_ASSERT(!empty()); BOOST_ASSERT(!empty());
return *p_; return *p_;
@ -73,7 +73,7 @@ struct node_handle_base
return a_.t_; return a_.t_;
} }
void emplace(value_type* p,Allocator a) void emplace(node_value_type* p,Allocator a)
{ {
BOOST_ASSERT(empty()); BOOST_ASSERT(empty());
p_=p; p_=p;
@ -158,7 +158,7 @@ struct node_handle_base
if (!empty()&&!nh.empty()){ if (!empty()&&!nh.empty()){
BOOST_ASSERT(pocs || al()==nh.al()); BOOST_ASSERT(pocs || al()==nh.al());
value_type *p=p_; node_value_type *p=p_;
p_=nh.p_; p_=nh.p_;
nh.p_=p; nh.p_=p;