template
inline void
Construct(_T1* __p, _Args&&... __args)
{ ::new(static_cast(_p)) T1(std::forward<_Args>(_args)...); }
上面这段是我系统里的stl_construct.h里的construct模板,我用的不是SGI STL所以这段代码没用,但是这段代码是错的吧,可变参数大于2时,会用多个参数构造_T1,我查了一下SGI中的construct模板,没有查到这种可变参数版本的,想问这个模板怎么写才正确
c++construct模板的问题
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
逆水行舟天涯路 2017-11-24 09:33关注试试这个
template <class T1 > inline void Construct(_T1* __p, _Args&&... __args) { ::new(static_cast(_p)) T1(std::forward<_Args>(_args)...); }解决 无用评论 打赏 举报