Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-617

bsoncxx::builder::core::append of unsigned int?

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 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?

            Assignee:
            Unassigned Unassigned
            Reporter:
            hczhcz hczhcz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: