Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-8025

Comment on: "primer/insert.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • None
    • None

    Description

      Problem with:

      bsoncxx::document::value restaurant_doc =
      document{} << "address" << open_document << "street" ....

      Compiler reports error:

      test1.cpp:46:30: error: conversion from ‘std::enable_if<true, bsoncxx::v_noabi::document::value>::type

      {aka bsoncxx::v_noabi::document::value}

      ’ to non-scalar type ‘bsoncxx::v_noabi::builder::stream::document’ requested
      << "41704620" << finalize;

      Fixed by not doing the initial assignment. E.g not mentioning document{}.

      bsoncxx::document::value restaurant_doc{};
      restaurant_doc << "address" << ...

      Attachments

        Activity

          People

            Unassigned Unassigned
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 29 weeks ago