boost 的 "windows_shared_memory" 和 boost 的 "managed_windows_shared_memory" 有什么区别?

What is the difference between boost's "windows_shared_memory" and boost's "managed_windows_shared_memory"?

Boost 提供多种类型的共享内存。其中,windows_shared_memory 使用 Windows 自己的底层共享内存功能,因此是平台特定的,与其他共享内存(POSIX 兼容内存)相比具有一些特殊性。

描述为here in the documentation

然而,在this other documentation page中描述了managed_windows_shared_memory。都没有提到对方的存在。

这两种共享内存实现有什么区别?

在我看来,根据文档,它们都具有相同的行为。它们是否只是显示两个不同界面以使用它们的相同机制?

包含两个实现的include :

// The first implementation has to be included here
#include <boost/interprocess/windows_shared_memory.hpp>

// The second implantation has to be included here
#include <boost/interprocess/managed_windows_shared_memory.hpp>

boost中的"managed"这个词区分了几个class接口家族,而不仅仅是windows共享内存。非 "managed" 版本更直接和最小,提供低级操作所需的内容。 "managed" 版本通常构建在非 "managed" 之上,但也包括更多增强模板魔法以提供更安全、更高级别的界面。通常更喜欢 "managed" 版本,因为它们为您做的更多。