开发者

Where can I find listings of "taken" identifiers in standard libraries

开发者 https://www.devze.com 2023-02-06 07:40 出处:网络
With the large size of current C/C++ libraries like STL, Win32, Boost, posix etc. the question of what identifiers are problematic arises. Ev开发者_开发知识库en with namespaces it is nice to be able t

With the large size of current C/C++ libraries like STL, Win32, Boost, posix etc. the question of what identifiers are problematic arises. Ev开发者_开发知识库en with namespaces it is nice to be able to select identifiers which don't clash with the most used identifiers of other libraries when desiging a new library designed to work togheter with existing ones.

At least for the C++ standard libraries (including 0x) there should be listings available. It would be reasonable to think that someone has done a tool for this purpose, which reads a set of header files and creates a list of all names ordered by namespace. Anyone who knows of such a tool? The tool should preferably read all headers in a directory tree rather than only those #included by a particular cpp file.


Even with namespaces it is nice to be able to select identifiers which don't clash with the most used identifiers of other libraries when desiging a new library designed to work togheter with existing ones.

I realize that quite a few libraries do that but this attempt is fundamentally misguided.

Don’t design your identifiers so that they don’t clash, design them so that they are clear, short, and descriptive. These should be the only criteria.

Identifier clash is a solved problem, thanks to namespaces. Properly used, name clash simply doesn’t arise.


How about using egrep? [Mumble mumble to get 30 characters]

0

精彩评论

暂无评论...
验证码 换一张
取 消