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

前端 未结 11 2012
隐瞒了意图╮
隐瞒了意图╮ 2021-02-14 20:18

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条回答
  •  無奈伤痛
    2021-02-14 20:44

    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.

提交回复
热议问题