Is it possible to put several objects together inside a union?

后端 未结 6 1933
无人及你
无人及你 2021-02-08 06:38

What if I have this:

union{
    vector intVec ;
    vector floatVec ;
    vector doubleVec ;
} ;

Of cours

6条回答
  •  梦谈多话
    2021-02-08 07:05

    You might want to have a look at Boost.Variant which can contain a single value of varying types.

提交回复
热议问题