Initialisation of static vector

前端 未结 6 450
遥遥无期
遥遥无期 2020-12-13 23:48

I wonder if there is the \"nicer\" way of initialising a static vector than below?

class Foo
{
    static std::vector MyVector;
    Foo()
    {
           


        
6条回答
  •  失恋的感觉
    2020-12-14 00:10

    How about initializing using a static object. In its constuctor it could call a static function in the object to do the initalization.

提交回复
热议问题