tpaviot/oce — Issue #204: Compile error with Standard_StdAllocator
Author: tpaviot
Created: 2011-11-27 11:46:13+00:00
State: open

Roman Lygin contributed a patch to add OCC allocator support for STL containers (see http://www.opencascade.org/org/forum/thread_22234/ and http://opencascade.blogspot.com/2011/11/standard-allocator-interface.html).

I pushed a branch with Roman's contribution (https://github.com/tpaviot/oce/tree/tp/standard-stdallocator), and tried to compile. However, there is an issue at compile time:

In file included from /Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:1:
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:27: error: expected nested-name-specifier before ‘T’
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:27: error: expected ‘;’ before ‘value_type’
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:28: error: ISO C++ forbids declaration of ‘value_type’ with no type
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:28: error: expected ‘;’ before ‘*’ token
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:29: error: ISO C++ forbids declaration of ‘value_type’ with no type
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:29: error: expected ‘;’ before ‘*’ token
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:30: error: ISO C++ forbids declaration of ‘value_type’ with no type
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:30: error: expected ‘;’ before ‘&’ token
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:31: error: ISO C++ forbids declaration of ‘value_type’ with no type
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:31: error: expected ‘;’ before ‘&’ token
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:56: error: ‘pointer’ does not name a type
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:60: error: ‘const_pointer’ does not name a type
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:64: error: ‘pointer’ does not name a type
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:69: error: ‘pointer’ has not been declared
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:84: error: ‘pointer’ has not been declared
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:84: error: ‘const_reference’ has not been declared
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:89: error: ‘pointer’ has not been declared
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx: In member function ‘size_t Standard_StdAllocator::max_size() const’:
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:78: error: ‘value_type’ was not declared in this scope
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx: In member function ‘void Standard_StdAllocator::construct(int, int)’:
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:85: error: expected type-specifier before ‘value_type’
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:85: error: no matching function for call to ‘operator new(long unsigned int, void*&)’
:0: note: candidates are: void* operator new(long unsigned int)
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:85: error: expected `;' before ‘value_type’
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx: In member function ‘void Standard_StdAllocator::destroy(int)’:
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:89: error: base operand of ‘->’ is not a pointer
/Users/thomas/Devel/oce/inc/Standard_StdAllocator.hxx:89: error: expected class-name before ‘(’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp: At global scope:
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:4: error: ‘Standard_StdAllocatorTest’ has not been declared
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp: In member function ‘virtual void Standard_StdAllocatorTestSuite_testTraits_Test::TestBody()’:
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:11: error: ‘Handle_Standard_Transient’ does not name a type
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:12: error: ‘elem_type’ was not declared in this scope
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:12: error: template argument 1 is invalid
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:12: error: invalid type in declaration before ‘;’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:14: error: template argument 1 is invalid
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:14: error: expected `)' before ‘;’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:14: error: expected `)' before ‘;’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:15: error: template argument 1 is invalid
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:15: error: expected `)' before ‘;’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:15: error: expected `)' before ‘;’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:16: error: template argument 1 is invalid
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:16: error: expected `)' before ‘;’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:16: error: expected `)' before ‘;’ token
/Users/thomas/Devel/oce/test/Standard_StdAllocator_test/Standard_StdAllocator_test.cpp:18: error: expected `;' before ‘aDummy’
[...]