Why does C++ need language modifications to be “managed”?

前端 未结 11 1387
长发绾君心
长发绾君心 2021-02-14 20:05

Why can\'t a compiler be written that manages what needs to be managed in C++ code (i.e. to make it \"CLR compatible\")?

Maybe with some compromise, li

11条回答
  •  猫巷女王i
    2021-02-14 20:40

    First of all, the distinction between "simple C++" and "managed C++" was intentional, because one of the MC++ purposes was to provide a bridge between existing C++ code and CLR.

    Next, there's just too many C++ features that don't fit into CLR model. Multiple inheritance, templates, pointer arithmetics... Without drawing a clear line the programmers would be doomed to face cryptic errors, both at compile- and runtime.

提交回复
热议问题