Should std::unique_ptr be permitted

前端 未结 4 1417
独厮守ぢ
独厮守ぢ 2020-12-03 16:53

This is a very simple question. Consider the following code:

#include 
#include 

typedef std::unique_ptr UniqueVo         


        
4条回答
  •  無奈伤痛
    2020-12-03 17:45

    MSVC is right while GCC is wrong:

    Standard(3.9/5):

    Incompletely-defined object types and the void types are incomplete types

    Standard(20.7.1.1.2/4):

    If T is an incomplete type, the program is ill-formed

提交回复
热议问题