为什么 Visual C++ 缺乏重构功能?

2023-07-01C/C++开发问题
2

本文介绍了为什么 Visual C++ 缺乏重构功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在 Visual Studio 2008 中使用 C++ 编程时,为什么在使用 C# 时没有在重构菜单中看到的类似功能?

When programming in C++ in Visual Studio 2008, why is there no functionality like that seen in the refactor menu when using C#?

我经常使用重命名,但当它不存在时,您真的很想念它.我确定您可以获得提供此功能的插件,但为什么在使用 C++ 时不将其集成到 IDE 中?这是因为必须解析 C++ 的方式存在一些问题吗?

I use Rename constantly and you really miss it when it's not there. I'm sure you can get plugins that offer this, but why isn't it integrated in to the IDE when using C++? Is this due to some gotcha in the way that C++ must be parsed?

推荐答案

C++ 的语法和语义使得正确实现重构功能极其困难.实现一些相对简单的方法来覆盖 90% 的情况是可能的,但在剩下的 10% 的情况下,这个简单的解决方案会通过更改您不想更改的内容来严重破坏您的代码.

The syntax and semantics of C++ make it incredibly difficult to correctly implement refactoring functionality. It's possible to implement something relatively simple to cover 90% of the cases, but in the remaining 10% of cases that simple solution will horribly break your code by changing things you never wanted to change.

阅读http://yosefk.com/c++fqa/defective.html#defect-8 简要讨论 C++ 中的任何重构代码必须处理的困难.

Read http://yosefk.com/c++fqa/defective.html#defect-8 for a brief discussion of the difficulties that any refactoring code in C++ has to deal with.

微软显然已决定为 C++ 开发这一特殊功能,让第三方开发人员尽其所能.

Microsoft has evidently decided to punt on this particular feature for C++, leaving it up to third-party developers to do what they can.

这篇关于为什么 Visual C++ 缺乏重构功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6