Boost C++ Libraries: Ticket #1634: boost::interprocess::vector cannot contain volatile int https://svn.boost.org/trac10/ticket/1634 <p> It does not appear to be possible to create a boost::interprocess::vector&lt;volatile int&gt;. When modifying the example at <a class="ext-link" href="http://igaztanaga.drivehq.com/interprocess/interprocess/quick_guide/qg_interprocess_container.html"><span class="icon">​</span>http://igaztanaga.drivehq.com/interprocess/interprocess/quick_guide/qg_interprocess_container.html</a> to use volatile int instead of int I get the following long list of errors. </p> <pre class="wiki">boost/interprocess/containers/vector.hpp: In member function ‘void boost::interprocess::vector&lt;T, A&gt;::push_back(const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’: volint.cpp:37: instantiated from here boost/interprocess/containers/vector.hpp:853: error: invalid conversion from ‘volatile void*’ to ‘void*’ boost/interprocess/containers/vector.hpp:853: error: initializing argument 2 of ‘void* operator new(size_t, void*)’ boost/interprocess/allocators/allocator.hpp: In member function ‘void boost::interprocess::allocator&lt;T, SegmentManager&gt;::deallocate(const typename boost::interprocess::detail::pointer_to_other&lt;typename boost::interprocess::detail::pointer_to_other&lt;typename SegmentManager::void_pointer, const void&gt;::type, T&gt;::type&amp;, size_t) [with T = volatile int, SegmentManager = boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt;]’: boost/interprocess/containers/vector.hpp:1284: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_range_insert_new_allocation(T*, typename A::size_type, T*, FwdIt, FwdIt) [with FwdIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1202: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_range_insert(typename A::pointer, FwdIt, FwdIt, std::forward_iterator_tag) [with FwdIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1772: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_insert_dispatch(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt, boost::interprocess::detail::false_) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:994: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1005: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, typename A::size_type, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:946: instantiated from ‘boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt; boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:857: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::push_back(const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ volint.cpp:37: instantiated from here boost/interprocess/allocators/allocator.hpp:157: error: invalid conversion from ‘volatile void*’ to ‘void*’ boost/interprocess/allocators/allocator.hpp:157: error: initializing argument 1 of ‘void boost::interprocess::segment_manager_base&lt;MemoryManager&gt;::deallocate(void*) [with MemoryAlgorithm = boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;]’ /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_construct.h: In function ‘void std::_Construct(_T1*, const _T2&amp;) [with _T1 = volatile int, _T2 = volatile int]’: /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_uninitialized.h:86: instantiated from ‘_ForwardIterator std::__uninitialized_copy_aux(_InputIterator, _InputIterator, _ForwardIterator, __false_type) [with _InputIterator = boost::interprocess::detail::move_iterator&lt;volatile int*&gt;, _ForwardIterator = volatile int*]’ /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_uninitialized.h:113: instantiated from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = boost::interprocess::detail::move_iterator&lt;volatile int*&gt;, _ForwardIterator = volatile int*]’ boost/interprocess/containers/vector.hpp:1223: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_range_insert_expand_forward(T*, FwdIt, FwdIt, typename A::size_type) [with FwdIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1187: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_range_insert(typename A::pointer, FwdIt, FwdIt, std::forward_iterator_tag) [with FwdIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1772: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_insert_dispatch(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt, boost::interprocess::detail::false_) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:994: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1005: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, typename A::size_type, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:946: instantiated from ‘boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt; boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:857: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::push_back(const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ volint.cpp:37: instantiated from here /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_construct.h:81: error: invalid static_cast from type ‘volatile int*’ to type ‘void*’ boost/interprocess/mem_algo/rbtree_best_fit.hpp: In member function ‘std::pair&lt;T*, bool&gt; boost::interprocess::rbtree_best_fit&lt;MutexFamily, VoidMutex&gt;::allocation_command(boost::interprocess::allocation_type, size_t, size_t, size_t&amp;, T*) [with T = volatile int, MutexFamily = boost::interprocess::mutex_family, VoidPointer = boost::interprocess::offset_ptr&lt;void&gt;]’: boost/interprocess/segment_manager.hpp:186: instantiated from ‘std::pair&lt;T*, bool&gt; boost::interprocess::segment_manager_base&lt;MemoryManager&gt;::allocation_command(boost::interprocess::allocation_type, size_t, size_t, size_t&amp;, T*) [with T = volatile int, MemoryAlgorithm = boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;]’ boost/interprocess/allocators/allocator.hpp:178: instantiated from ‘std::pair&lt;typename boost::interprocess::detail::pointer_to_other&lt;typename boost::interprocess::detail::pointer_to_other&lt;typename SegmentManager::void_pointer, const void&gt;::type, T&gt;::type, bool&gt; boost::interprocess::allocator&lt;T, SegmentManager&gt;::allocation_command(boost::interprocess::allocation_type, size_t, size_t, size_t&amp;, const typename boost::interprocess::detail::pointer_to_other&lt;typename boost::interprocess::detail::pointer_to_other&lt;typename SegmentManager::void_pointer, const void&gt;::type, T&gt;::type&amp;) [with T = volatile int, SegmentManager = boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt;]’ boost/interprocess/containers/vector.hpp:305: instantiated from ‘std::pair&lt;typename A::pointer, bool&gt; boost::interprocess::detail::vector_alloc_holder&lt;A&gt;::allocation_command(boost::interprocess::allocation_type, typename A::size_type, typename A::size_type, typename A::size_type&amp;, const typename A::pointer&amp;, boost::interprocess::detail::integral_constant&lt;unsigned int, 2u&gt;) [with A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:277: instantiated from ‘std::pair&lt;typename A::pointer, bool&gt; boost::interprocess::detail::vector_alloc_holder&lt;A&gt;::allocation_command(boost::interprocess::allocation_type, typename A::size_type, typename A::size_type, typename A::size_type&amp;, const typename A::pointer&amp;) [with A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1174: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_range_insert(typename A::pointer, FwdIt, FwdIt, std::forward_iterator_tag) [with FwdIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1772: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_insert_dispatch(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt, boost::interprocess::detail::false_) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:994: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1005: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, typename A::size_type, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:946: instantiated from ‘boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt; boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:857: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::push_back(const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ volint.cpp:37: instantiated from here boost/interprocess/mem_algo/rbtree_best_fit.hpp:643: error: invalid conversion from ‘volatile void*’ to ‘void*’ boost/interprocess/mem_algo/rbtree_best_fit.hpp:643: error: initializing argument 2 of ‘static bool boost::interprocess::detail::memory_algorithm_common&lt;MemoryAlgorithm&gt;::try_shrink(MemoryAlgorithm*, void*, size_t, size_t, size_t&amp;) [with MemoryAlgorithm = boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;]’ boost/interprocess/segment_manager.hpp:186: instantiated from ‘std::pair&lt;T*, bool&gt; boost::interprocess::segment_manager_base&lt;MemoryManager&gt;::allocation_command(boost::interprocess::allocation_type, size_t, size_t, size_t&amp;, T*) [with T = volatile int, MemoryAlgorithm = boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;]’ boost/interprocess/allocators/allocator.hpp:178: instantiated from ‘std::pair&lt;typename boost::interprocess::detail::pointer_to_other&lt;typename boost::interprocess::detail::pointer_to_other&lt;typename SegmentManager::void_pointer, const void&gt;::type, T&gt;::type, bool&gt; boost::interprocess::allocator&lt;T, SegmentManager&gt;::allocation_command(boost::interprocess::allocation_type, size_t, size_t, size_t&amp;, const typename boost::interprocess::detail::pointer_to_other&lt;typename boost::interprocess::detail::pointer_to_other&lt;typename SegmentManager::void_pointer, const void&gt;::type, T&gt;::type&amp;) [with T = volatile int, SegmentManager = boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt;]’ boost/interprocess/containers/vector.hpp:305: instantiated from ‘std::pair&lt;typename A::pointer, bool&gt; boost::interprocess::detail::vector_alloc_holder&lt;A&gt;::allocation_command(boost::interprocess::allocation_type, typename A::size_type, typename A::size_type, typename A::size_type&amp;, const typename A::pointer&amp;, boost::interprocess::detail::integral_constant&lt;unsigned int, 2u&gt;) [with A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:277: instantiated from ‘std::pair&lt;typename A::pointer, bool&gt; boost::interprocess::detail::vector_alloc_holder&lt;A&gt;::allocation_command(boost::interprocess::allocation_type, typename A::size_type, typename A::size_type, typename A::size_type&amp;, const typename A::pointer&amp;) [with A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1174: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_range_insert(typename A::pointer, FwdIt, FwdIt, std::forward_iterator_tag) [with FwdIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1772: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::priv_insert_dispatch(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt, boost::interprocess::detail::false_) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:994: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, InIt, InIt) [with InIt = boost::interprocess::constant_iterator&lt;volatile int, int&gt;, T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:1005: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, typename A::size_type, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:946: instantiated from ‘boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt; boost::interprocess::vector&lt;T, A&gt;::insert(boost::interprocess::detail::vector_iterator&lt;typename A::pointer&gt;, const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ boost/interprocess/containers/vector.hpp:857: instantiated from ‘void boost::interprocess::vector&lt;T, A&gt;::push_back(const T&amp;) [with T = volatile int, A = boost::interprocess::allocator&lt;volatile int, boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void&gt; &gt;, boost::interprocess::iset_index&gt; &gt;]’ volint.cpp:37: instantiated from here boost/interprocess/mem_algo/rbtree_best_fit.hpp:647: error: invalid conversion from ‘volatile void*’ to ‘void*’ boost/interprocess/mem_algo/rbtree_best_fit.hpp:647: error: initializing argument 5 of ‘std::pair&lt;void*, bool&gt; boost::interprocess::rbtree_best_fit&lt;MutexFamily, VoidMutex&gt;::priv_allocation_command(boost::interprocess::allocation_type, size_t, size_t, size_t&amp;, void*, size_t) [with MutexFamily = boost::interprocess::mutex_family, VoidPointer = boost::interprocess::offset_ptr&lt;void&gt;]’ make[2]: *** [CMakeFiles/volint.dir/volint.o] Error 1 make[1]: *** [CMakeFiles/volint.dir/all] Error 2 make: *** [all] Error 2 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1634 Trac 1.4.3 Ion Gaztañaga Thu, 03 Apr 2008 12:50:34 GMT <link>https://svn.boost.org/trac10/ticket/1634#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1634#comment:1</guid> <description> <p> I've reproduced the bug, but I'm curious to know why do you want to have a vector of volatile elements. Volatile is used for mapped I/O so it does not match very well with an standard container. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 08 Apr 2008 17:24:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1634#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1634#comment:2</guid> <description> <p> Simply put, I use volatile ints (in fact boost::uint32_t) to atomically signal states between processes. There is one application that "listens" to events from a lot of other applications, and they signal their states by incrementing the volatile ints and signalling a semaphore that triggers the listener. The reason for volatility is the use of atomic ops, that need volatile ints. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Tue, 18 Nov 2008 07:55:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1634#comment:3 https://svn.boost.org/trac10/ticket/1634#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> std::vector&lt;volatile int&gt; does not seem to be standard. both visual 7.1 and gcc 3.5 refuse to compile the code: </p> <p> std::vector&lt;volatile int&gt; v(5); </p> Ticket