Skip to content

Missing default ctor for HazelcastJsonValue #589

@RikeVoltz

Description

@RikeVoltz

C++ compiler version: gcc 9.3
Hazelcast Cpp client version: 3.12
Hazelcast server version: 3.12
Number of the clients: 1
Cluster size, i.e. the number of Hazelcast cluster members: 3
OS version (Windows/Linux/OSX): Linux Ubuntu 20.04

Expected behaviour

.values() method for IMap<std::string, HazelcastJsonValue> with no arguments compiles successfully and produce correct output(all values in the map)

Actual behaviour

/usr/include/c++/9/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = hazelcast::client::HazelcastJsonValue; _Args = {}]’:
/usr/include/c++/9/bits/stl_uninitialized.h:545:18:   required from ‘static _ForwardIterator std::__uninitialized_default_n_1<_TrivialValueType>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = hazelcast::client::HazelcastJsonValue*; _Size = long unsigned int; bool _TrivialValueType = false]’
/usr/include/c++/9/bits/stl_uninitialized.h:601:20:   required from ‘_ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = hazelcast::client::HazelcastJsonValue*; _Size = long unsigned int]’
/usr/include/c++/9/bits/stl_uninitialized.h:663:44:   required from ‘_ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, std::allocator<_Tp>&) [with _ForwardIterator = hazelcast::client::HazelcastJsonValue*; _Size = long unsigned int; _Tp = hazelcast::client::HazelcastJsonValue]’
/usr/include/c++/9/bits/stl_vector.h:1603:36:   required from ‘void std::vector<_Tp, _Alloc>::_M_default_initialize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = hazelcast::client::HazelcastJsonValue; _Alloc = std::allocator<hazelcast::client::HazelcastJsonValue>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/9/bits/stl_vector.h:509:9:   required from ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = hazelcast::client::HazelcastJsonValue; _Alloc = std::allocator<hazelcast::client::HazelcastJsonValue>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<hazelcast::client::HazelcastJsonValue>]’
/home/rikevoltz/.conan/data/hazelcast-cpp-client/3.12/_/_/package/49e7f59961e8ed9b7d1d33caa2e6d613b00b72a5/include/hazelcast/client/map/ClientMapProxy.h:751:36:   required from ‘std::vector<V> hazelcast::client::map::ClientMapProxy<K, V>::values() [with K = std::__cxx11::basic_string<char>; V = hazelcast::client::HazelcastJsonValue]’
/home/rikevoltz/.conan/data/hazelcast-cpp-client/3.12/_/_/package/49e7f59961e8ed9b7d1d33caa2e6d613b00b72a5/include/hazelcast/client/IMap.h:603:40:   required from ‘std::vector<V> hazelcast::client::IMap<K, V>::values() [with K = std::__cxx11::basic_string<char>; V = hazelcast::client::HazelcastJsonValue]’
/home/rikevoltz/work/Projects/hazelcast_tests/main.cpp:22:34:   required from here
/usr/include/c++/9/bits/stl_construct.h:75:7: error: no matching function for call to ‘hazelcast::client::HazelcastJsonValue::HazelcastJsonValue()’
   75 |     { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/rikevoltz/work/Projects/hazelcast_tests/main.cpp:2:
/home/rikevoltz/.conan/data/hazelcast-cpp-client/3.12/_/_/package/49e7f59961e8ed9b7d1d33caa2e6d613b00b72a5/include/hazelcast/client/HazelcastJsonValue.h:58:13: note: candidate: ‘hazelcast::client::HazelcastJsonValue::HazelcastJsonValue(const string&)’
   58 |             HazelcastJsonValue(const std::string &jsonString);
      |             ^~~~~~~~~~~~~~~~~~
/home/rikevoltz/.conan/data/hazelcast-cpp-client/3.12/_/_/package/49e7f59961e8ed9b7d1d33caa2e6d613b00b72a5/include/hazelcast/client/HazelcastJsonValue.h:58:13: note:   candidate expects 1 argument, 0 provided
/home/rikevoltz/.conan/data/hazelcast-cpp-client/3.12/_/_/package/49e7f59961e8ed9b7d1d33caa2e6d613b00b72a5/include/hazelcast/client/HazelcastJsonValue.h:48:29: note: candidate: ‘hazelcast::client::HazelcastJsonValue::HazelcastJsonValue(const hazelcast::client::HazelcastJsonValue&)’
   48 |         class HAZELCAST_API HazelcastJsonValue {
      |                             ^~~~~~~~~~~~~~~~~~
/home/rikevoltz/.conan/data/hazelcast-cpp-client/3.12/_/_/package/49e7f59961e8ed9b7d1d33caa2e6d613b00b72a5/include/hazelcast/client/HazelcastJsonValue.h:48:29: note:   candidate expects 1 argument, 0 provided

As I understand correctly, the default ctor for HazelcastJsonValue is missing

Steps to reproduce the behaviour

  auto client = hazelcast::client::HazelcastClient{config};
  auto some_map = client.getMap<std::string, HazelcastJsonValue>("test_map");
  some_map.put("some_key", HazelcastJsonValue("{\"id\":\"some_id\"}"));
  some_map.put("some_other_key", HazelcastJsonValue("{\"id\":\"some_other_id\"}"));
  some_map.put("another_key", HazelcastJsonValue("{\"id\":\"another_id\"}"));
  auto results = some_map.values();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions