Initialising boost::interprocess::basic_string using std::string

18 Mar
2010
18 Mar
'10
5:17 p.m.
Hi all How to initialising boost::interprocess::basic_string using std::string; -- One God is Allah, all prophets are humans.

19 Mar
19 Mar
1:49 a.m.
New subject: Initialising boost::interprocess::basic_string using std::string
El 18/03/2010 18:17, med ennemri escribió:
Hi all How to initialising boost::interprocess::basic_string using std::string;
Use this constructor passing std::string::c_str() (and don't forget the allocator, interprocess containers need always a valid allocator to allocate memory in shared memory): basic_string(const CharT* s, const allocator_type& a = allocator_type()) typedef /*...*/ interprocess_string_t; interprocess_string_t * = managed_shm.construct<interprocess_string_t>("name") (std_str.c_str(), managed_shm.get_allocator<char>()); Best, Ion
5547
Age (days ago)
5548
Last active (days ago)
1 comments
2 participants
participants (2)
-
Ion Gaztañaga
-
med ennemri