I've been looking over some code for a开发者_C百科 class and I see in one place it has this line:
#ifndef __SGI_STL_PORT
What is __SGI_STL_PORT ? When will this be defined?
This is a "feature test macro"; it will be defined when using the STL port implementation of the standard template library (so, for example, if you include <vector> and it was provided by the STL port version of the library, then this macro will be defined). This can be useful for taking advantage of implementation-specific extensions which are not guaranteed to exist by the C++ standard.
精彩评论