C++ åèæå
- C++11
- C++14
- C++17
- C++20
- C++ ç¼è¯å¨æ¯ææ åµè¡¨
- ç¬ç«ä¸å®¿ä¸»å®ç°
- C++ è¯è¨
- C++ å ³é®è¯
- é¢å¤çå¨
- C++ æ ååºå¤´æä»¶
- å ·åè¦æ±
- åè½ç¹æ§æµè¯ (C++20)
- å·¥å ·åº
- ç±»åæ¯æï¼åºæ¬ç±»åãRTTIãç±»åç¹æ§ï¼
- æ¦å¿µåº (C++20)
- é误å¤ç
- 卿å å管ç
- std::addressof
- std::allocator_traits
- std::default_delete
- std::allocator_arg_t
- std::allocator_arg
- std::weak_ptr
- std::enable_shared_from_this
- std::bad_weak_ptr
- std::unique_ptr
- std::scoped_allocator_adaptor
- std::auto_ptr
- std::destroy_at
- std::destroy
- std::destroy_n
- std::uninitialized_move
- std::uninitialized_value_construct
- std::owner_less
- std::shared_ptr
- std::to_address
- std::assume_aligned
- std::make_obj_using_allocator
- C å å管çåº
- ä½å±å å管ç
- std::pmr::memory_resource
- std::allocator
- std::pointer_traits
- std::uses_allocator
- std::uses_allocator_construction_args
- std::uninitialized_construct_using_allocator
- std::pmr::polymorphic_allocator
- std::pmr::get_default_resource
- std::pmr::set_default_resource
- std::pmr::new_delete_resource
- std::pmr::null_memory_resource
- std::pmr::synchronized_pool_resource
- std::pmr::unsynchronized_pool_resource
- std::pmr::monotonic_buffer_resource
- std::pmr::pool_options
- std::raw_storage_iterator
- std::get_temporary_buffer
- std::return_temporary_buffer
- std::uninitialized_copy
- std::uninitialized_fill
- std::uninitialized_default_construct
- std::uninitialized_copy_n
- std::uninitialized_fill_n
- std::uninitialized_move_n
- std::uninitialized_default_construct_n
- std::uninitialized_value_construct_n
- std::construct_at
- std::align
- 注é
- æ¥æåæ¶é´å·¥å ·
- å符串åº
- 容å¨åº
- è¿ä»£å¨åº
- èå´åº (C++20)
- ç®æ³åº
- æ°å¼åº
- è¾å ¥/è¾åºåº
- æä»¶ç³»ç»åº
- æ¬å°ååº
- æ£å表达å¼åº
- ååæä½åº
- çº¿ç¨æ¯æåº
- å®éªæ§ C++ ç¹æ§
- æç¨çèµæº
- ç´¢å¼
- std 符å·ç´¢å¼
- åç¨æ¯æ (C++20)
- C++ å ³é®è¯
ä½ç½®ï¼é¦é¡µ > C++ åèæå >卿å å管ç > std::uninitialized_construct_using_allocator
std::uninitialized_construct_using_allocator
| å®ä¹äºå¤´æä»¶ <memory>
|
||
| template< class T, class Alloc, class... Args > constexpr T* uninitialized_construct_using_allocator( T* p, const Alloc& alloc, Args&&... args ); |
(C++20 èµ·) | |
以使ç¨åé
卿é çææ®µå¨ p ææç¤ºçæªåå§åå
åä½ç½®å建ç»å®ç±»å T ç对象ã
çä»·äº
return std::apply([&]<class... Xs>(Xs&&...xs) { return std::construct_at(p, std::forward<Xs>(xs)...); }, std::uses_allocator_construction_args<T>(alloc, std::forward<Args>(args)...));
åæ°
| p | - | å°è¦æ¾ç½®å¯¹è±¡çå åä½ç½®ã |
| alloc | - | è¦ä½¿ç¨çåé å¨ã |
| args | - | ä¼ éç» T æé 彿°çåæ°ã
|
è¿åå¼
æåæ°å建ç T ç±»å对象çæéã
å¼å¸¸
å¯è½æåº T çæé 彿°ææçä»»ä½å¼å¸¸ï¼å¸¸å
æ¬ std::bad_alloc ã
示ä¾
| æ¬èæªå®æ åå ï¼ææ ç¤ºä¾ |
åé
| (C++11) |
æ£æ¥æå®çç±»åæ¯å¦æ¯æä½¿ç¨åé
å¨çæé (类模æ¿) |
| (C++20) |
以使ç¨åé
卿é çææ®µå建ç»ç±»åç对象 (彿°æ¨¡æ¿) |