[問題]使用Union問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VS 2008
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
NONE
問題(Question):
使用Union, but Compile Failed
*[36m錯誤訊息(Error Message): *[m
member 'Test::str' of union 'Test::str' has copy constructor
struct Test
{
union
{
std::string str;
int num;
};
};
Compile failed ....
Does anybody have a good idea to solve this??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.25.187.251
※ 編輯: karcher 來自: 114.25.187.251 (04/30 16:53)
推
04/30 17:04, , 1F
04/30 17:04, 1F
※ 編輯: karcher 來自: 114.25.185.223 (04/30 18:29)
→
04/30 18:36, , 2F
04/30 18:36, 2F
→
04/30 18:44, , 3F
04/30 18:44, 3F
→
04/30 18:52, , 4F
04/30 18:52, 4F
→
04/30 19:01, , 5F
04/30 19:01, 5F
※ 編輯: karcher 來自: 114.25.185.223 (04/30 19:08)
※ 編輯: karcher 來自: 114.25.185.223 (04/30 19:12)
→
04/30 19:36, , 6F
04/30 19:36, 6F
→
04/30 19:43, , 7F
04/30 19:43, 7F
→
04/30 19:44, , 8F
04/30 19:44, 8F
→
04/30 20:30, , 9F
04/30 20:30, 9F
討論串 (同標題文章)