Index: file_mapping.hpp =================================================================== --- file_mapping.hpp (revision 45549) +++ file_mapping.hpp (working copy) @@ -55,7 +55,7 @@ //!After the call, "moved" does not represent any shared memory object. //!Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE - file_mapping(detail::moved_object &moved) + file_mapping(const detail::moved_object &moved) { this->swap(moved.get()); } #else file_mapping(file_mapping &&moved) @@ -67,7 +67,7 @@ //!Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE file_mapping &operator= - (detail::moved_object &moved) + (const detail::moved_object &moved) { file_mapping tmp(moved); this->swap(tmp); @@ -165,6 +165,13 @@ } } +//!This class is movable +template <> +struct is_movable +{ + enum { value = true }; +}; + } //namespace interprocess { } //namespace boost { Index: windows_shared_memory.hpp =================================================================== --- windows_shared_memory.hpp (revision 45549) +++ windows_shared_memory.hpp (working copy) @@ -83,7 +83,7 @@ //!Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE windows_shared_memory - (detail::moved_object &moved) + (const detail::moved_object &moved) { this->swap(moved.get()); } #else windows_shared_memory(windows_shared_memory &&moved) @@ -95,7 +95,7 @@ //!Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE windows_shared_memory &operator= - (detail::moved_object &moved) + (const detail::moved_object &moved) { windows_shared_memory tmp(moved); this->swap(tmp); @@ -235,6 +235,13 @@ } } +//!This class is movable +template <> +struct is_movable +{ + enum { value = true }; +}; + } //namespace interprocess { } //namespace boost { Index: mapped_region.hpp =================================================================== --- mapped_region.hpp (revision 45549) +++ mapped_region.hpp (working copy) @@ -79,7 +79,7 @@ //!Move constructor. *this will be constructed taking ownership of "other"'s //!region and "other" will be left in default constructor state. #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE - mapped_region(detail::moved_object other); + mapped_region(const detail::moved_object &other); #else mapped_region(mapped_region &&other); #endif @@ -91,7 +91,7 @@ //!Move assignment. If *this owns a memory mapped region, it will be //!destroyed and it will take ownership of "other"'s memory mapped region. #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE - mapped_region &operator=(detail::moved_object other); + mapped_region &operator=(const detail::moved_object &other); #else mapped_region &operator=(mapped_region &&other); #endif @@ -151,7 +151,7 @@ { x.swap(y); } #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE -inline mapped_region &mapped_region::operator=(detail::moved_object other) +inline mapped_region &mapped_region::operator=(const detail::moved_object &other) { this->swap(other.get()); return *this; } #else inline mapped_region &mapped_region::operator=(mapped_region &&other) @@ -178,7 +178,7 @@ {} #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE -inline mapped_region::mapped_region(detail::moved_object other) +inline mapped_region::mapped_region(const detail::moved_object &other) : m_base(0), m_size(0), m_offset(0) , m_extra_offset(0) , m_file_mapping_hnd(detail::invalid_file()) @@ -382,7 +382,7 @@ {} #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE -inline mapped_region::mapped_region(detail::moved_object other) +inline mapped_region::mapped_region(const detail::moved_object &other) : m_base(MAP_FAILED), m_size(0), m_offset(0), m_extra_offset(0) { this->swap(other.get()); } #else @@ -555,6 +555,13 @@ }; /// @endcond +//!This class is movable +template <> +struct is_movable +{ + enum { value = true }; +}; + } //namespace interprocess { } //namespace boost { Index: managed_heap_memory.hpp =================================================================== --- managed_heap_memory.hpp (revision 45549) +++ managed_heap_memory.hpp (working copy) @@ -72,7 +72,7 @@ //!Moves the ownership of "moved"'s managed memory to *this. Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE basic_managed_heap_memory - (detail::moved_object &moved) + (const detail::moved_object &moved) { this->swap(moved.get()); } #else basic_managed_heap_memory(basic_managed_heap_memory &&moved) @@ -82,7 +82,7 @@ //!Moves the ownership of "moved"'s managed memory to *this. Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE basic_managed_heap_memory &operator= - (detail::moved_object &moved) + (const detail::moved_object &moved) { this->swap(moved.get()); return *this; } #else basic_managed_heap_memory &operator= @@ -139,6 +139,18 @@ /// @endcond }; +template + < + class CharType, + class AllocationAlgorithm, + template class IndexType + > +struct is_movable > +{ + enum { value = true }; +}; + } //namespace interprocess { } //namespace boost { Index: shared_memory_object.hpp =================================================================== --- shared_memory_object.hpp (revision 45549) +++ shared_memory_object.hpp (working copy) @@ -76,7 +76,7 @@ //!Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE shared_memory_object - (detail::moved_object &moved) + (const detail::moved_object &moved) { this->swap(moved.get()); } #else shared_memory_object(shared_memory_object &&moved) @@ -88,7 +88,7 @@ //!Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE shared_memory_object &operator= - (detail::moved_object &moved) + (const detail::moved_object &moved) { shared_memory_object tmp(moved); this->swap(tmp); @@ -341,6 +341,13 @@ #endif +//!This class is movable +template <> +struct is_movable +{ + enum { value = true }; +}; + } //namespace interprocess { } //namespace boost { Index: managed_external_buffer.hpp =================================================================== --- managed_external_buffer.hpp (revision 45549) +++ managed_external_buffer.hpp (working copy) @@ -46,6 +46,9 @@ /// @endcond public: + //!Constructor. Allocates basic resources. Never throws. + basic_managed_external_buffer() {} + //!Creates and places the segment manager. This can throw basic_managed_external_buffer (create_only_t, void *addr, std::size_t size) @@ -71,7 +74,7 @@ //!Moves the ownership of "moved"'s managed memory to *this. Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE basic_managed_external_buffer - (detail::moved_object &moved) + (const detail::moved_object &moved) { this->swap(moved.get()); } #else basic_managed_external_buffer @@ -82,7 +85,7 @@ //!Moves the ownership of "moved"'s managed memory to *this. Does not throw #ifndef BOOST_INTERPROCESS_RVALUE_REFERENCE basic_managed_external_buffer &operator= - (detail::moved_object &moved) + (const detail::moved_object &moved) { this->swap(moved.get()); return *this; } #else basic_managed_external_buffer &operator= @@ -100,6 +103,18 @@ }; +template + < + class CharType, + class AllocationAlgorithm, + template class IndexType + > +struct is_movable > +{ + enum { value = true }; +}; + } //namespace interprocess { } //namespace boost {