mercredi 23 décembre 2020

Are there some potential problems when invoking the STL with the allocator without construct() and destroy() functions?

Should these member functions(i.e: max_size(), construct() and destroy()) be implemented when defining a STL allocator by myself with std=c++11 option?

Are there some potential problems that I should be aware of when invoking the STL with the allocator without these aforementioned member functions?

As per https://en.cppreference.com/w/cpp/memory/allocator, these member functions are deprecated in C++17 and removed in C++20.

As per the implementation of ROS2(https://github.com/ros2/realtime_support/tree/master/tlsf_cpp) which is commonly used in robot control, there are no such member functions indeed. It's important to emphasize that this implementation is targeted for C++14.

Aucun commentaire:

Enregistrer un commentaire