© Copyright International Business Machines Corporation 2006. All rights reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Normal C++ templates can be visualized and edited. However, template specializations and partial specializations are not supported due to lack of support in CDT. Current UI does not disable visualization entries for full and partial specializations.. it just does not do anything, for example:
template <class T> class MyVec {
T* data;
int length;
};This is a normal template. Visualization for this will succeed.
template <> class MyVec<bool> {
unsigned int * data;
int length;
};This is a template specialization. Visualization for this will fail.
Editing of fields and methods is not supported for anonymous C++ types, for example:
class c1 {
class {int j;} abc; // The type of member abc is an anonymous type since defining class has not been given any typename
};Here the type of the field abc is an anonymous class.
Currently C++ visualization is not able to handle the change deltas for anonymous types when the edit operations like adding or deleting fields, methods and enum literals are performed on the diagram. Therefore, the C++ visualization editing functionality are disabled for anonymous types. General recommendation is to work with named types as far as possible so that editing features are available. If this is not possible code should be edited directly.
Editing of fields and methods of named C++ types that are nested inside anonymous namespaces is not supported, for example:
namespace { // anonymous namespace
class c1 {};
}Here class c1 is a named type nested in an anonymous namespace.
Currently C++ visualization is not able to handle the changes to named types nested in anonymous namespaces when the edit operations like adding or deleting fields, methods and enum literals are performed on the diagram. Hence the C++ visualization editing features are disabled for name types nested inside anonymous namespaces. General recommendation is to work with named namespaces as far as possible so that editing features are available. If this is not possible code should be edited directly.
Type definitions with qualified names are not supported for C++ visualization, for example:
namespace n1 {
class c1; // Forward declaration of class c1
}
class n1::c1{ int i;}; // Definition of class c1 using the fully qualified name.C++ visualization cannot deal with the above definitions and visualization for class c1 fails.
Workaround: Use the following equivalent of the above code:
namespace n1 {
class c1{ int i;};
}
Sometimes changes in the code, including renaming elements or addition/deletion of members in types, might not be reflected in visualization diagrams. The most common causes of this are inadequate or lacking of change notifications from the CDT.
Workaround: Make false changes to a file and save the code for one more time. In addition, sometimes the "C/C++ Index" created by CDT might not be consistent with the code. A quick check on the C/C++ index (Show View > Other > C/C++ > C/C++ Index) to see if some entries are missing can give some clue that the index update is a problem. In such cases, rebuilding index on the project might be helpful. However, rebuilding the index can be time consuming for large projects and should be used with discretion. If you want to show related elements in a diagram, select the Full C/C++ Indexer option.