-
Type:
Task
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 0.2.0
-
Component/s: BSON
-
None
-
Environment:Linux Mint 17.2 RC amd64
clang++ -std=c++11 -stdlib=libstdc++
-
None
-
None
-
None
-
None
-
None
-
None
-
None
There are overloading versions of bsoncxx::builder::core::append that accepts native int32_t and int64_t.
But, calling it with a native uint is an error ("call to member function 'append' is ambiguous").
Example:
auto document = bsoncxx::builder::basic::document{};
document.append(kvp("foo", 42)); // ok
document.append(kvp("foo", 42u)); // error
Although we could use BSON value classes instead of native types, it needs more code if the type of value is a template argument.
template <class T>
void f(T value) {
document.append(kvp("foo", value));
}
f(42u); // error
Are there workarounds?
If not, should we edit the C++ driver and add these overloading functions?