Compile error for vector<T>->erase() -- Geant 10.6

I don’t know exactly why, but I found in some environments there ware compile error in
vector->erase(i);
Below is an example of the error messages for these.

/share/apps/Geant4/10.06/source/geometry/management/src/G4LogicalVolume.cc:360:25: error: no matching function for call to 'std::vector<G4VPhysicalVolume>::erase(__gnu_cxx::__normal_iterator<G4VPhysicalVolume const*, std::vector<G4VPhysicalVolume*> >&)’**
** fDaughters.erase(i);**

For these, I could remove the errors by changing cbegin() and cend() into begin() and end(). Is there any other way not to have these errors? (I am using CentOS 7.7, gcc 4.8.0, cmake 3.12.3)

Plus, I have one more minor question. I have tried to install Geant4 10.6 with VecGeom library, and found out that it doesn’t work with Parameterised geometry. Is this right or am I doing something wrong? Thanks in advance!

Looks like gcc Bug 55675, which has been resolved, but the fix might be missing in the older versions.
One can use devtoolset packages from the centos-release-scl repository to obtain the more recent compilers.

Thank you very much! I have changed gcc into 8.3.1 from devtoolset-8 and now it works!

For clarification, versions of gcc >= 4.9 should work, as tested and reported in the release notes.
There shouldn’t be issues with parameterised volumes with VecGeom; if you find any problem, please file a problem report (https://bugzilla-geant4.kek.jp). Thanks.

Thanks! I think you are right, since I found out that /usr/local/bin/gcc was v4.8.5 while /usr/bin/gcc was v5.4.0. This is my mistake and edited the original post to avoid confusion. And for the parameterised geometry with vecgeom, I have tried it with G4Tet(I have erased the error message in ComputeDimension() in G4Tet to remove the bug according to the previous post), and it seemed to be not working. For this, I will use the provided link. Thanks!