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

前端 未结 11 1956
隐瞒了意图╮
隐瞒了意图╮ 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:38

    Well C++/CLI is mostly meant to be a glue between managed and unmanaged code. As such you need to have the ability to mix mangaged an unmanaged concepts. You need to be able to allocate managed and unmanged objects in the same code, so there is no way around separate key words.

提交回复
热议问题