From 16347bb8779029bb48114d636b3775fcc76fb985 Mon Sep 17 00:00:00 2001 From: kgv Date: Sat, 26 Jan 2013 22:53:49 +0400 Subject: [PATCH] 0023726: Wrong usage of NCollection_StdAllocator in QANColStdAllocator2 Fixed compilation error within g++ 4.7.2 --- src/QANCollection/QANCollection4.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/QANCollection/QANCollection4.cxx b/src/QANCollection/QANCollection4.cxx index 48b27a5ca5..a8d29ed38d 100755 --- a/src/QANCollection/QANCollection4.cxx +++ b/src/QANCollection/QANCollection4.cxx @@ -29,7 +29,7 @@ //======================================================================= //function : QANColStdAllocator1 -//purpose : +//purpose : //======================================================================= static Standard_Integer QANColStdAllocator1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { @@ -83,7 +83,7 @@ static Standard_Integer QANColStdAllocator1(Draw_Interpretor& di, Standard_Integ //======================================================================= //function : QANColStdAllocator2 -//purpose : +//purpose : //======================================================================= static Standard_Integer QANColStdAllocator2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { @@ -117,7 +117,9 @@ static Standard_Integer QANColStdAllocator2(Draw_Interpretor& di, Standard_Integ } //using void-specialization allocator - std::vector > aV2; + NCollection_StdAllocator aVAlloc; + std::vector > aV2 (aVAlloc); + aV2.resize (10); aV2.push_back (-1); if ( aV2.size() == size_t (11) ) { @@ -147,8 +149,8 @@ static Standard_Integer QANColStdAllocator2(Draw_Interpretor& di, Standard_Integ void QANCollection::Commands4(Draw_Interpretor& theCommands) { const char *group = "QANCollection"; - theCommands.Add("QANColStdAllocator1", "QANColStdAllocator1", __FILE__, QANColStdAllocator1, group); - theCommands.Add("QANColStdAllocator2", "QANColStdAllocator2", __FILE__, QANColStdAllocator2, group); + theCommands.Add("QANColStdAllocator1", "QANColStdAllocator1", __FILE__, QANColStdAllocator1, group); + theCommands.Add("QANColStdAllocator2", "QANColStdAllocator2", __FILE__, QANColStdAllocator2, group); return; }