occt-products: master fd7fded6

Author Committer Branch Timestamp Parent
ddzama smoskvin master 2022-08-22 16:47:12 master cee9b38f
Changeset 0033121: Coding, TKPointCloudBase, fix error C2664 (and C2440) - cannot convert argument n from type1 to type2.

MSVC 2022 /c++20 / x64

Affected project: TKPointCloudBase.

Affected file: file: src/Json/Json_Bson.hxx.

Affected class: minibson::element_list.

When using C++20 language standard compiler emits errors:

node_type type = static_cast<node_type>(byte_buffer[position++]);
error C2440:
'static_cast':
cannot convert from 'const unsigned char'
                 to 'std::_Node_handle<std::_Tree_node<std::pair<const std::string,minibson::node *>,std::_Default_allocator_traits<_Alloc>::void_pointer>,_Alloc,std::_Node_handle_map_base,_Kty,_Ty>'

node = node::create(type, byte_buffer + position, count - position);
error C2664:
'minibson::node *minibson::node::create(minibson::node_type,const void *const ,const size_t)':
cannot convert argument 1 from 'std::_Node_handle<std::_Tree_node<std::pair<const std::string,minibson::node *>,std::_Default_allocator_traits<_Alloc>::void_pointer>,_Alloc,std::_Node_handle_map_base,_Kty,_Ty>'
                            to 'minibson::node_type'

Proposed solution: type `node_type` is specified by namespace name (`minibson`).
mod - src/Json/Json_Bson.hxx Diff File