Comments (16)
Hello,
std::allocator_traits<T>
should be used from c++11, and I guess it only started to work in GCC 4.9.
Could you please try adding these lines in StdPolyAlloc
ext/utils/memory_resource.h ?
using pointer = T*;
using const_pointer = const T*;
using reference = T&;
using const_reference = const T&;
using size_type = size_t;
using difference_type = ptrdiff_t;
template<typename U>
struct rebind {
using other = StdPolyAlloc<U>;
};
This would emulate old allocator behaviour.
from bitsery.
Thanks for you quick answer.
Here is the new log:
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h: In constructor 'bitsery::ext::pointer_utils::PointerLinkingContextSerialization::PointerLinkingContextSerialization(bitsery::ext::MemResourceBase*)':
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h:156:105: error: no matching function for call to 'std::unordered_map<const void*, bitsery::ext::pointer_utils::PLCInfoSerializer, std::hash<const void*>, std::equal_to<const void*>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> > >::unordered_map(<brace-enclosed initializer list>)'
_ptrMap{StdPolyAlloc<std::pair<const void* const, PLCInfoSerializer>>{memResource}} {}
^
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h:156:105: note: candidates are:
In file included from /usr/include/c++/4.8.2/unordered_map:48:0,
from /__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h:26,
from /__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/std_smart_ptr.h:28,
from /__w/OpenGeode/OpenGeode/include/geode/basic/pimpl.h:29,
from /__w/OpenGeode/OpenGeode/include/geode/basic/logger.h:30,
from /__w/OpenGeode/OpenGeode/src/geode/basic/assert.cpp:28:
/usr/include/c++/4.8.2/bits/unordered_map.h:184:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type>, std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(initializer_list<value_type> __l,
^
/usr/include/c++/4.8.2/bits/unordered_map.h:184:7: note: no known conversion for argument 1 from 'bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >' to 'std::initializer_list<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >'
/usr/include/c++/4.8.2/bits/unordered_map.h:171:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&&) [with _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(unordered_map&&) = default;
^
/usr/include/c++/4.8.2/bits/unordered_map.h:171:7: note: no known conversion for argument 1 from 'bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >' to 'std::unordered_map<const void*, bitsery::ext::pointer_utils::PLCInfoSerializer, std::hash<const void*>, std::equal_to<const void*>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> > >&&'
/usr/include/c++/4.8.2/bits/unordered_map.h:168:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&) [with _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(const unordered_map&) = default;
^
/usr/include/c++/4.8.2/bits/unordered_map.h:168:7: note: no known conversion for argument 1 from 'bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >' to 'const std::unordered_map<const void*, bitsery::ext::pointer_utils::PLCInfoSerializer, std::hash<const void*>, std::equal_to<const void*>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> > >&'
/usr/include/c++/4.8.2/bits/unordered_map.h:159:2: note: template<class _InputIterator> std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(_InputIterator, _InputIterator, std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&)
unordered_map(_InputIterator __f, _InputIterator __l,
^
from bitsery.
Ok, part 2 ;)
It looks like constructor doesn't exist.
explicit unordered_map( const Allocator& alloc ); // (since C++11)
maybe other constructors exists ;)
unordered_map( const unordered_map& other, const Allocator& alloc ); // (since C++11)
// or
unordered_map(unordered_map&& other, const Allocator& alloc ); // (since C++11)
if any of these constructors exist, than simply change this line:
_ptrMap{ {}, StdPolyAlloc<std::pair<const void* const, PLCInfoSerializer>>{memResource}} {}
Since GCC4.9 there was some changed to the unordered map, included missing constructor because I have tested bitsery with this version.
The associative containers in <map> and <set> and the unordered associative containers in <unordered_map> and <unordered_set> meet the allocator-aware container requirements;
But hope this will help.
from bitsery.
Not yet 😞
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h: In constructor 'bitsery::ext::pointer_utils::PointerLinkingContextSerialization::PointerLinkingContextSerialization(bitsery::ext::MemResourceBase*)':
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h:156:109: error: no matching function for call to 'std::unordered_map<const void*, bitsery::ext::pointer_utils::PLCInfoSerializer, std::hash<const void*>, std::equal_to<const void*>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> > >::unordered_map(<brace-enclosed initializer list>)'
_ptrMap{{}, StdPolyAlloc<std::pair<const void* const, PLCInfoSerializer>>{memResource}} {}
^
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h:156:109: note: candidates are:
In file included from /usr/include/c++/4.8.2/unordered_map:48:0,
from /__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h:26,
from /__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/std_smart_ptr.h:28,
from /__w/OpenGeode/OpenGeode/include/geode/basic/pimpl.h:29,
from /__w/OpenGeode/OpenGeode/include/geode/basic/logger.h:30,
from /__w/OpenGeode/OpenGeode/src/geode/basic/assert.cpp:28:
/usr/include/c++/4.8.2/bits/unordered_map.h:184:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type>, std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(initializer_list<value_type> __l,
^
/usr/include/c++/4.8.2/bits/unordered_map.h:184:7: note: no known conversion for argument 2 from 'bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >' to 'std::unordered_map<const void*, bitsery::ext::pointer_utils::PLCInfoSerializer, std::hash<const void*>, std::equal_to<const void*>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> > >::size_type {aka long unsigned int}'
/usr/include/c++/4.8.2/bits/unordered_map.h:171:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&&) [with _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(unordered_map&&) = default;
^
/usr/include/c++/4.8.2/bits/unordered_map.h:171:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/unordered_map.h:168:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&) [with _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(const unordered_map&) = default;
^
/usr/include/c++/4.8.2/bits/unordered_map.h:168:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/4.8.2/bits/unordered_map.h:159:2: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(_InputIterator, _InputIterator, std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _InputIterator = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(_InputIterator __f, _InputIterator __l,
^
/usr/include/c++/4.8.2/bits/unordered_map.h:159:2: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >'
/usr/include/c++/4.8.2/bits/unordered_map.h:138:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<const void*>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >]
unordered_map(size_type __n = 10,
^
/usr/include/c++/4.8.2/bits/unordered_map.h:138:7: note: no known conversion for argument 2 from 'bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >' to 'const hasher& {aka const std::hash<const void*>&}'
from bitsery.
I looked at gcc4.8.2 unordered_map
implementation, and maybe you can use this constructor. Try replacing that line with
_ptrMap{ 0, std::hash<const void*>{}, std::equal_to<const void*>{}, StdPolyAlloc<std::pair<const void* const, PLCInfoSerializer>>{memResource}} {}
from bitsery.
Work in progress! 👍
New log
/usr/include/c++/4.8.2/bits/hashtable.h: In instantiation of 'void std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_deallocate_node(std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type*) [with _Key = const void*; _Value = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<const void*>; _H1 = std::hash<const void*>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type = std::__detail::_Hash_node<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, false>]':
/usr/include/c++/4.8.2/bits/hashtable.h:763:28: required from 'void std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_deallocate_nodes(std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type*) [with _Key = const void*; _Value = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<const void*>; _H1 = std::hash<const void*>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type = std::__detail::_Hash_node<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, false>]'
/usr/include/c++/4.8.2/bits/hashtable.h:1641:37: required from 'void std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::clear() [with _Key = const void*; _Value = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<const void*>; _H1 = std::hash<const void*>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>]'
/usr/include/c++/4.8.2/bits/hashtable.h:958:13: required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::~_Hashtable() [with _Key = const void*; _Value = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<const void*>; _H1 = std::hash<const void*>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>]'
/usr/include/c++/4.8.2/bits/unordered_map.h:97:11: required from here
/usr/include/c++/4.8.2/bits/hashtable.h:746:7: error: 'std::_Hashtable<const void*, std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >, std::__detail::_Select1st, std::equal_to<const void*>, std::hash<const void*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_Node_allocator_type' has no member named 'destroy'
_M_node_allocator().destroy(__n);
^
/usr/include/c++/4.8.2/bits/hashtable.h: In instantiation of 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type* std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_allocate_node(_Args&& ...) [with _Args = {const void*&, bitsery::ext::pointer_utils::PLCInfoSerializer}; _Key = const void*; _Value = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<const void*>; _H1 = std::hash<const void*>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__node_type = std::__detail::_Hash_node<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, false>]':
/usr/include/c++/4.8.2/bits/hashtable.h:1260:71: required from 'std::pair<typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::iterator, bool> std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_emplace(std::true_type, _Args&& ...) [with _Args = {const void*&, bitsery::ext::pointer_utils::PLCInfoSerializer}; _Key = const void*; _Value = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<const void*>; _H1 = std::hash<const void*>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::iterator = std::__detail::_Node_iterator<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, false, false>; std::true_type = std::integral_constant<bool, true>]'
/usr/include/c++/4.8.2/bits/hashtable.h:665:69: required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__ireturn_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::emplace(_Args&& ...) [with _Args = {const void*&, bitsery::ext::pointer_utils::PLCInfoSerializer}; _Key = const void*; _Value = std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<const void*>; _H1 = std::hash<const void*>; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<false, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__ireturn_type = std::pair<std::__detail::_Node_iterator<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, false, false>, bool>]'
/usr/include/c++/4.8.2/bits/unordered_map.h:311:54: required from 'std::pair<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::iterator, bool> std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_Args&& ...) [with _Args = {const void*&, bitsery::ext::pointer_utils::PLCInfoSerializer}; _Key = const void*; _Tp = bitsery::ext::pointer_utils::PLCInfoSerializer; _Hash = std::hash<const void*>; _Pred = std::equal_to<const void*>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::iterator = std::__detail::_Node_iterator<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, false, false>]'
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/pointer_utils.h:169:93: required from here
/usr/include/c++/4.8.2/bits/hashtable.h:727:6: error: 'std::_Hashtable<const void*, std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const void* const, bitsery::ext::pointer_utils::PLCInfoSerializer> >, std::__detail::_Select1st, std::equal_to<const void*>, std::hash<const void*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_Node_allocator_type' has no member named 'construct'
_M_node_allocator().construct(__n, std::forward<_Args>(__args)...);
^
BTW, you can follow my changes here: master...Geode-solutions:master
from bitsery.
I guess we need to finish implementing remaining allocator methods that was required before c++11 for StdPolyAlloc.
max_size, construct, destroy as in here. I will try to do it tomorrow if I have time.
from bitsery.
I hope, that these would be enough in StdPolyAlloc
:
size_t max_size() const noexcept {
return std::numeric_limits<size_t>::max() / sizeof(value_type);
}
void construct(T *p, const T &val) {
new((void *) p) T(val);
}
template<class U, class... Args>
void construct(U *p, Args &&... args) {
new((void *) p) U(std::forward<Args>(args)...);
}
void destroy(T *p) {
p->~T();
}
template<class U>
void destroy(U *p) {
p->~U();
}
Hope that helps
from bitsery.
Seems better but still an error.
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/std_map.h: In instantiation of 'void bitsery::ext::StdMap::deserialize(Des&, T&, Fnc&&) const [with Des = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >; T = absl::flat_hash_map<std::basic_string<char>, std::shared_ptr<geode::AttributeBase> >; Fnc = geode::AttributeManager::Impl::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda27::__lambda28]':
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/deserializer.h:227:13: required from 'void bitsery::Deserializer<TInputAdapter, TContext>::ext(T&, const Ext&, Fnc&&) [with T = absl::flat_hash_map<std::basic_string<char>, std::shared_ptr<geode::AttributeBase> >; Ext = bitsery::ext::StdMap; Fnc = geode::AttributeManager::Impl::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda27::__lambda28; TInputAdapter = bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >; TContext = std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext>]'
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:171:21: required from 'geode::AttributeManager::Impl::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda27'
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:169:18: required from 'struct geode::AttributeManager::Impl::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda27'
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:168:13: required from 'void geode::AttributeManager::Impl::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]'
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/details/serialization_common.h:41:13: required from 'static decltype (obj.serialize(s)) bitsery::Access::serialize(S&, T&) [with S = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >; T = geode::AttributeManager::Impl; decltype (obj.serialize(s)) = void]'
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/details/serialization_common.h:280:39: [ skipping 13 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/details/serialization_common.h:257:72: required from 'static void bitsery::details::SerializeFunction<S, T>::invoke(S&, T&) [with S = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >; T = geode::PImpl<geode::AttributeManager::Impl>&]'
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/deserializer.h:181:92: required from 'void bitsery::Deserializer<TInputAdapter, TContext>::object(T&&) [with T = geode::PImpl<geode::AttributeManager::Impl>&; TInputAdapter = bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >; TContext = std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext>]'
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:268:17: required from 'geode::AttributeManager::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda29'
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:267:14: required from 'struct geode::AttributeManager::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda29'
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:266:9: required from 'void geode::AttributeManager::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]'
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:272:5: required from here
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/std_map.h:67:40: error: no match for call to '(geode::AttributeManager::Impl::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda27::__lambda28) (bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >&, std::initializer_list<std::basic_string<char> >&, std::initializer_list<std::shared_ptr<geode::AttributeBase> >&)'
fnc(des, key, value);
^
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:173:26: note: candidates are:
[]( Archive &archive, std::string &name,
^
In file included from /__w/OpenGeode/OpenGeode/include/geode/basic/attribute.h:36:0,
from /__w/OpenGeode/OpenGeode/include/geode/basic/attribute_manager.h:33,
from /__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:24:
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/std_map.h:67:40: note: void (*)(bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >&, std::string&, std::shared_ptr<geode::AttributeBase>&) {aka void (*)(bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >&, std::basic_string<char>&, std::shared_ptr<geode::AttributeBase>&)} <conversion>
fnc(des, key, value);
^
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/std_map.h:67:40: note: candidate expects 4 arguments, 4 provided
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:174:73: note: geode::AttributeManager::Impl::serialize(Archive&) [with Archive = bitsery::Deserializer<bitsery::BasicInputStreamAdapter<char, bitsery::DefaultConfig, std::char_traits<char> >, std::tuple<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext> >]::__lambda27::__lambda28
std::shared_ptr< AttributeBase > &attribute ) {
^
/__w/OpenGeode/OpenGeode/src/geode/basic/attribute_manager.cpp:174:73: note: no known conversion for argument 2 from 'std::initializer_list<std::basic_string<char> >' to 'std::string& {aka std::basic_string<char>&}'
here is the refenreced line: https://github.com/Geode-solutions/OpenGeode/blob/v4-CI/src/geode/basic/attribute_manager.cpp#L174
Is this time an error on my side?
from bitsery.
The problem is in StdMap replace these two lines with this:
auto key = bitsery::Access::create<TKey>();
auto value = bitsery::Access::create<TValue>();
The same is in StdSet replace it with:
auto key = bitsery::Access::create<TKey>();
I think these are the only two places in project, if my searched correctly :)
You can find more information about it on stackoverflow
from bitsery.
There is still some error.. But it is better !
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/memory_resource.h:135:41: error: expected type-specifier before 'ptrdiff_t'
using difference_type = ptrdiff_t;
^
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/polymorphism_utils.h: In instantiation of 'bitsery::ext::PolymorphicContext<RTTI>::PolymorphicContext(bitsery::ext::MemResourceBase*) [with RTTI = bitsery::ext::StandardRTTI]':
/usr/include/c++/4.8.2/tuple:132:22: required from 'constexpr std::_Head_base<_Idx, _Head, false>::_Head_base() [with long unsigned int _Idx = 0ul; _Head = bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>]'
/usr/include/c++/4.8.2/tuple:253:29: required from 'constexpr std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Tuple_impl() [with long unsigned int _Idx = 0ul; _Head = bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>; _Tail = {bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext}]'
/usr/include/c++/4.8.2/tuple:396:20: required from 'constexpr std::tuple< <template-parameter-1-1> >::tuple() [with _Elements = {bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>, bitsery::ext::PointerLinkingContext, bitsery::ext::InheritanceContext}]'
/__w/OpenGeode/OpenGeode/tests/basic/test-attribute.cpp:220:29: required from here
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/polymorphism_utils.h:191:93: error: no matching function for call to 'std::unordered_map<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey, std::shared_ptr<bitsery::ext::PolymorphicHandlerBase>, bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKeyHashier, std::equal_to<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey, std::shared_ptr<bitsery::ext::PolymorphicHandlerBase> > > >::unordered_map(<brace-enclosed initializer list>)'
std::vector<size_t, pointer_utils::StdPolyAlloc<size_t>>>>{memResource}}
^
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/polymorphism_utils.h:191:93: note: candidates are:
In file included from /usr/include/c++/4.8.2/unordered_map:48:0,
from /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/algorithm/container.h:48,
from /__w/OpenGeode/OpenGeode/build/third_party/abseil/install/include/absl/container/flat_hash_map.h:38,
from /__w/OpenGeode/OpenGeode/include/geode/basic/attribute.h:29,
from /__w/OpenGeode/OpenGeode/tests/basic/test-attribute.cpp:26:
/usr/include/c++/4.8.2/bits/unordered_map.h:184:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type>, std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey; _Tp = std::shared_ptr<bitsery::ext::PolymorphicHandlerBase>; _Hash = bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKeyHashier; _Pred = std::equal_to<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey>; _Alloc = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey, std::shared_ptr<bitsery::ext::PolymorphicHandlerBase> > >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::is_default_constructible<_Hash>, std::is_copy_assignable<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::value_type = std::pair<const bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey, std::shared_ptr<bitsery::ext::PolymorphicHandlerBase> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKeyHashier; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey, std::shared_ptr<bitsery::ext::PolymorphicHandlerBase> > >]
unordered_map(initializer_list<value_type> __l,
^
/usr/include/c++/4.8.2/bits/unordered_map.h:184:7: note: no known conversion for argument 1 from 'bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey, std::shared_ptr<bitsery::ext::PolymorphicHandlerBase> > >' to 'std::initializer_list<std::pair<const bitsery::ext::PolymorphicContext<bitsery::ext::StandardRTTI>::BaseToDerivedKey, std::shared_ptr<bitsery::ext::PolymorphicHandlerBase> > >'
Thank you very much for your help and very quick answers!
from bitsery.
Maybe missing #include <cstddef>
?
from bitsery.
Adding the include fixed the first error but not the second one.
from bitsery.
Sorry, missed the other error.
Try replacing this constructor with this:
explicit PolymorphicContext(MemResourceBase* memResource = nullptr)
:_memResource{memResource},
_baseToDerivedMap{0, BaseToDerivedKeyHashier{}, std::equal_to<BaseToDerivedKey>{}, pointer_utils::StdPolyAlloc<std::pair<const BaseToDerivedKey,
std::shared_ptr<PolymorphicHandlerBase>>>{memResource}},
_baseToDerivedArray{0, std::hash<size_t>{}, std::equal_to<size_t>{}, pointer_utils::StdPolyAlloc<std::pair<const size_t,
std::vector<size_t, pointer_utils::StdPolyAlloc<size_t>>>>{memResource}}
{}
I wonder, how many errors still awaits ;)
from bitsery.
It works! 🎉
Here is the final (unformated) diff master...Geode-solutions:master
Thanks a lot for your help!
from bitsery.
I'm glad, that it worked on older compiler as well ;)
I'm especially happy, that this compiler actually is in conformance with C++11 regarding auto deduction rules with brace initialization. (although these cases have been solved in C++17)
from bitsery.
Related Issues (20)
- Custom Extension HOT 1
- bug in apple libc++ ARM hash_code function HOT 2
- Windows and boost::json - compile error HOT 1
- Need help writing separate serializer and deserializer functions for a custom vector type HOT 1
- Easy serialization for POD types HOT 12
- It can't serialize a array member HOT 4
- How to serialize a pointer of map? HOT 2
- Vector of variants with a bit-packed type HOT 2
- Example usage of uint8_t* buffer? HOT 5
- Is bitsery faster than capnp? HOT 1
- Proper way to determine required buffer size before serializing? HOT 2
- Vector<String *> HOT 1
- Vector of bit-packed structs not measuring correctly? HOT 6
- Can I parse bitsery-serialized buffer using Python struct.unpack? HOT 2
- Are there any single header version available? HOT 2
- Does this use dynamic allocation? HOT 3
- How to find the reason of InvalidData? HOT 1
- Parallel read and write? HOT 1
- Writing to pointer to uint8_t array HOT 1
- Problem with deserialization of structure - Assertion newOffset <= _endReadOffset HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitsery.