container with volatile POD type
I have some (say, dynamically generated) code and STL container with POD
data (say, std::vector< T > of static_assert(std::is_floating_point< T
>::value, "!");) which accessed from that code.
Apparently I need to declare the data with the volatile qualifier. But in
such case gcc emits an errors:
c:\mingw\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\ext\new_allocator.h:110:
îøèáêà: invalid conversion from 'volatile void*' to 'void*' [-fpermissive]
{ ::operator delete(__p); }
c:\mingw\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\stl_construct.h:75:
îøèáêà: invalid static_cast from type 'volatile double*' to type 'void*'
{ ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
c:\mingw\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\stl_algobase.h:372:
error: invalid conversion from 'volatile void*' to 'void*' [-fpermissive]
__builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
^
c:\mingw\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\stl_algobase.h:372:
error: invalid conversion from 'const volatile void*' to 'const void*'
[-fpermissive]
Is this the only solution, that I should provide my own allocator with
proper correction of pointer conversions?
No comments:
Post a Comment