Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6219

use ::mongo in macros

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.3
    • None
    • Internal Client
    • Fully Compatible

    Description

      If there is a cascaded mongo namespace in your project BSON and BSON_ARRAY macros won't work any more.

      namespace foo { namespace mongo {
       
      void bar()
      {
        ::mongo::BSONObj bo = BSON("id" << 1);
      }
       
      } }

      The macro should use ::mongo instead

      #define BSON(x) (( ::mongo::BSONObjBuilder(64) << x ).obj())
      #define BSON_ARRAY(x) (( ::mongo::BSONArrayBuilder() << x ).arr())

      Attachments

        Activity

          People

            phillip.quiza Phillip Quiza
            dschneider David Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: