Static constexpr of class inside class link problems

前端 未结 4 797
花落未央
花落未央 2021-01-21 06:27

I\'m trying to create static constexprs defined inside the class. I know about this question: static constexpr member of same type as class being defined, and metho

4条回答
  •  我在风中等你
    2021-01-21 06:38

    Move the

    constexpr foo foo::a = foo(1), foo::b = foo(2), foo::c = foo(1);

    line to a .cc file. That line defines the variables. A variable can be declared as many times as you like, but only defined once across your entire binary.

提交回复
热议问题