当前位置:网站首页>‘make_ unique’ is not a member of ‘std’
‘make_ unique’ is not a member of ‘std’
2022-06-25 14:51:00 【-Ximen blowing snow】
../UniqueStrTest/main.cpp: In function ‘int main(int, char**)’:
../UniqueStrTest/main.cpp:35:25: error: ‘make_unique’ is not a member of ‘std’
auto p = std::make_unique<D>(); // p Is possession D Of unique_ptr
^~~~~~~~~~~
make_unique from c++14 Start ,c++11 I won't support it , But you can do it yourself make_unique
/// std::make_unique for single objects
template<typename _Tp, typename... _Args>
inline typename _MakeUniq<_Tp>::__single_object
make_unique(_Args&&... __args)
{ return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
/// std::make_unique for arrays of unknown bound
template<typename _Tp>
inline typename _MakeUniq<_Tp>::__array
make_unique(size_t __num)
{ return unique_ptr<_Tp>(new remove_extent_t<_Tp>[__num]()); }
/// Disable std::make_unique for arrays of known bound
template<typename _Tp, typename... _Args>
inline typename _MakeUniq<_Tp>::__invalid_type
make_unique(_Args&&...) = delete;
边栏推荐
- 15 -- 最接近原点的 K 个点
- JS floating point multiplication and division method can not accurately calculate the problem
- 从408改考自主命题,211贵州大学考研改考
- Function of getinstance() method
- HMS Core机器学习服务实现同声传译,支持中英文互译和多种音色语音播报
- Tencent cloud builds a Socks5 multi IP proxy server to realize the perfect building of a game with a single window and a single IP. Tutorial attached tool "suggestions collection"
- JS component
- Basic knowledge of pointer
- How to combine multiple motion graphs into a GIF? Generate GIF animation pictures in three steps
- 【Try to Hack】vulnhub DC1
猜你喜欢

【Try to Hack】vulnhub DC1

【Try to Hack】vulhub靶场搭建

从0到1完全掌握 XSS

How to make GIF animation online? Try this GIF online production tool

How to combine multiple motion graphs into a GIF? Generate GIF animation pictures in three steps

It's not easy to understand the data consistency of the microservice architecture for the first time after six years as a programmer

关于win10 版本kicad 卡死的问题, 版本6.x

Power automatic test system nsat-8000, accurate, high-speed and reliable power test equipment

To make pytorch faster, you need to master these 17 methods

Kubernetes understands kubectl/ debugging
随机推荐
[deep learning] multi task learning of multiple datasets data sets missing labels
Tencent cloud builds a Socks5 multi IP proxy server to realize the perfect building of a game with a single window and a single IP. Tutorial attached tool "suggestions collection"
It's not easy to understand the data consistency of the microservice architecture for the first time after six years as a programmer
【HBZ分享】LockSupport的使用
QT loading third-party library basic operation
Biscuit distribution
New title of PTA
Supplementary inheritance and strict mode
Automatic correlation between QT signal and slot
JS to verify whether the string is a regular expression
Uniapp icon configuration
JS get the height and width corresponding to the box model (window.getcomputedstyle, dom.getboundingclientrect)
From 408 to independent proposition, 211 to postgraduate entrance examination of Guizhou University
QQ love talk candy love talk content acquisition and storage
[HBZ sharing] use of locksupport
API encapsulation of uniapp applet
【Try to Hack】vulhub靶场搭建
Basic usage of markdown (plain text and grammar)
Dmsetup command
Remove interval (greedy)