File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 21
21
#define __DATACACHE_ENTITY_CACHE_HPP__
22
22
23
23
#include < algorithm>
24
+ #include < type_traits>
24
25
#include < boost/interprocess/exceptions.hpp>
25
26
#include < boost/interprocess/allocators/allocator.hpp>
26
27
#include < boost/interprocess/containers/string.hpp>
@@ -276,7 +277,9 @@ class entity_cache
276
277
}
277
278
private:
278
279
void attach () const {
279
- _segment_ptr.reset (new segment_t (bip::open_only,_store_name.c_str ()) ) ;
280
+ if constexpr ( !std::is_same_v<segment_t , boost::interprocess::managed_heap_memory> ) {
281
+ _segment_ptr.reset (new segment_t (bip::open_only,_store_name.c_str ()) ) ;
282
+ }
280
283
_container_ptr = _segment_ptr->template find_or_construct <Container_t>(_cache_name.c_str ())
281
284
(typename Container_t::ctor_args_list (), typename Container_t::allocator_type (_segment_ptr->get_segment_manager ()));
282
285
}
You can’t perform that action at this time.
0 commit comments