i have to continue a programm. The programmer before me used the structure a lot:
std:vector< T* const>
He wrote ist in Visual Studio
std::vector
uses an Allocator to allocate, reallocate, and deallocate memory for its members. The Allocator requirements are only defined for an Allocator X
for type T
, where T
is "any non-const, non-reference object type" (C++11 Table 27). So using a std::vector<T* const>
gives you undefined behaviour, because the allocator it uses is not defined for a const element type.
You're better off fixing this as soon as possible. There are unlikely to be many issues with changing the declarations to std::vector<T*>
.