I'm developing an application that needs to store in std::map and std::vector bson objects.
g++ -Ofast -c -O3 -DCONSOLE_APP -I/usr/local/include/mongocxx/v_noabi -I/usr/local/include/bsoncxx/v_noabi -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -std=c++11 -MMD -MP -MF "build/Release/GNU-MacOSX/_ext/1719473742/ccachedata.o.d" -o build/Release/GNU-MacOSX/_ext/1719473742/ccachedata.o ../searchlib/ccachedata.cpp
In file included from ../searchlib/ccachedata.cpp:8:
In file included from ../searchlib/ccachedata.h:12:
In file included from /usr/local/include/boost/thread.hpp:13:
In file included from /usr/local/include/boost/thread/thread.hpp:12:
In file included from /usr/local/include/boost/thread/thread_only.hpp:17:
In file included from /usr/local/include/boost/thread/pthread/thread_data.hpp:10:
In file included from /usr/local/include/boost/thread/exceptions.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1740:31: error: no matching constructor for initialization of 'bsoncxx::v_noabi::document::value'
::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1656:18: note: in instantiation of function template specialization 'std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<bsoncxx::v_noabi::oid, bsoncxx::v_noabi::document::value>, void *> >::construct<bsoncxx::v_noabi::document::value>' requested here
{__a.construct(__p, _VSTD::forward<_Args>(__args)...);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1502:14: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<bsoncxx::v_noabi::oid, bsoncxx::v_noabi::document::value>, void *> > >::__construct<bsoncxx::v_noabi::document::value>' requested here
{__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:1495:20: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<std::__1::__tree_node<std::__1::__value_type<bsoncxx::v_noabi::oid, bsoncxx::v_noabi::document::value>, void *> > >::construct<bsoncxx::v_noabi::document::value>' requested here
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:1561:29: note: in instantiation of member function 'std::__1::map<bsoncxx::v_noabi::oid, bsoncxx::v_noabi::document::value, std::__1::less<bsoncxx::v_noabi::oid>, std::__1::allocator<std::__1::pair<const bsoncxx::v_noabi::oid, bsoncxx::v_noabi::document::value> > >::__construct_node_with_key' requested here
__node_holder __h = __construct_node_with_key(_VSTD::move(__k));
^
../searchlib/ccachedata.cpp:273:68: note: in instantiation of member function 'std::__1::map<bsoncxx::v_noabi::oid, bsoncxx::v_noabi::document::value, std::__1::less<bsoncxx::v_noabi::oid>, std::__1::allocator<std::__1::pair<const bsoncxx::v_noabi::oid, bsoncxx::v_noabi::document::value> > >::operator[]' requested here
kwProductCategoriesAux[pc_ele.get_oid().value].push_back(allKwAux[pc_ele.get_oid().value]);
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp:71:14: note: candidate constructor not viable: requires single argument 'view', but no arguments were provided
explicit value(document::view view);
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp:73:5: note: candidate constructor not viable: requires 1 argument, but 0 were provided
value(const value&);
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp:76:5: note: candidate constructor not viable: requires 1 argument, but 0 were provided
value(value&&) noexcept = default;
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp:61:5: note: candidate constructor not viable: requires 2 arguments, but 0 were provided
value(unique_ptr_type ptr, std::size_t length);
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp:50:5: note: candidate constructor not viable: requires 3 arguments, but 0 were provided
value(std::uint8_t* data, std::size_t length, deleter_type dtor);
^
1 error generated.