boost interprocess: memory allocation container

Hello, I am using boost 1.44 and trying to create shared memory and utilizing the segment manager with a interprocess map. I continually get a compile error when call the segment manager construct call. I can't figure out what the problem is. I have tried copy/paste example but continue to get the same error. "/usr/local/boost_1_44_0/boost/interprocess/detail/named_proxy.hpp:123:131: error: no matching function for call to 'forward(std::less<int>()&)' Below is the snippet of code: string driver_share = _cc.share_name + "_drivers"; using namespace boost::interprocess; //Clean up before creating shared memory shared_memory_object::remove(driver_share.c_str()); managed_shared_memory segment(create_only, driver_share.c_str(),65536); typedef boost::process::pid_type key_type; typedef boost::posix_time::ptime value_type; typedef std::pair<key_type, value_type> pair_type; typedef boost::interprocess::allocator<pair_type, managed_shared_memory::segment_manager> mem_allocator; typedef boost::interprocess::map<key_type, value_type, std::less<key_type>, mem_allocator> driver_map; const mem_allocator alloc_instance(segment.get_segment_manager()); driver_map *dmap = segment.construct<driver_map>("DriverMap")( std::less<int>(), alloc_instance); My include files are as follows: #include <boost/thread/thread.hpp> #include <boost/date_time/posix_time/posix_time_types.hpp> #include <boost/interprocess/managed_shared_memory.hpp> #include <boost/process/all.hpp> #include <boost/interprocess/allocators/allocator.hpp> #include <boost/interprocess/containers/map.hpp> #include <map> #include <functional> #include <iostream> using namespace boost; using namespace boost::posix_time; using namespace std; IF you know of any reason why I get this error that would be great.........I will continue to read the boost documentation. Regards carla Carla Strembicke Software Developer [cid:imagebf0008.jpg@2cac8a6e.ad7c4515] SUBNET Solutions Inc. www.SUBNET.com<http://www.subnet.com/> Making Substations More Intelligent T: 403.270.8885 F: 403.270.9631 #100, 4639 Manhattan Road SE, Calgary, Alberta, Canada; T2G 4B3 CONFIDENTIAL INFORMATION NOTICE: The information contained in this e-mail is privileged, confidential and intended solely for the use of the addressee named above. If the reader of this e-mail is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. If you received this in error, please contact the sender and destroy all copies of this e-mail. Thank you.

On 18/11/2010 19:28, Carla Strembicke wrote:
Hello,
I am using boost 1.44 and trying to create shared memory and utilizing the segment manager with a interprocess map.
I continually get a compile error when call the segment manager construct call. I can’t figure out what the problem is.
Seems to work on MSVC 7.1. Platform? If it's MSVC 10 then it will be fixed for Boost 1.45 or use trunk code. Best, Ion

I am on the linux platform using the gcc version 4.5.1. Below is the entire error of the make: make g++ -I.. -I../../../inc -I/usr/local/boost_1_44_0 -g -gstabs -D_UNIX -D_REENTRANT -std=c++0x -c ../subexec.cpp -o ../subexec.o In file included from /usr/local/boost_1_44_0/boost/interprocess/segment_manager.hpp:28:0, from /usr/local/boost_1_44_0/boost/interprocess/detail/managed_memory_impl.hpp:30, from /usr/local/boost_1_44_0/boost/interprocess/managed_shared_memory.hpp:21, from ../subexec.cpp:4: /usr/local/boost_1_44_0/boost/interprocess/detail/named_proxy.hpp: In member function ‘T* boost::interprocess::detail::named_proxy<SegmentManager, T, is_iterator>::operator()(Args&& ...) const [with Args = std::less<int>, const boost::interprocess::allocator<std::pair<int, boost::posix_time::ptime>, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index> >&, SegmentManager = boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index>, T = boost::container::map<int, boost::posix_time::ptime, boost::interprocess::allocator<std::pair<int, boost::posix_time::ptime>, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index> > >, bool is_iterator = false]’: ../subexec.cpp:60:17: instantiated from here /usr/local/boost_1_44_0/boost/interprocess/detail/named_proxy.hpp:123:131: error: no matching function for call to ‘forward(std::less<int>&)’ I still can't get it to work.....any suggestions? -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ion Gaztañaga Sent: Thursday, November 18, 2010 1:02 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] boost interprocess: memory allocation container On 18/11/2010 19:28, Carla Strembicke wrote:
Hello,
I am using boost 1.44 and trying to create shared memory and utilizing the segment manager with a interprocess map.
I continually get a compile error when call the segment manager construct call. I can’t figure out what the problem is.
Seems to work on MSVC 7.1. Platform? If it's MSVC 10 then it will be fixed for Boost 1.45 or use trunk code. Best, Ion _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On 19/11/2010 2:17, Carla Strembicke wrote:
I am on the linux platform using the gcc version 4.5.1.
Below is the entire error of the make:
make g++ -I.. -I../../../inc -I/usr/local/boost_1_44_0 -g -gstabs -D_UNIX -D_REENTRANT -std=c++0x -c ../subexec.cpp -o ../subexec.o In file included from /usr/local/boost_1_44_0/boost/interprocess/segment_manager.hpp:28:0, from /usr/local/boost_1_44_0/boost/interprocess/detail/managed_memory_impl.hpp:30, from /usr/local/boost_1_44_0/boost/interprocess/managed_shared_memory.hpp:21, from ../subexec.cpp:4: /usr/local/boost_1_44_0/boost/interprocess/detail/named_proxy.hpp: In member function ‘T* boost::interprocess::detail::named_proxy<SegmentManager, T, is_iterator>::operator()(Args&& ...) const [with Args = std::less<int>, const boost::interprocess::allocator<std::pair<int, boost::posix_time::ptime>, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index> >&, SegmentManager = boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index>, T = boost::container::map<int, boost::posix_time::ptime, boost::interprocess::allocator<std::pair<int, boost::posix_time::ptime>, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index> > >, bool is_iterator = false]’: ../subexec.cpp:60:17: instantiated from here /usr/local/boost_1_44_0/boost/interprocess/detail/named_proxy.hpp:123:131: error: no matching function for call to ‘forward(std::less<int>&)’
Can you try Trunk code or Boost 1.45 Relase Candidate code (http://boost.cowic.de/rc/) to see if the bug is already solved? I have no access to that compiler. Best, Ion

FYI - I upgraded to boost version 1_45 and the code now compiles. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ion Gaztañaga Sent: Thursday, November 18, 2010 11:31 PM To: Boost User List Subject: Re: [Boost-users] boost interprocess: memory allocation container On 19/11/2010 2:17, Carla Strembicke wrote:
I am on the linux platform using the gcc version 4.5.1.
Below is the entire error of the make:
make g++ -I.. -I../../../inc -I/usr/local/boost_1_44_0 -g -gstabs -D_UNIX g++ -D_REENTRANT -std=c++0x -c ../subexec.cpp -o ../subexec.o In file included from /usr/local/boost_1_44_0/boost/interprocess/segment_manager.hpp:28:0, from /usr/local/boost_1_44_0/boost/interprocess/detail/managed_memory_impl.hpp:30, from /usr/local/boost_1_44_0/boost/interprocess/managed_shared_memory.hpp:21, from ../subexec.cpp:4: /usr/local/boost_1_44_0/boost/interprocess/detail/named_proxy.hpp: In member function ‘T* boost::interprocess::detail::named_proxy<SegmentManager, T, is_iterator>::operator()(Args&& ...) const [with Args = std::less<int>, const boost::interprocess::allocator<std::pair<int, boost::posix_time::ptime>, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index> >&, SegmentManager = boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index>, T = boost::container::map<int, boost::posix_time::ptime, boost::interprocess::allocator<std::pair<int, boost::posix_time::ptime>, boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>, boost::interprocess::iset_index> > >, bool is_iterator = false]’: ../subexec.cpp:60:17: instantiated from here /usr/local/boost_1_44_0/boost/interprocess/detail/named_proxy.hpp:123: 131: error: no matching function for call to ‘forward(std::less<int>&)’
Can you try Trunk code or Boost 1.45 Relase Candidate code (http://boost.cowic.de/rc/) to see if the bug is already solved? I have no access to that compiler. Best, Ion _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Carla Strembicke
-
Ion Gaztañaga