Gewährleistet der C++ - Standard, dass das Konstruieren verschiedener Elemente mit std :: allocator Thread-sicher ist? Zum Beispiel:Ist 'std :: allocator <T> :: construct' threadsicher, wenn verschiedene Elemente konstruiert werden?
// main thread
std::allocator<T> alloc;
auto *p = alloc.allocate(2);
// thread1
alloc.construct(p);
// thread2
alloc.construct(p + 1)
Ist auch std :: allocator :: für verschiedene Elemente Thread-Safe zu zerstören?
Danke!
Vielen Dank! Das ist hilfreich –