Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Centos7 #32

Closed
BotellaA opened this issue Jan 9, 2020 · 16 comments · Fixed by #33
Closed

Error on Centos7 #32

BotellaA opened this issue Jan 9, 2020 · 16 comments · Fixed by #33

Comments

@BotellaA
Copy link
Contributor

BotellaA commented Jan 9, 2020

I am trying to use Bitsery5.0.1 on a Centos7 witg gcc4.8.2. I got this error:

/usr/include/c++/4.8.2/bits/hashtable.h: In instantiation of 'class std::_Hashtable<long unsigned int, std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > >, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >, std::__detail::_Select1st, std::equal_to<long unsigned int>, std::hash<long unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >':
/usr/include/c++/4.8.2/bits/unordered_map.h:100:18:   required from 'class std::unordered_map<long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> >, std::hash<long unsigned int>, std::equal_to<long unsigned int>, bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > > >'
/__w/OpenGeode/OpenGeode/build/third_party/bitsery/install/include/bitsery/ext/utils/polymorphism_utils.h:182:19:   required from here
/usr/include/c++/4.8.2/bits/hashtable.h:194:47: error: no type named 'pointer' in 'class bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >'
       typedef typename _Alloc::pointer        pointer;
                                               ^
/usr/include/c++/4.8.2/bits/hashtable.h:195:55: error: no type named 'const_pointer' in 'class bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >'
       typedef typename _Alloc::const_pointer          const_pointer;
                                                       ^
/usr/include/c++/4.8.2/bits/hashtable.h:196:55: error: no type named 'reference' in 'class bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >'
       typedef typename _Alloc::reference              reference;
                                                       ^
/usr/include/c++/4.8.2/bits/hashtable.h:197:55: error: no type named 'const_reference' in 'class bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >'
       typedef typename _Alloc::const_reference        const_reference;
                                                       ^
/usr/include/c++/4.8.2/bits/hashtable.h:317:8: error: no class template named 'rebind' in 'class bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >'
        _Node_allocator_type;
        ^
/usr/include/c++/4.8.2/bits/hashtable.h:319:8: error: no class template named 'rebind' in 'class bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >'
        _Bucket_allocator_type;
        ^
/usr/include/c++/4.8.2/bits/hashtable.h:321:75: error: no class template named 'rebind' in 'class bitsery::ext::pointer_utils::StdPolyAlloc<std::pair<const long unsigned int, std::vector<long unsigned int, bitsery::ext::pointer_utils::StdPolyAlloc<long unsigned int> > > >'
       using __before_begin = __detail::_Before_begin<_Node_allocator_type>;
                                                                           ^

Do you have an idea of the origin of this error?

@fraillt
Copy link
Owner

fraillt commented Jan 10, 2020

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.

@BotellaA
Copy link
Contributor Author

BotellaA commented Jan 10, 2020

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,
  ^

@fraillt
Copy link
Owner

fraillt commented Jan 10, 2020

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.

@BotellaA
Copy link
Contributor Author

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*>&}'

@fraillt
Copy link
Owner

fraillt commented Jan 10, 2020

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}} {}

@BotellaA
Copy link
Contributor Author

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

@fraillt
Copy link
Owner

fraillt commented Jan 10, 2020

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.

@fraillt
Copy link
Owner

fraillt commented Jan 11, 2020

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

@BotellaA
Copy link
Contributor Author

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?

@fraillt
Copy link
Owner

fraillt commented Jan 12, 2020

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

@BotellaA
Copy link
Contributor Author

BotellaA commented Jan 12, 2020

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!

@fraillt
Copy link
Owner

fraillt commented Jan 12, 2020

Maybe missing #include <cstddef> ?

@BotellaA
Copy link
Contributor Author

Adding the include fixed the first error but not the second one.

@fraillt
Copy link
Owner

fraillt commented Jan 12, 2020

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 ;)

@BotellaA
Copy link
Contributor Author

It works! 🎉
Here is the final (unformated) diff master...Geode-solutions:master

Thanks a lot for your help!

@fraillt
Copy link
Owner

fraillt commented Jan 14, 2020

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)

@fraillt fraillt closed this as completed Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants