Scalable automatic class registration in C++

后端 未结 1 1761
陌清茗
陌清茗 2021-02-09 18:20

Automatic class registration in C++ is a common task, and a commonly asked question here on StackOverflow:

Register an object creator in object factory

Somehow r

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-09 18:36

    Writing Java code in C++ rarely works well. All those heap allocations are probably what's killing performance (as they would in Java, but Java startup is so slow that nobody would notice). Use static objects, and don't put a Registrar object into each generated class; that's just a waste of time and space.

    0 讨论(0)
提交回复
热议问题