std::flat_map allocator-extended copy/move constructor #4779
-
Hi,
msvc compiler version: 19.41.33923 Error message: C2448 'std::flat_map<int,int,std::less,std::vector<int,std::allocator>,std::vector<int,std::allocator>>::_Key_compare': cannot access private member declared in class 'std::flat_map<int,int,std::less,std::vector<int,std::allocator>,std::vector<int,std::allocator>>' Apparently, the compiler is complaining about this part
used here
According to the compiler, we are not allowed to access
Is this a compiler bug, or an implementation bug of <flat_map>? How should we solve it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think this is a bug. I'll fix this by |
Beta Was this translation helpful? Give feedback.
I think this is a bug.
_Flat_map_base
doesn't have access to the members in derived classes (where the access control is changed to private).I'll fix this by
static_cast
-ing the parameters to (const
)_Flat_map_base&
first.