summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-01-09 18:02:51 -0500
committerAndrew Morrow <acm@mongodb.com>2015-01-15 07:04:26 -0500
commit9f30e21c627e4c73ab0b44e45b7ce657b3e2619f (patch)
tree4863e66baca59d2733c4d8090ed962ef60908d6a /src
parent44cafa7dddde7510aa0a05efce807a2e294fdc6d (diff)
downloadmongo-9f30e21c627e4c73ab0b44e45b7ce657b3e2619f.tar.gz
SERVER-13256 Add usings and qualifications for names from namespace std
Diffstat (limited to 'src')
-rw-r--r--src/mongo/base/owned_pointer_map_test.cpp1
-rw-r--r--src/mongo/base/owned_pointer_vector_test.cpp3
-rw-r--r--src/mongo/base/string_data.h2
-rw-r--r--src/mongo/bson/bson_validate_test.cpp1
-rw-r--r--src/mongo/bson/bsonelement.cpp6
-rw-r--r--src/mongo/bson/bsonobjbuilder.cpp3
-rw-r--r--src/mongo/client/clientAndShell.cpp4
-rw-r--r--src/mongo/client/connpool.cpp7
-rw-r--r--src/mongo/client/dbclient.cpp8
-rw-r--r--src/mongo/client/dbclient_rs.cpp6
-rw-r--r--src/mongo/client/dbclientcursor.cpp5
-rw-r--r--src/mongo/client/gridfs.cpp8
-rw-r--r--src/mongo/client/parallel.cpp7
-rw-r--r--src/mongo/client/replica_set_monitor.cpp4
-rw-r--r--src/mongo/client/replica_set_monitor_test.cpp1
-rw-r--r--src/mongo/client/sasl_client_authenticate_impl.cpp2
-rw-r--r--src/mongo/client/sasl_scramsha1_client_conversation.cpp1
-rw-r--r--src/mongo/client/syncclusterconnection.cpp8
-rw-r--r--src/mongo/db/auth/auth_index_d.cpp3
-rw-r--r--src/mongo/db/auth/authorization_manager.cpp6
-rw-r--r--src/mongo/db/auth/authorization_manager_test.cpp1
-rw-r--r--src/mongo/db/auth/authorization_session.cpp2
-rw-r--r--src/mongo/db/auth/authz_manager_external_state.cpp2
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_d.cpp3
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_local.cpp2
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_s.cpp2
-rw-r--r--src/mongo/db/auth/privilege_parser.cpp3
-rw-r--r--src/mongo/db/auth/sasl_commands.cpp2
-rw-r--r--src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp1
-rw-r--r--src/mongo/db/auth/security_key.cpp3
-rw-r--r--src/mongo/db/auth/user_management_commands_parser.cpp2
-rw-r--r--src/mongo/db/catalog/collection.cpp4
-rw-r--r--src/mongo/db/catalog/collection_compact.cpp3
-rw-r--r--src/mongo/db/catalog/cursor_manager.cpp3
-rw-r--r--src/mongo/db/catalog/database.cpp8
-rw-r--r--src/mongo/db/catalog/database_holder.cpp5
-rw-r--r--src/mongo/db/catalog/index_catalog.cpp5
-rw-r--r--src/mongo/db/catalog/index_catalog_entry.cpp2
-rw-r--r--src/mongo/db/catalog/index_create.cpp2
-rw-r--r--src/mongo/db/catalog/index_key_validate.cpp3
-rw-r--r--src/mongo/db/client.cpp3
-rw-r--r--src/mongo/db/clientcursor.cpp3
-rw-r--r--src/mongo/db/clientlistplugin.cpp1
-rw-r--r--src/mongo/db/cloner.cpp6
-rw-r--r--src/mongo/db/commands.cpp4
-rw-r--r--src/mongo/db/commands/apply_ops.cpp4
-rw-r--r--src/mongo/db/commands/auth_schema_upgrade_d.cpp2
-rw-r--r--src/mongo/db/commands/authentication_commands.cpp4
-rw-r--r--src/mongo/db/commands/cleanup_orphaned_cmd.cpp3
-rw-r--r--src/mongo/db/commands/clone.cpp4
-rw-r--r--src/mongo/db/commands/clone_collection.cpp5
-rw-r--r--src/mongo/db/commands/collection_to_capped.cpp2
-rw-r--r--src/mongo/db/commands/compact.cpp3
-rw-r--r--src/mongo/db/commands/connection_status.cpp4
-rw-r--r--src/mongo/db/commands/copydb.cpp3
-rw-r--r--src/mongo/db/commands/copydb_start_commands.cpp3
-rw-r--r--src/mongo/db/commands/count.cpp2
-rw-r--r--src/mongo/db/commands/create_indexes.cpp2
-rw-r--r--src/mongo/db/commands/dbhash.cpp6
-rw-r--r--src/mongo/db/commands/distinct.cpp4
-rw-r--r--src/mongo/db/commands/drop_indexes.cpp5
-rw-r--r--src/mongo/db/commands/explain_cmd.cpp2
-rw-r--r--src/mongo/db/commands/fail_point_cmd.cpp4
-rw-r--r--src/mongo/db/commands/find_and_modify.cpp3
-rw-r--r--src/mongo/db/commands/find_cmd.cpp2
-rw-r--r--src/mongo/db/commands/fsync.cpp6
-rw-r--r--src/mongo/db/commands/geo_near_cmd.cpp1
-rw-r--r--src/mongo/db/commands/get_last_error.cpp3
-rw-r--r--src/mongo/db/commands/group.cpp1
-rw-r--r--src/mongo/db/commands/hashcmd.cpp3
-rw-r--r--src/mongo/db/commands/index_filter_commands_test.cpp1
-rw-r--r--src/mongo/db/commands/isself.cpp3
-rw-r--r--src/mongo/db/commands/list_collections.cpp3
-rw-r--r--src/mongo/db/commands/list_databases.cpp5
-rw-r--r--src/mongo/db/commands/list_indexes.cpp4
-rw-r--r--src/mongo/db/commands/merge_chunks_cmd.cpp4
-rw-r--r--src/mongo/db/commands/mr.cpp6
-rw-r--r--src/mongo/db/commands/oplog_note.cpp4
-rw-r--r--src/mongo/db/commands/parallel_collection_scan.cpp2
-rw-r--r--src/mongo/db/commands/parameters.cpp1
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp4
-rw-r--r--src/mongo/db/commands/plan_cache_commands_test.cpp1
-rw-r--r--src/mongo/db/commands/rename_collection.cpp4
-rw-r--r--src/mongo/db/commands/repair_cursor.cpp2
-rw-r--r--src/mongo/db/commands/server_status.cpp5
-rw-r--r--src/mongo/db/commands/server_status_internal.cpp5
-rw-r--r--src/mongo/db/commands/server_status_metric.cpp2
-rw-r--r--src/mongo/db/commands/test_commands.cpp4
-rw-r--r--src/mongo/db/commands/touch.cpp3
-rw-r--r--src/mongo/db/commands/user_management_commands.cpp5
-rw-r--r--src/mongo/db/commands/validate.cpp4
-rw-r--r--src/mongo/db/commands/write_commands/batch_executor.cpp4
-rw-r--r--src/mongo/db/commands/write_commands/write_commands.cpp3
-rw-r--r--src/mongo/db/commands/writeback_compatibility_shim.cpp2
-rw-r--r--src/mongo/db/concurrency/d_concurrency_test.cpp2
-rw-r--r--src/mongo/db/concurrency/lock_manager.cpp3
-rw-r--r--src/mongo/db/curop.cpp2
-rw-r--r--src/mongo/db/currentop_command.cpp2
-rw-r--r--src/mongo/db/db.cpp11
-rw-r--r--src/mongo/db/dbcommands.cpp4
-rw-r--r--src/mongo/db/dbcommands_generic.cpp5
-rw-r--r--src/mongo/db/dbdirectclient.cpp4
-rw-r--r--src/mongo/db/dbeval.cpp4
-rw-r--r--src/mongo/db/dbhelpers.cpp8
-rw-r--r--src/mongo/db/dbmessage.cpp3
-rw-r--r--src/mongo/db/dbwebserver.cpp4
-rw-r--r--src/mongo/db/driverHelpers.cpp2
-rw-r--r--src/mongo/db/exec/and_hash.cpp1
-rw-r--r--src/mongo/db/exec/and_sorted.cpp4
-rw-r--r--src/mongo/db/exec/cached_plan.cpp3
-rw-r--r--src/mongo/db/exec/collection_scan.cpp3
-rw-r--r--src/mongo/db/exec/count.cpp3
-rw-r--r--src/mongo/db/exec/count_scan.cpp3
-rw-r--r--src/mongo/db/exec/delete.cpp3
-rw-r--r--src/mongo/db/exec/distinct_scan.cpp3
-rw-r--r--src/mongo/db/exec/eof.cpp2
-rw-r--r--src/mongo/db/exec/fetch.cpp3
-rw-r--r--src/mongo/db/exec/geo_near.cpp3
-rw-r--r--src/mongo/db/exec/group.cpp3
-rw-r--r--src/mongo/db/exec/idhack.cpp3
-rw-r--r--src/mongo/db/exec/index_scan.cpp3
-rw-r--r--src/mongo/db/exec/keep_mutations.cpp3
-rw-r--r--src/mongo/db/exec/limit.cpp3
-rw-r--r--src/mongo/db/exec/merge_sort.cpp5
-rw-r--r--src/mongo/db/exec/multi_iterator.cpp2
-rw-r--r--src/mongo/db/exec/multi_plan.cpp5
-rw-r--r--src/mongo/db/exec/near.cpp4
-rw-r--r--src/mongo/db/exec/oplogstart.cpp2
-rw-r--r--src/mongo/db/exec/or.cpp3
-rw-r--r--src/mongo/db/exec/pipeline_proxy.cpp1
-rw-r--r--src/mongo/db/exec/projection.cpp4
-rw-r--r--src/mongo/db/exec/projection_exec.cpp3
-rw-r--r--src/mongo/db/exec/queued_data_stage.cpp3
-rw-r--r--src/mongo/db/exec/queued_data_stage_test.cpp2
-rw-r--r--src/mongo/db/exec/shard_filter.cpp3
-rw-r--r--src/mongo/db/exec/skip.cpp3
-rw-r--r--src/mongo/db/exec/sort.cpp2
-rw-r--r--src/mongo/db/exec/stagedebug_cmd.cpp4
-rw-r--r--src/mongo/db/exec/subplan.cpp4
-rw-r--r--src/mongo/db/exec/text.cpp4
-rw-r--r--src/mongo/db/exec/update.cpp4
-rw-r--r--src/mongo/db/exec/working_set.cpp2
-rw-r--r--src/mongo/db/exec/working_set_test.cpp2
-rw-r--r--src/mongo/db/field_parser.cpp1
-rw-r--r--src/mongo/db/fts/fts_element_iterator.cpp2
-rw-r--r--src/mongo/db/fts/fts_element_iterator_test.cpp2
-rw-r--r--src/mongo/db/fts/fts_index_format.cpp3
-rw-r--r--src/mongo/db/fts/fts_matcher.cpp2
-rw-r--r--src/mongo/db/fts/fts_query.cpp5
-rw-r--r--src/mongo/db/fts/fts_query.h4
-rw-r--r--src/mongo/db/fts/fts_spec.cpp2
-rw-r--r--src/mongo/db/fts/fts_spec_legacy.cpp2
-rw-r--r--src/mongo/db/fts/fts_spec_test.cpp4
-rw-r--r--src/mongo/db/fts/stemmer.cpp2
-rw-r--r--src/mongo/db/geo/geoparser.cpp3
-rw-r--r--src/mongo/db/geo/hash.cpp4
-rw-r--r--src/mongo/db/geo/haystack.cpp3
-rw-r--r--src/mongo/db/geo/r2_region_coverer.cpp2
-rw-r--r--src/mongo/db/geo/r2_region_coverer_test.cpp1
-rw-r--r--src/mongo/db/geo/shapes.cpp2
-rw-r--r--src/mongo/db/index/btree_access_method.cpp2
-rw-r--r--src/mongo/db/index/btree_based_access_method.cpp4
-rw-r--r--src/mongo/db/index/btree_based_bulk_access_method.cpp1
-rw-r--r--src/mongo/db/index/btree_index_cursor.cpp3
-rw-r--r--src/mongo/db/index/btree_key_generator.cpp5
-rw-r--r--src/mongo/db/index/btree_key_generator_test.cpp3
-rw-r--r--src/mongo/db/index_builder.cpp2
-rw-r--r--src/mongo/db/index_names.cpp2
-rw-r--r--src/mongo/db/index_names.h2
-rw-r--r--src/mongo/db/index_rebuilder.cpp4
-rw-r--r--src/mongo/db/initialize_server_global_state.cpp4
-rw-r--r--src/mongo/db/instance.cpp8
-rw-r--r--src/mongo/db/introspect.cpp2
-rw-r--r--src/mongo/db/json.cpp2
-rw-r--r--src/mongo/db/lasterror.cpp2
-rw-r--r--src/mongo/db/log_process_details.cpp3
-rw-r--r--src/mongo/db/matcher/expression.cpp2
-rw-r--r--src/mongo/db/matcher/expression_array_test.cpp2
-rw-r--r--src/mongo/db/matcher/expression_geo_test.cpp2
-rw-r--r--src/mongo/db/matcher/expression_leaf_test.cpp2
-rw-r--r--src/mongo/db/matcher/expression_parser.cpp2
-rw-r--r--src/mongo/db/matcher/expression_parser_array_test.cpp2
-rw-r--r--src/mongo/db/matcher/expression_parser_geo.cpp2
-rw-r--r--src/mongo/db/matcher/expression_parser_leaf_test.cpp3
-rw-r--r--src/mongo/db/matcher/expression_parser_text.cpp3
-rw-r--r--src/mongo/db/matcher/expression_text.cpp2
-rw-r--r--src/mongo/db/matcher/expression_tree_test.cpp2
-rw-r--r--src/mongo/db/matcher/expression_where.cpp5
-rw-r--r--src/mongo/db/matcher/expression_where_noop.cpp4
-rw-r--r--src/mongo/db/matcher/match_details.cpp2
-rw-r--r--src/mongo/db/matcher/path_test.cpp2
-rw-r--r--src/mongo/db/mongod_options.cpp4
-rw-r--r--src/mongo/db/namespace_string.cpp2
-rw-r--r--src/mongo/db/namespace_string_test.cpp2
-rw-r--r--src/mongo/db/operation_context_impl.cpp2
-rw-r--r--src/mongo/db/ops/insert.cpp2
-rw-r--r--src/mongo/db/ops/modifier_pull_all.cpp2
-rw-r--r--src/mongo/db/ops/modifier_push.cpp3
-rw-r--r--src/mongo/db/ops/modifier_table.cpp4
-rw-r--r--src/mongo/db/ops/path_support.cpp3
-rw-r--r--src/mongo/db/ops/path_support_test.cpp1
-rw-r--r--src/mongo/db/ops/update_driver.cpp3
-rw-r--r--src/mongo/db/pipeline/accumulator_add_to_set.cpp1
-rw-r--r--src/mongo/db/pipeline/accumulator_push.cpp1
-rw-r--r--src/mongo/db/pipeline/dependencies.cpp5
-rw-r--r--src/mongo/db/pipeline/document.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_command_shards.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_cursor.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_geo_near.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_group.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_match.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_merge_cursors.cpp3
-rw-r--r--src/mongo/db/pipeline/document_source_out.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_project.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_redact.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_sort.cpp3
-rw-r--r--src/mongo/db/pipeline/document_source_unwind.cpp2
-rw-r--r--src/mongo/db/pipeline/expression.cpp4
-rw-r--r--src/mongo/db/pipeline/field_path.cpp5
-rw-r--r--src/mongo/db/pipeline/pipeline.cpp4
-rw-r--r--src/mongo/db/pipeline/pipeline_d.cpp1
-rw-r--r--src/mongo/db/pipeline/value.cpp8
-rw-r--r--src/mongo/db/prefetch.cpp4
-rw-r--r--src/mongo/db/projection.cpp4
-rw-r--r--src/mongo/db/query/canonical_query_test.cpp3
-rw-r--r--src/mongo/db/query/explain.cpp3
-rw-r--r--src/mongo/db/query/expression_index.cpp2
-rw-r--r--src/mongo/db/query/find.cpp2
-rw-r--r--src/mongo/db/query/get_executor.cpp5
-rw-r--r--src/mongo/db/query/index_bounds.cpp1
-rw-r--r--src/mongo/db/query/index_bounds_builder_test.cpp3
-rw-r--r--src/mongo/db/query/interval.cpp2
-rw-r--r--src/mongo/db/query/lite_parsed_query.cpp3
-rw-r--r--src/mongo/db/query/parsed_projection.cpp3
-rw-r--r--src/mongo/db/query/plan_cache.cpp3
-rw-r--r--src/mongo/db/query/plan_cache_test.cpp2
-rw-r--r--src/mongo/db/query/plan_enumerator.cpp5
-rw-r--r--src/mongo/db/query/plan_executor.cpp2
-rw-r--r--src/mongo/db/query/plan_ranker.cpp1
-rw-r--r--src/mongo/db/query/planner_access.cpp1
-rw-r--r--src/mongo/db/query/planner_analysis.cpp5
-rw-r--r--src/mongo/db/query/query_planner.cpp3
-rw-r--r--src/mongo/db/query/query_planner_test.cpp4
-rw-r--r--src/mongo/db/query/query_planner_test_lib.cpp2
-rw-r--r--src/mongo/db/query/query_planner_text_test.cpp4
-rw-r--r--src/mongo/db/query/query_solution.cpp2
-rw-r--r--src/mongo/db/query/stage_builder.cpp2
-rw-r--r--src/mongo/db/range_deleter.cpp3
-rw-r--r--src/mongo/db/range_deleter_db_env.cpp3
-rw-r--r--src/mongo/db/range_deleter_mock_env.cpp3
-rw-r--r--src/mongo/db/repair_database.cpp4
-rw-r--r--src/mongo/db/repl/bgsync.cpp2
-rw-r--r--src/mongo/db/repl/isself_test.cpp2
-rw-r--r--src/mongo/db/repl/master_slave.cpp8
-rw-r--r--src/mongo/db/repl/oplog.cpp4
-rw-r--r--src/mongo/db/repl/oplogreader.cpp2
-rw-r--r--src/mongo/db/repl/repl_set_heartbeat_response_test.cpp1
-rw-r--r--src/mongo/db/repl/repl_set_seed_list.cpp2
-rw-r--r--src/mongo/db/repl/replication_coordinator_mock.cpp2
-rw-r--r--src/mongo/db/repl/replication_info.cpp6
-rw-r--r--src/mongo/db/repl/replset_commands.cpp4
-rw-r--r--src/mongo/db/repl/resync.cpp4
-rw-r--r--src/mongo/db/repl/rs_initialsync.cpp3
-rw-r--r--src/mongo/db/repl/rs_rollback.cpp7
-rw-r--r--src/mongo/db/repl/sync.cpp3
-rw-r--r--src/mongo/db/repl/sync_source_feedback.cpp3
-rw-r--r--src/mongo/db/repl/sync_tail.cpp4
-rw-r--r--src/mongo/db/repl/topology_coordinator_impl.cpp2
-rw-r--r--src/mongo/db/restapi.cpp6
-rw-r--r--src/mongo/db/server_options_helpers.cpp1
-rw-r--r--src/mongo/db/server_parameters.cpp3
-rw-r--r--src/mongo/db/server_parameters_test.cpp3
-rw-r--r--src/mongo/db/sorter/sorter.cpp8
-rw-r--r--src/mongo/db/sorter/sorter_test.cpp1
-rw-r--r--src/mongo/db/startup_warnings_mongod.cpp3
-rw-r--r--src/mongo/db/stats/counters.cpp3
-rw-r--r--src/mongo/db/stats/snapshots.cpp3
-rw-r--r--src/mongo/db/stats/snapshots_webplugins.cpp6
-rw-r--r--src/mongo/db/stats/top.cpp5
-rw-r--r--src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp2
-rw-r--r--src/mongo/db/storage/key_string.cpp2
-rw-r--r--src/mongo/db/storage/key_string_test.cpp1
-rw-r--r--src/mongo/db/storage/kv/kv_catalog.cpp1
-rw-r--r--src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp3
-rw-r--r--src/mongo/db/storage/kv/kv_database_catalog_entry.cpp4
-rw-r--r--src/mongo/db/storage/kv/kv_engine_test_harness.cpp1
-rw-r--r--src/mongo/db/storage/kv/kv_storage_engine.cpp3
-rw-r--r--src/mongo/db/storage/mmap_v1/aligned_builder.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp10
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/btree/key.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp3
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp1
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/data_file.cpp3
-rw-r--r--src/mongo/db/storage/mmap_v1/data_file_sync.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/dur.cpp10
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_commitjob.cpp3
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_journal.cpp5
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp6
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_recover.cpp11
-rw-r--r--src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp6
-rw-r--r--src/mongo/db/storage/mmap_v1/durop.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/extent.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp5
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp1
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp6
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp6
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp5
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp3
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp5
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp3
-rw-r--r--src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp2
-rw-r--r--src/mongo/db/storage/mmap_v1/repair_database.cpp5
-rw-r--r--src/mongo/db/storage/record_store_test_docwriter.h2
-rw-r--r--src/mongo/db/storage/record_store_test_harness.cpp1
-rw-r--r--src/mongo/db/storage/record_store_test_updaterecord.h2
-rw-r--r--src/mongo/db/storage/record_store_test_validate.h4
-rw-r--r--src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp1
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp4
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp3
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp1
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp2
-rw-r--r--src/mongo/db/ttl.cpp6
-rw-r--r--src/mongo/db/update_index_data.cpp2
-rw-r--r--src/mongo/db/update_index_data_test.cpp2
-rw-r--r--src/mongo/db/write_concern.cpp2
-rw-r--r--src/mongo/db/write_concern_options.cpp2
-rw-r--r--src/mongo/dbtests/accumulatortests.cpp2
-rw-r--r--src/mongo/dbtests/basictests.cpp7
-rw-r--r--src/mongo/dbtests/chunktests.cpp4
-rw-r--r--src/mongo/dbtests/clienttests.cpp4
-rw-r--r--src/mongo/dbtests/commandtests.cpp3
-rw-r--r--src/mongo/dbtests/config_server_fixture.cpp2
-rw-r--r--src/mongo/dbtests/config_upgrade_tests.cpp2
-rw-r--r--src/mongo/dbtests/dbhelper_tests.cpp3
-rw-r--r--src/mongo/dbtests/directclienttests.cpp3
-rw-r--r--src/mongo/dbtests/documentsourcetests.cpp4
-rw-r--r--src/mongo/dbtests/documenttests.cpp5
-rw-r--r--src/mongo/dbtests/executor_registry.cpp2
-rw-r--r--src/mongo/dbtests/expressiontests.cpp4
-rw-r--r--src/mongo/dbtests/framework.cpp3
-rw-r--r--src/mongo/dbtests/framework_options.cpp5
-rw-r--r--src/mongo/dbtests/gle_test.cpp3
-rw-r--r--src/mongo/dbtests/jsobjtests.cpp8
-rw-r--r--src/mongo/dbtests/jsontests.cpp8
-rw-r--r--src/mongo/dbtests/jstests.cpp5
-rw-r--r--src/mongo/dbtests/matchertests.cpp4
-rw-r--r--src/mongo/dbtests/merge_chunk_tests.cpp3
-rw-r--r--src/mongo/dbtests/mmaptests.cpp3
-rw-r--r--src/mongo/dbtests/mock/mock_conn_registry.cpp3
-rw-r--r--src/mongo/dbtests/mock/mock_replica_set.cpp4
-rw-r--r--src/mongo/dbtests/namespacetests.cpp2
-rw-r--r--src/mongo/dbtests/oplogstarttests.cpp1
-rw-r--r--src/mongo/dbtests/perftests.cpp11
-rw-r--r--src/mongo/dbtests/pipelinetests.cpp2
-rw-r--r--src/mongo/dbtests/plan_ranking.cpp1
-rw-r--r--src/mongo/dbtests/query_multi_plan_runner.cpp2
-rw-r--r--src/mongo/dbtests/query_plan_executor.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_and.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_collscan.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_count.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_delete.cpp1
-rw-r--r--src/mongo/dbtests/query_stage_fetch.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_keep.cpp1
-rw-r--r--src/mongo/dbtests/query_stage_limit_skip.cpp3
-rw-r--r--src/mongo/dbtests/query_stage_merge_sort.cpp4
-rw-r--r--src/mongo/dbtests/query_stage_sort.cpp3
-rw-r--r--src/mongo/dbtests/query_stage_tests.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_update.cpp2
-rw-r--r--src/mongo/dbtests/querytests.cpp6
-rw-r--r--src/mongo/dbtests/repltests.cpp6
-rw-r--r--src/mongo/dbtests/sharding.cpp5
-rw-r--r--src/mongo/dbtests/threadedtests.cpp5
-rw-r--r--src/mongo/dbtests/updatetests.cpp6
-rw-r--r--src/mongo/logger/ramlog.cpp3
-rw-r--r--src/mongo/s/balance.cpp6
-rw-r--r--src/mongo/s/balancer_policy.cpp8
-rw-r--r--src/mongo/s/balancer_policy_tests.cpp6
-rw-r--r--src/mongo/s/chunk.cpp12
-rw-r--r--src/mongo/s/chunk_diff-inl.cpp6
-rw-r--r--src/mongo/s/chunk_manager_targeter.cpp6
-rw-r--r--src/mongo/s/chunk_manager_targeter_test.cpp2
-rw-r--r--src/mongo/s/client_info.cpp3
-rw-r--r--src/mongo/s/cluster_client_internal.cpp2
-rw-r--r--src/mongo/s/cluster_explain.cpp2
-rw-r--r--src/mongo/s/cluster_write.cpp4
-rw-r--r--src/mongo/s/collection_metadata.cpp6
-rw-r--r--src/mongo/s/commands/auth_schema_upgrade_s.cpp4
-rw-r--r--src/mongo/s/commands/cluster_explain_cmd.cpp2
-rw-r--r--src/mongo/s/commands/cluster_find_cmd.cpp4
-rw-r--r--src/mongo/s/commands/cluster_index_filter_cmd.cpp1
-rw-r--r--src/mongo/s/commands/cluster_merge_chunks_cmd.cpp4
-rw-r--r--src/mongo/s/commands/cluster_plan_cache_cmd.cpp1
-rw-r--r--src/mongo/s/commands/cluster_write_cmd.cpp4
-rw-r--r--src/mongo/s/commands_admin.cpp8
-rw-r--r--src/mongo/s/commands_public.cpp9
-rw-r--r--src/mongo/s/config.cpp6
-rw-r--r--src/mongo/s/config_upgrade.cpp6
-rw-r--r--src/mongo/s/config_upgrade_helpers.cpp4
-rw-r--r--src/mongo/s/config_upgrade_v0_to_v6.cpp3
-rw-r--r--src/mongo/s/config_upgrade_v5_to_v6.cpp2
-rw-r--r--src/mongo/s/cursors.cpp3
-rw-r--r--src/mongo/s/d_merge.cpp2
-rw-r--r--src/mongo/s/d_split.cpp8
-rw-r--r--src/mongo/s/d_state.cpp5
-rw-r--r--src/mongo/s/dbclient_multi_command.cpp2
-rw-r--r--src/mongo/s/dbclient_shard_resolver.cpp2
-rw-r--r--src/mongo/s/default_version.cpp2
-rw-r--r--src/mongo/s/distlock.cpp7
-rw-r--r--src/mongo/s/distlock_test.cpp4
-rw-r--r--src/mongo/s/grid.cpp10
-rw-r--r--src/mongo/s/metadata_loader.cpp5
-rw-r--r--src/mongo/s/mongos_options.cpp2
-rw-r--r--src/mongo/s/multi_host_query.cpp4
-rw-r--r--src/mongo/s/multi_host_query_test.cpp3
-rw-r--r--src/mongo/s/request.cpp3
-rw-r--r--src/mongo/s/s_only.cpp4
-rw-r--r--src/mongo/s/scc_fast_query_handler.cpp5
-rw-r--r--src/mongo/s/server.cpp5
-rw-r--r--src/mongo/s/shard.cpp9
-rw-r--r--src/mongo/s/shard_key_pattern.cpp2
-rw-r--r--src/mongo/s/shard_key_pattern_test.cpp2
-rw-r--r--src/mongo/s/shardconnection.cpp8
-rw-r--r--src/mongo/s/strategy.cpp5
-rw-r--r--src/mongo/s/type_actionlog.cpp2
-rw-r--r--src/mongo/s/type_changelog.cpp2
-rw-r--r--src/mongo/s/type_chunk.cpp2
-rw-r--r--src/mongo/s/type_collection.cpp2
-rw-r--r--src/mongo/s/type_config_version.cpp2
-rw-r--r--src/mongo/s/type_database.cpp2
-rw-r--r--src/mongo/s/type_lockpings.cpp2
-rw-r--r--src/mongo/s/type_locks.cpp2
-rw-r--r--src/mongo/s/type_mongos.cpp2
-rw-r--r--src/mongo/s/type_settings.cpp3
-rw-r--r--src/mongo/s/type_shard.cpp2
-rw-r--r--src/mongo/s/type_tags.cpp2
-rw-r--r--src/mongo/s/version_manager.cpp4
-rw-r--r--src/mongo/s/write_ops/batch_downconvert.cpp4
-rw-r--r--src/mongo/s/write_ops/batch_upconvert.cpp2
-rw-r--r--src/mongo/s/write_ops/batch_upconvert_test.cpp3
-rw-r--r--src/mongo/s/write_ops/batch_write_exec.cpp5
-rw-r--r--src/mongo/s/write_ops/batch_write_exec_test.cpp3
-rw-r--r--src/mongo/s/write_ops/batch_write_op.cpp6
-rw-r--r--src/mongo/s/write_ops/batch_write_op_test.cpp4
-rw-r--r--src/mongo/s/write_ops/batched_command_request.cpp4
-rw-r--r--src/mongo/s/write_ops/batched_command_response.cpp3
-rw-r--r--src/mongo/s/write_ops/batched_delete_document.cpp2
-rw-r--r--src/mongo/s/write_ops/batched_delete_request.cpp3
-rw-r--r--src/mongo/s/write_ops/batched_insert_request.cpp2
-rw-r--r--src/mongo/s/write_ops/batched_request_metadata.cpp1
-rw-r--r--src/mongo/s/write_ops/batched_update_document.cpp2
-rw-r--r--src/mongo/s/write_ops/batched_update_request.cpp3
-rw-r--r--src/mongo/s/write_ops/batched_upsert_detail.cpp2
-rw-r--r--src/mongo/s/write_ops/config_coordinator.cpp2
-rw-r--r--src/mongo/s/write_ops/wc_error_detail.cpp2
-rw-r--r--src/mongo/s/write_ops/write_error_detail.cpp2
-rw-r--r--src/mongo/s/write_ops/write_op.cpp3
-rw-r--r--src/mongo/s/write_ops/write_op_test.cpp3
-rw-r--r--src/mongo/scripting/bson_template_evaluator.cpp2
-rw-r--r--src/mongo/scripting/bson_template_evaluator_test.cpp2
-rw-r--r--src/mongo/scripting/engine.cpp6
-rw-r--r--src/mongo/scripting/engine_v8.cpp6
-rw-r--r--src/mongo/scripting/v8_deadline_monitor_test.cpp1
-rw-r--r--src/mongo/shell/bench.cpp5
-rw-r--r--src/mongo/shell/shell_options.cpp5
-rw-r--r--src/mongo/shell/shell_utils.cpp4
-rw-r--r--src/mongo/shell/shell_utils_extended.cpp6
-rw-r--r--src/mongo/shell/shell_utils_launcher.cpp8
-rw-r--r--src/mongo/unittest/temp_dir.cpp3
-rw-r--r--src/mongo/unittest/unittest.cpp1
-rw-r--r--src/mongo/util/base64.cpp4
-rw-r--r--src/mongo/util/concurrency/task.cpp3
-rw-r--r--src/mongo/util/concurrency/thread_name.cpp2
-rw-r--r--src/mongo/util/concurrency/thread_pool.cpp2
-rw-r--r--src/mongo/util/fail_point.cpp2
-rw-r--r--src/mongo/util/fail_point_registry.cpp3
-rw-r--r--src/mongo/util/file_allocator.cpp5
-rw-r--r--src/mongo/util/hex.cpp2
-rw-r--r--src/mongo/util/logfile.cpp5
-rw-r--r--src/mongo/util/mmap.cpp7
-rw-r--r--src/mongo/util/mmap_posix.cpp4
-rw-r--r--src/mongo/util/mmap_win.cpp4
-rw-r--r--src/mongo/util/net/httpclient.cpp3
-rw-r--r--src/mongo/util/net/listen.cpp5
-rw-r--r--src/mongo/util/net/message_port.cpp1
-rw-r--r--src/mongo/util/net/message_server_port.cpp1
-rw-r--r--src/mongo/util/net/miniwebserver.cpp3
-rw-r--r--src/mongo/util/net/sock.cpp6
-rw-r--r--src/mongo/util/net/ssl_options.cpp2
-rw-r--r--src/mongo/util/ntservice.cpp1
-rw-r--r--src/mongo/util/options_parser/environment.cpp2
-rw-r--r--src/mongo/util/safe_num.cpp2
-rw-r--r--src/mongo/util/signal_handlers.cpp2
-rw-r--r--src/mongo/util/stringutils.cpp3
-rw-r--r--src/mongo/util/stringutils_test.cpp2
-rw-r--r--src/mongo/util/version.cpp3
-rw-r--r--src/mongo/util/version_reporting.cpp4
508 files changed, 1644 insertions, 38 deletions
diff --git a/src/mongo/base/owned_pointer_map_test.cpp b/src/mongo/base/owned_pointer_map_test.cpp
index c6b92ca616d..e1a1a1c0326 100644
--- a/src/mongo/base/owned_pointer_map_test.cpp
+++ b/src/mongo/base/owned_pointer_map_test.cpp
@@ -38,6 +38,7 @@ namespace mongo {
namespace {
using std::make_pair;
+ using std::string;
/** Helper class that logs its constructor argument to a static vector on destruction. */
class DestructionLogger {
diff --git a/src/mongo/base/owned_pointer_vector_test.cpp b/src/mongo/base/owned_pointer_vector_test.cpp
index 35968a037a0..ad00dad0ec0 100644
--- a/src/mongo/base/owned_pointer_vector_test.cpp
+++ b/src/mongo/base/owned_pointer_vector_test.cpp
@@ -35,6 +35,9 @@
#include "mongo/unittest/unittest.h"
namespace mongo {
+
+ using std::string;
+
namespace {
/** Helper class that logs its constructor argument to a static vector on destruction. */
diff --git a/src/mongo/base/string_data.h b/src/mongo/base/string_data.h
index 00bb2c0656b..a1327fefe90 100644
--- a/src/mongo/base/string_data.h
+++ b/src/mongo/base/string_data.h
@@ -37,8 +37,6 @@
namespace mongo {
- using std::string;
-
/**
* A StringData object wraps a 'const std::string&' or a 'const char*' without copying its
* contents. The most common usage is as a function argument that takes any of the two
diff --git a/src/mongo/bson/bson_validate_test.cpp b/src/mongo/bson/bson_validate_test.cpp
index 3826865943b..c31ad0140df 100644
--- a/src/mongo/bson/bson_validate_test.cpp
+++ b/src/mongo/bson/bson_validate_test.cpp
@@ -40,6 +40,7 @@ namespace {
using namespace mongo;
using boost::scoped_array;
+ using std::endl;
void appendInvalidStringElement(const char* fieldName, BufBuilder* bb) {
// like a BSONObj string, but without a NUL terminator.
diff --git a/src/mongo/bson/bsonelement.cpp b/src/mongo/bson/bsonelement.cpp
index 4b26d85264e..fee2472bd39 100644
--- a/src/mongo/bson/bsonelement.cpp
+++ b/src/mongo/bson/bsonelement.cpp
@@ -38,9 +38,13 @@
#include "mongo/util/log.h"
#include "mongo/util/mongoutils/str.h"
-namespace mongo {
+namespace mongo {
namespace str = mongoutils::str;
+ using std::dec;
+ using std::hex;
+ using std::string;
+
string BSONElement::jsonString( JsonStringFormat format, bool includeFieldNames, int pretty ) const {
int sign;
diff --git a/src/mongo/bson/bsonobjbuilder.cpp b/src/mongo/bson/bsonobjbuilder.cpp
index 34788b4a962..31f9636aea0 100644
--- a/src/mongo/bson/bsonobjbuilder.cpp
+++ b/src/mongo/bson/bsonobjbuilder.cpp
@@ -37,6 +37,9 @@
#include "mongo/util/log.h"
namespace mongo {
+
+ using std::string;
+
void BSONObjBuilder::appendMinForType( const StringData& fieldName , int t ) {
switch ( t ) {
diff --git a/src/mongo/client/clientAndShell.cpp b/src/mongo/client/clientAndShell.cpp
index d599ba750cb..38decbc37df 100644
--- a/src/mongo/client/clientAndShell.cpp
+++ b/src/mongo/client/clientAndShell.cpp
@@ -45,6 +45,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::vector;
+
class OperationContext;
const char * curNs = "in client mode";
diff --git a/src/mongo/client/connpool.cpp b/src/mongo/client/connpool.cpp
index 39b4a0f4c29..e4f61bde781 100644
--- a/src/mongo/client/connpool.cpp
+++ b/src/mongo/client/connpool.cpp
@@ -43,6 +43,13 @@
namespace mongo {
+ using std::endl;
+ using std::list;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::vector;
+
// ------ PoolForHost ------
PoolForHost::~PoolForHost() {
diff --git a/src/mongo/client/dbclient.cpp b/src/mongo/client/dbclient.cpp
index f2bf4cbf32e..eab1f5c9877 100644
--- a/src/mongo/client/dbclient.cpp
+++ b/src/mongo/client/dbclient.cpp
@@ -51,6 +51,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::map;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
AtomicInt64 DBClientBase::ConnectionIdSequence;
const char* const saslCommandUserSourceFieldName = "userSource";
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index 929cadf8c48..086eae84215 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -46,6 +46,12 @@
namespace mongo {
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::vector;
namespace {
diff --git a/src/mongo/client/dbclientcursor.cpp b/src/mongo/client/dbclientcursor.cpp
index 344ced2f6f4..8f145345b40 100644
--- a/src/mongo/client/dbclientcursor.cpp
+++ b/src/mongo/client/dbclientcursor.cpp
@@ -46,6 +46,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
void assembleRequest( const string &ns, BSONObj query, int nToReturn, int nToSkip, const BSONObj *fieldsToReturn, int queryOptions, Message &toSend );
void DBClientCursor::_finishConsInit() {
diff --git a/src/mongo/client/gridfs.cpp b/src/mongo/client/gridfs.cpp
index 45b31ae8a9c..448389d446b 100644
--- a/src/mongo/client/gridfs.cpp
+++ b/src/mongo/client/gridfs.cpp
@@ -53,6 +53,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::cout;
+ using std::endl;
+ using std::ios;
+ using std::ofstream;
+ using std::ostream;
+ using std::string;
+
const unsigned DEFAULT_CHUNK_SIZE = 255 * 1024;
GridFSChunk::GridFSChunk( BSONObj o ) {
diff --git a/src/mongo/client/parallel.cpp b/src/mongo/client/parallel.cpp
index 86386a83a91..a165ea5ed54 100644
--- a/src/mongo/client/parallel.cpp
+++ b/src/mongo/client/parallel.cpp
@@ -54,6 +54,13 @@
namespace mongo {
using boost::shared_ptr;
+ using std::endl;
+ using std::list;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
LabeledLevel pc( "pcursor", 2 );
diff --git a/src/mongo/client/replica_set_monitor.cpp b/src/mongo/client/replica_set_monitor.cpp
index e759f47cc08..d5aabfd474c 100644
--- a/src/mongo/client/replica_set_monitor.cpp
+++ b/src/mongo/client/replica_set_monitor.cpp
@@ -56,6 +56,10 @@
namespace mongo {
+ using std::numeric_limits;
+ using std::set;
+ using std::string;
+
namespace {
// Pull nested types to top-level scope
typedef ReplicaSetMonitor::IsMasterReply IsMasterReply;
diff --git a/src/mongo/client/replica_set_monitor_test.cpp b/src/mongo/client/replica_set_monitor_test.cpp
index d52b03f34bf..426f49f6ecb 100644
--- a/src/mongo/client/replica_set_monitor_test.cpp
+++ b/src/mongo/client/replica_set_monitor_test.cpp
@@ -36,6 +36,7 @@
#include "mongo/dbtests/mock/mock_conn_registry.h"
#include "mongo/unittest/unittest.h"
+using std::set;
using namespace mongo;
// Pull nested types to top-level scope
diff --git a/src/mongo/client/sasl_client_authenticate_impl.cpp b/src/mongo/client/sasl_client_authenticate_impl.cpp
index bd7d75bbf68..b1dedf44800 100644
--- a/src/mongo/client/sasl_client_authenticate_impl.cpp
+++ b/src/mongo/client/sasl_client_authenticate_impl.cpp
@@ -54,6 +54,8 @@
namespace mongo {
+ using std::endl;
+
namespace {
// Default log level on the client for SASL log messages.
diff --git a/src/mongo/client/sasl_scramsha1_client_conversation.cpp b/src/mongo/client/sasl_scramsha1_client_conversation.cpp
index 436d069d531..df3d6a181b3 100644
--- a/src/mongo/client/sasl_scramsha1_client_conversation.cpp
+++ b/src/mongo/client/sasl_scramsha1_client_conversation.cpp
@@ -44,6 +44,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
SaslSCRAMSHA1ClientConversation::SaslSCRAMSHA1ClientConversation(
SaslClientSession* saslClientSession) :
diff --git a/src/mongo/client/syncclusterconnection.cpp b/src/mongo/client/syncclusterconnection.cpp
index 083e4f38960..285c0baba26 100644
--- a/src/mongo/client/syncclusterconnection.cpp
+++ b/src/mongo/client/syncclusterconnection.cpp
@@ -44,6 +44,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::map;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
SyncClusterConnection::SyncClusterConnection( const list<HostAndPort> & L, double socketTimeout) : _mutex("SyncClusterConnection"), _socketTimeout( socketTimeout ) {
{
stringstream s;
diff --git a/src/mongo/db/auth/auth_index_d.cpp b/src/mongo/db/auth/auth_index_d.cpp
index a2fa5cf609e..947ee0b8ebe 100644
--- a/src/mongo/db/auth/auth_index_d.cpp
+++ b/src/mongo/db/auth/auth_index_d.cpp
@@ -45,6 +45,9 @@
#include "mongo/util/log.h"
namespace mongo {
+
+ using std::endl;
+
namespace authindex {
namespace {
diff --git a/src/mongo/db/auth/authorization_manager.cpp b/src/mongo/db/auth/authorization_manager.cpp
index 63bccaa4514..0dcc7c34568 100644
--- a/src/mongo/db/auth/authorization_manager.cpp
+++ b/src/mongo/db/auth/authorization_manager.cpp
@@ -65,6 +65,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::vector;
+
AuthInfo internalSecurity;
MONGO_INITIALIZER_WITH_PREREQUISITES(SetupInternalSecurityUser, MONGO_NO_PREREQUISITES)(
@@ -617,7 +621,7 @@ namespace mongo {
user->incrementRefCount();
// NOTE: It is not safe to throw an exception from here to the end of the method.
if (guard.isSameCacheGeneration()) {
- _userCache.insert(make_pair(userName, user.get()));
+ _userCache.insert(std::make_pair(userName, user.get()));
if (_version == schemaVersionInvalid)
_version = authzVersion;
}
diff --git a/src/mongo/db/auth/authorization_manager_test.cpp b/src/mongo/db/auth/authorization_manager_test.cpp
index 4d89de6c5c0..c94c5bfb4c0 100644
--- a/src/mongo/db/auth/authorization_manager_test.cpp
+++ b/src/mongo/db/auth/authorization_manager_test.cpp
@@ -51,6 +51,7 @@ namespace mongo {
namespace {
using boost::scoped_ptr;
+ using std::vector;
TEST(RoleParsingTest, BuildRoleBSON) {
RoleGraph graph;
diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp
index 5b7a7c5e459..00b3b953782 100644
--- a/src/mongo/db/auth/authorization_session.cpp
+++ b/src/mongo/db/auth/authorization_session.cpp
@@ -51,6 +51,8 @@
namespace mongo {
+ using std::vector;
+
namespace {
const std::string ADMIN_DBNAME = "admin";
} // namespace
diff --git a/src/mongo/db/auth/authz_manager_external_state.cpp b/src/mongo/db/auth/authz_manager_external_state.cpp
index 0520b0df526..c23488dee04 100644
--- a/src/mongo/db/auth/authz_manager_external_state.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+ using std::string;
+
AuthzManagerExternalState::AuthzManagerExternalState() {}
AuthzManagerExternalState::~AuthzManagerExternalState() {}
diff --git a/src/mongo/db/auth/authz_manager_external_state_d.cpp b/src/mongo/db/auth/authz_manager_external_state_d.cpp
index b71789d8c8a..6ccc261e016 100644
--- a/src/mongo/db/auth/authz_manager_external_state_d.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_d.cpp
@@ -52,6 +52,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
AuthzManagerExternalStateMongod::AuthzManagerExternalStateMongod() {}
AuthzManagerExternalStateMongod::~AuthzManagerExternalStateMongod() {}
diff --git a/src/mongo/db/auth/authz_manager_external_state_local.cpp b/src/mongo/db/auth/authz_manager_external_state_local.cpp
index b1a0c0a3a99..507db983a53 100644
--- a/src/mongo/db/auth/authz_manager_external_state_local.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_local.cpp
@@ -41,6 +41,8 @@
namespace mongo {
+ using std::vector;
+
AuthzManagerExternalStateLocal::AuthzManagerExternalStateLocal() :
_roleGraphState(roleGraphStateInitial) {}
AuthzManagerExternalStateLocal::~AuthzManagerExternalStateLocal() {}
diff --git a/src/mongo/db/auth/authz_manager_external_state_s.cpp b/src/mongo/db/auth/authz_manager_external_state_s.cpp
index d10fd8d4e2b..63f18318592 100644
--- a/src/mongo/db/auth/authz_manager_external_state_s.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_s.cpp
@@ -51,6 +51,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::vector;
AuthzManagerExternalStateMongos::AuthzManagerExternalStateMongos() {}
diff --git a/src/mongo/db/auth/privilege_parser.cpp b/src/mongo/db/auth/privilege_parser.cpp
index 88dfbf961b0..c0207a8b19c 100644
--- a/src/mongo/db/auth/privilege_parser.cpp
+++ b/src/mongo/db/auth/privilege_parser.cpp
@@ -37,6 +37,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
using mongoutils::str::stream;
const BSONField<bool> ParsedResource::anyResource("anyResource");
diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp
index 1890d3ba54b..ae773dd17e3 100644
--- a/src/mongo/db/auth/sasl_commands.cpp
+++ b/src/mongo/db/auth/sasl_commands.cpp
@@ -57,6 +57,8 @@
namespace mongo {
namespace {
+ using std::stringstream;
+
const bool autoAuthorizeDefault = true;
class CmdSaslStart : public Command {
diff --git a/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp b/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp
index 3ec0e0f32de..385d09a42b9 100644
--- a/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp
+++ b/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp
@@ -50,6 +50,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
SaslSCRAMSHA1ServerConversation::SaslSCRAMSHA1ServerConversation(
SaslAuthenticationSession* saslAuthSession) :
diff --git a/src/mongo/db/auth/security_key.cpp b/src/mongo/db/auth/security_key.cpp
index 0b70544f841..8edbc6ef140 100644
--- a/src/mongo/db/auth/security_key.cpp
+++ b/src/mongo/db/auth/security_key.cpp
@@ -51,6 +51,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
bool setUpSecurityKey(const string& filename) {
struct stat stats;
diff --git a/src/mongo/db/auth/user_management_commands_parser.cpp b/src/mongo/db/auth/user_management_commands_parser.cpp
index f8226d4afcf..7f2174ee22f 100644
--- a/src/mongo/db/auth/user_management_commands_parser.cpp
+++ b/src/mongo/db/auth/user_management_commands_parser.cpp
@@ -48,6 +48,8 @@
namespace mongo {
namespace auth {
+ using std::vector;
+
/**
* Writes into *writeConcern a BSONObj describing the parameters to getLastError to use for
* the write confirmation.
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp
index 642466a73e2..1b1bb6153cb 100644
--- a/src/mongo/db/catalog/collection.cpp
+++ b/src/mongo/db/catalog/collection.cpp
@@ -56,6 +56,10 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
using logger::LogComponent;
std::string CompactOptions::toString() const {
diff --git a/src/mongo/db/catalog/collection_compact.cpp b/src/mongo/db/catalog/collection_compact.cpp
index 911ef28979a..9081bff2682 100644
--- a/src/mongo/db/catalog/collection_compact.cpp
+++ b/src/mongo/db/catalog/collection_compact.cpp
@@ -47,6 +47,9 @@
namespace mongo {
+ using std::endl;
+ using std::vector;
+
namespace {
BSONObj _compactAdjustIndexSpec( const BSONObj& oldSpec ) {
BSONObjBuilder b;
diff --git a/src/mongo/db/catalog/cursor_manager.cpp b/src/mongo/db/catalog/cursor_manager.cpp
index ea03c3175e1..17c42000b31 100644
--- a/src/mongo/db/catalog/cursor_manager.cpp
+++ b/src/mongo/db/catalog/cursor_manager.cpp
@@ -47,6 +47,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
namespace {
unsigned idFromCursorId( CursorId id ) {
uint64_t x = static_cast<uint64_t>(id);
diff --git a/src/mongo/db/catalog/database.cpp b/src/mongo/db/catalog/database.cpp
index d2976a86668..2d7b9588ae4 100644
--- a/src/mongo/db/catalog/database.cpp
+++ b/src/mongo/db/catalog/database.cpp
@@ -62,6 +62,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
void massertNamespaceNotIndex( const StringData& ns, const StringData& caller ) {
massert( 17320,
str::stream() << "cannot do " << caller
diff --git a/src/mongo/db/catalog/database_holder.cpp b/src/mongo/db/catalog/database_holder.cpp
index ae1a73eb27a..4a554b4089f 100644
--- a/src/mongo/db/catalog/database_holder.cpp
+++ b/src/mongo/db/catalog/database_holder.cpp
@@ -45,6 +45,11 @@
namespace mongo {
+ using std::endl;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+
static DatabaseHolder _dbHolder;
namespace {
diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp
index 6462f7396ff..aff072ff221 100644
--- a/src/mongo/db/catalog/index_catalog.cpp
+++ b/src/mongo/db/catalog/index_catalog.cpp
@@ -64,6 +64,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
static const int INDEX_CATALOG_INIT = 283711;
static const int INDEX_CATALOG_UNINIT = 654321;
diff --git a/src/mongo/db/catalog/index_catalog_entry.cpp b/src/mongo/db/catalog/index_catalog_entry.cpp
index 1260b6f14c4..ba049f6e6eb 100644
--- a/src/mongo/db/catalog/index_catalog_entry.cpp
+++ b/src/mongo/db/catalog/index_catalog_entry.cpp
@@ -47,6 +47,8 @@
namespace mongo {
+ using std::string;
+
class HeadManagerImpl : public HeadManager {
public:
HeadManagerImpl(IndexCatalogEntry* ice) : _catalogEntry(ice) { }
diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp
index cf2e7f961e4..1fbd0f4452d 100644
--- a/src/mongo/db/catalog/index_create.cpp
+++ b/src/mongo/db/catalog/index_create.cpp
@@ -55,6 +55,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
+ using std::endl;
/**
* On rollback sets MultiIndexBlock::_needToCleanup to true.
diff --git a/src/mongo/db/catalog/index_key_validate.cpp b/src/mongo/db/catalog/index_key_validate.cpp
index 660f74f77bb..c42c2a1921f 100644
--- a/src/mongo/db/catalog/index_key_validate.cpp
+++ b/src/mongo/db/catalog/index_key_validate.cpp
@@ -34,6 +34,9 @@
#include "mongo/util/mongoutils/str.h"
namespace mongo {
+
+ using std::string;
+
Status validateKeyPattern(const BSONObj& key) {
const ErrorCodes::Error code = ErrorCodes::CannotCreateIndex;
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp
index 6555ebc05e9..6f12fb20be2 100644
--- a/src/mongo/db/client.cpp
+++ b/src/mongo/db/client.cpp
@@ -72,6 +72,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
using logger::LogComponent;
boost::mutex Client::clientsMutex;
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp
index bc09cc4bc01..02e66852a27 100644
--- a/src/mongo/db/clientcursor.cpp
+++ b/src/mongo/db/clientcursor.cpp
@@ -52,6 +52,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
static Counter64 cursorStatsOpen; // gauge
static Counter64 cursorStatsOpenPinned; // gauge
static Counter64 cursorStatsOpenNoTimeout; // gauge
diff --git a/src/mongo/db/clientlistplugin.cpp b/src/mongo/db/clientlistplugin.cpp
index 9ed142ad218..cf7e359d309 100644
--- a/src/mongo/db/clientlistplugin.cpp
+++ b/src/mongo/db/clientlistplugin.cpp
@@ -48,6 +48,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
namespace {
diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp
index b052a253407..d4a6d892604 100644
--- a/src/mongo/db/cloner.cpp
+++ b/src/mongo/db/cloner.cpp
@@ -63,6 +63,12 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::list;
+ using std::set;
+ using std::endl;
+ using std::string;
+ using std::vector;
MONGO_EXPORT_SERVER_PARAMETER(skipCorruptDocumentsWhenCloning, bool, false);
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index b136d39a434..36bb2a37da6 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -55,6 +55,10 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+ using std::endl;
+
using logger::LogComponent;
Command::CommandMap* Command::_commandsByBestName;
diff --git a/src/mongo/db/commands/apply_ops.cpp b/src/mongo/db/commands/apply_ops.cpp
index dc8c4bd601c..da11dbbcff7 100644
--- a/src/mongo/db/commands/apply_ops.cpp
+++ b/src/mongo/db/commands/apply_ops.cpp
@@ -45,6 +45,10 @@
#include "mongo/db/repl/oplog.h"
namespace mongo {
+
+ using std::string;
+ using std::stringstream;
+
class ApplyOpsCmd : public Command {
public:
virtual bool slaveOk() const { return false; }
diff --git a/src/mongo/db/commands/auth_schema_upgrade_d.cpp b/src/mongo/db/commands/auth_schema_upgrade_d.cpp
index b3cfba4a4ef..5980b06735e 100644
--- a/src/mongo/db/commands/auth_schema_upgrade_d.cpp
+++ b/src/mongo/db/commands/auth_schema_upgrade_d.cpp
@@ -44,6 +44,8 @@
namespace mongo {
namespace {
+ using std::string;
+
Status checkReplicaMemberVersions() {
repl::ReplicationCoordinator* replCoord = repl::getGlobalReplicationCoordinator();
diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp
index f62523c08da..6840b3d3497 100644
--- a/src/mongo/db/commands/authentication_commands.cpp
+++ b/src/mongo/db/commands/authentication_commands.cpp
@@ -63,6 +63,10 @@
namespace mongo {
+ using std::hex;
+ using std::string;
+ using std::stringstream;
+
static bool _isCRAuthDisabled;
static bool _isX509AuthDisabled;
static const char _nonceAuthenticationDisabledMessage[] =
diff --git a/src/mongo/db/commands/cleanup_orphaned_cmd.cpp b/src/mongo/db/commands/cleanup_orphaned_cmd.cpp
index 6d10d92d2ae..6245481f292 100644
--- a/src/mongo/db/commands/cleanup_orphaned_cmd.cpp
+++ b/src/mongo/db/commands/cleanup_orphaned_cmd.cpp
@@ -61,6 +61,9 @@ namespace {
namespace mongo {
+ using std::endl;
+ using std::string;
+
using mongoutils::str::stream;
enum CleanupResult {
diff --git a/src/mongo/db/commands/clone.cpp b/src/mongo/db/commands/clone.cpp
index dc51dc68d96..0aba60ba805 100644
--- a/src/mongo/db/commands/clone.cpp
+++ b/src/mongo/db/commands/clone.cpp
@@ -54,6 +54,10 @@
namespace mongo {
+ using std::set;
+ using std::string;
+ using std::stringstream;
+
/* Usage:
mydb.$cmd.findOne( { clone: "fromhost" } );
Note: doesn't work with authentication enabled, except as internal operation or for
diff --git a/src/mongo/db/commands/clone_collection.cpp b/src/mongo/db/commands/clone_collection.cpp
index 411d481dad6..25f2647451f 100644
--- a/src/mongo/db/commands/clone_collection.cpp
+++ b/src/mongo/db/commands/clone_collection.cpp
@@ -59,6 +59,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+ using std::stringstream;
+ using std::endl;
+
class CmdCloneCollection : public Command {
public:
CmdCloneCollection() : Command("cloneCollection") { }
diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp
index 327125ea1c8..442241d6578 100644
--- a/src/mongo/db/commands/collection_to_capped.cpp
+++ b/src/mongo/db/commands/collection_to_capped.cpp
@@ -44,6 +44,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
+ using std::stringstream;
namespace {
diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp
index e087220a3d2..ef60369eaeb 100644
--- a/src/mongo/db/commands/compact.cpp
+++ b/src/mongo/db/commands/compact.cpp
@@ -50,6 +50,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
class CompactCmd : public Command {
public:
virtual bool isWriteCommandForConfigServer() const { return false; }
diff --git a/src/mongo/db/commands/connection_status.cpp b/src/mongo/db/commands/connection_status.cpp
index abd892f2e28..b45fd97fa83 100644
--- a/src/mongo/db/commands/connection_status.cpp
+++ b/src/mongo/db/commands/connection_status.cpp
@@ -37,6 +37,10 @@
#include "mongo/db/commands.h"
namespace mongo {
+
+ using std::string;
+ using std::stringstream;
+
class CmdConnectionStatus : public Command {
public:
CmdConnectionStatus() : Command("connectionStatus") {}
diff --git a/src/mongo/db/commands/copydb.cpp b/src/mongo/db/commands/copydb.cpp
index 41e4f13a13b..03b4e43b1b6 100644
--- a/src/mongo/db/commands/copydb.cpp
+++ b/src/mongo/db/commands/copydb.cpp
@@ -58,6 +58,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
/* Usage:
* admindb.$cmd.findOne( { copydb: 1, fromhost: <connection string>, fromdb: <db>,
* todb: <db>[, username: <username>, nonce: <nonce>, key: <key>] } );
diff --git a/src/mongo/db/commands/copydb_start_commands.cpp b/src/mongo/db/commands/copydb_start_commands.cpp
index 47f34c59c10..9bf95923b96 100644
--- a/src/mongo/db/commands/copydb_start_commands.cpp
+++ b/src/mongo/db/commands/copydb_start_commands.cpp
@@ -60,6 +60,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
// SERVER-4328 todo review for concurrency
// :(
thread_specific_ptr<DBClientBase> authConn_;
diff --git a/src/mongo/db/commands/count.cpp b/src/mongo/db/commands/count.cpp
index 7cd349d17d5..23ff7875eaf 100644
--- a/src/mongo/db/commands/count.cpp
+++ b/src/mongo/db/commands/count.cpp
@@ -47,6 +47,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
+ using std::stringstream;
/* select count(*) */
class CmdCount : public Command {
diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp
index 33f9e7da607..e0088bec523 100644
--- a/src/mongo/db/commands/create_indexes.cpp
+++ b/src/mongo/db/commands/create_indexes.cpp
@@ -49,6 +49,8 @@
namespace mongo {
+ using std::string;
+
/**
* { createIndexes : "bar", indexes : [ { ns : "test.bar", key : { x : 1 }, name: "x_1" } ] }
*/
diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp
index 891d19765b2..0066d700874 100644
--- a/src/mongo/db/commands/dbhash.cpp
+++ b/src/mongo/db/commands/dbhash.cpp
@@ -46,6 +46,12 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::list;
+ using std::endl;
+ using std::set;
+ using std::string;
+ using std::vector;
DBHashCmd dbhashCmd;
diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp
index 2260373317a..0ccbd41909f 100644
--- a/src/mongo/db/commands/distinct.cpp
+++ b/src/mongo/db/commands/distinct.cpp
@@ -46,6 +46,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+ using std::stringstream;
+
class DistinctCommand : public Command {
public:
DistinctCommand() : Command("distinct") {}
diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp
index b46ab0c8f15..e43145dfb3b 100644
--- a/src/mongo/db/commands/drop_indexes.cpp
+++ b/src/mongo/db/commands/drop_indexes.cpp
@@ -53,6 +53,11 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
/* "dropIndexes" is now the preferred form - "deleteIndexes" deprecated */
class CmdDropIndexes : public Command {
public:
diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp
index 51bed5599e8..9a411c8fa26 100644
--- a/src/mongo/db/commands/explain_cmd.cpp
+++ b/src/mongo/db/commands/explain_cmd.cpp
@@ -40,6 +40,8 @@
namespace mongo {
+ using std::string;
+
static CmdExplain cmdExplain;
Status CmdExplain::checkAuthForCommand(ClientBasic* client,
diff --git a/src/mongo/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp
index aa3c79c5bcb..7aca28140d9 100644
--- a/src/mongo/db/commands/fail_point_cmd.cpp
+++ b/src/mongo/db/commands/fail_point_cmd.cpp
@@ -36,6 +36,10 @@
#include "mongo/util/fail_point_service.h"
namespace mongo {
+
+ using std::string;
+ using std::stringstream;
+
/**
* Command for modifying installed fail points.
*
diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp
index b131143f632..e8e5ad2d748 100644
--- a/src/mongo/db/commands/find_and_modify.cpp
+++ b/src/mongo/db/commands/find_and_modify.cpp
@@ -48,6 +48,9 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::string;
+ using std::stringstream;
/* Find and Modify an object returning either the old (default) or new value*/
class CmdFindAndModify : public Command {
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp
index a0a1c21c7b7..89cc90bfc17 100644
--- a/src/mongo/db/commands/find_cmd.cpp
+++ b/src/mongo/db/commands/find_cmd.cpp
@@ -45,6 +45,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::string;
static FindCmd findCmd;
diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp
index eaaf4beb09b..1fcfd70d4cd 100644
--- a/src/mongo/db/commands/fsync.cpp
+++ b/src/mongo/db/commands/fsync.cpp
@@ -50,7 +50,11 @@
namespace mongo {
-
+
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+
class FSyncLockThread : public BackgroundJob {
void doRealWork();
public:
diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp
index cab42a0bcda..450366da759 100644
--- a/src/mongo/db/commands/geo_near_cmd.cpp
+++ b/src/mongo/db/commands/geo_near_cmd.cpp
@@ -54,6 +54,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::stringstream;
class Geo2dFindNearCmd : public Command {
public:
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index bc6959e231d..0d5d5df0675 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -43,6 +43,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
/* reset any errors so that getlasterror comes back clean.
useful before performing a long series of operations where we want to
diff --git a/src/mongo/db/commands/group.cpp b/src/mongo/db/commands/group.cpp
index 5f5b87f5e62..2543b9b7a4b 100644
--- a/src/mongo/db/commands/group.cpp
+++ b/src/mongo/db/commands/group.cpp
@@ -45,6 +45,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
static GroupCommand cmdGroup;
diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp
index 8af317bf0ef..94d9267ded7 100644
--- a/src/mongo/db/commands/hashcmd.cpp
+++ b/src/mongo/db/commands/hashcmd.cpp
@@ -46,6 +46,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
// Testing only, enabled via command-line.
class CmdHashElt : public Command {
public:
diff --git a/src/mongo/db/commands/index_filter_commands_test.cpp b/src/mongo/db/commands/index_filter_commands_test.cpp
index 3ca48225e28..819a93dfa0c 100644
--- a/src/mongo/db/commands/index_filter_commands_test.cpp
+++ b/src/mongo/db/commands/index_filter_commands_test.cpp
@@ -45,6 +45,7 @@ using namespace mongo;
namespace {
using boost::scoped_ptr;
+ using std::auto_ptr;
using std::string;
using std::vector;
diff --git a/src/mongo/db/commands/isself.cpp b/src/mongo/db/commands/isself.cpp
index 0339cfdb0e6..8b6c6fd6d9f 100644
--- a/src/mongo/db/commands/isself.cpp
+++ b/src/mongo/db/commands/isself.cpp
@@ -36,6 +36,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
class IsSelfCommand : public Command {
public:
IsSelfCommand() : Command("_isSelf") {}
diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp
index d9385c62d45..8508390317b 100644
--- a/src/mongo/db/commands/list_collections.cpp
+++ b/src/mongo/db/commands/list_collections.cpp
@@ -49,6 +49,9 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::list;
+ using std::string;
+ using std::stringstream;
class CmdListCollections : public Command {
public:
diff --git a/src/mongo/db/commands/list_databases.cpp b/src/mongo/db/commands/list_databases.cpp
index c84f38333b9..603f340bddc 100644
--- a/src/mongo/db/commands/list_databases.cpp
+++ b/src/mongo/db/commands/list_databases.cpp
@@ -38,6 +38,11 @@
namespace mongo {
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
// XXX: remove and put into storage api
intmax_t dbSize( const string& database );
diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp
index c405bbe8823..16c9678229f 100644
--- a/src/mongo/db/commands/list_indexes.cpp
+++ b/src/mongo/db/commands/list_indexes.cpp
@@ -45,6 +45,10 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
/**
* Lists the indexes for a given collection.
*
diff --git a/src/mongo/db/commands/merge_chunks_cmd.cpp b/src/mongo/db/commands/merge_chunks_cmd.cpp
index e14a5a40564..df67acc1c8d 100644
--- a/src/mongo/db/commands/merge_chunks_cmd.cpp
+++ b/src/mongo/db/commands/merge_chunks_cmd.cpp
@@ -38,6 +38,10 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
/**
* Mongod-side command for merging chunks.
*/
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index e330372778d..f6d340b97d3 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -69,6 +69,12 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
namespace mr {
diff --git a/src/mongo/db/commands/oplog_note.cpp b/src/mongo/db/commands/oplog_note.cpp
index 85789a003cf..3d75399c13d 100644
--- a/src/mongo/db/commands/oplog_note.cpp
+++ b/src/mongo/db/commands/oplog_note.cpp
@@ -38,6 +38,10 @@
#include "mongo/db/repl/replication_coordinator_global.h"
namespace mongo {
+
+ using std::string;
+ using std::stringstream;
+
class AppendOplogNoteCmd : public Command {
public:
AppendOplogNoteCmd() : Command( "appendOplogNote" ) {}
diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp
index 4ac77855f0d..89c0d888361 100644
--- a/src/mongo/db/commands/parallel_collection_scan.cpp
+++ b/src/mongo/db/commands/parallel_collection_scan.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
class ParallelCollectionScanCmd : public Command {
public:
diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp
index 9d864b26eb4..adaa3b0bda4 100644
--- a/src/mongo/db/commands/parameters.cpp
+++ b/src/mongo/db/commands/parameters.cpp
@@ -46,6 +46,7 @@
#include "mongo/util/net/ssl_options.h"
using std::string;
+using std::stringstream;
namespace mongo {
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index ad8cbb0bcb0..a01fad5f1d4 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -57,6 +57,10 @@ namespace mongo {
using boost::intrusive_ptr;
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::string;
+ using std::stringstream;
+ using std::endl;
/**
* Returns true if we need to keep a ClientCursor saved for this pipeline (for future getMore
diff --git a/src/mongo/db/commands/plan_cache_commands_test.cpp b/src/mongo/db/commands/plan_cache_commands_test.cpp
index e723923d185..3ed53afc8f8 100644
--- a/src/mongo/db/commands/plan_cache_commands_test.cpp
+++ b/src/mongo/db/commands/plan_cache_commands_test.cpp
@@ -47,6 +47,7 @@ using namespace mongo;
namespace {
using boost::scoped_ptr;
+ using std::auto_ptr;
using std::string;
using std::vector;
diff --git a/src/mongo/db/commands/rename_collection.cpp b/src/mongo/db/commands/rename_collection.cpp
index 2c87fa0d1e8..dcc1a1b68d6 100644
--- a/src/mongo/db/commands/rename_collection.cpp
+++ b/src/mongo/db/commands/rename_collection.cpp
@@ -49,6 +49,10 @@
namespace mongo {
+ using std::min;
+ using std::string;
+ using std::stringstream;
+
class CmdRenameCollection : public Command {
public:
CmdRenameCollection() : Command( "renameCollection" ) {}
diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp
index 7aa680e115f..b521d526932 100644
--- a/src/mongo/db/commands/repair_cursor.cpp
+++ b/src/mongo/db/commands/repair_cursor.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::string;
+
class RepairCursorCmd : public Command {
public:
RepairCursorCmd() : Command("repairCursor") {}
diff --git a/src/mongo/db/commands/server_status.cpp b/src/mongo/db/commands/server_status.cpp
index a2541ca3324..cbe61fb104f 100644
--- a/src/mongo/db/commands/server_status.cpp
+++ b/src/mongo/db/commands/server_status.cpp
@@ -56,6 +56,11 @@
namespace mongo {
+ using std::endl;
+ using std::map;
+ using std::string;
+ using std::stringstream;
+
class CmdServerStatus : public Command {
public:
diff --git a/src/mongo/db/commands/server_status_internal.cpp b/src/mongo/db/commands/server_status_internal.cpp
index 731379a37d6..e329a3724a4 100644
--- a/src/mongo/db/commands/server_status_internal.cpp
+++ b/src/mongo/db/commands/server_status_internal.cpp
@@ -37,6 +37,11 @@
namespace mongo {
+ using std::cerr;
+ using std::endl;
+ using std::map;
+ using std::string;
+
using namespace mongoutils;
MetricTree* MetricTree::theMetricTree = NULL;
diff --git a/src/mongo/db/commands/server_status_metric.cpp b/src/mongo/db/commands/server_status_metric.cpp
index 285ec813fcf..1e999635751 100644
--- a/src/mongo/db/commands/server_status_metric.cpp
+++ b/src/mongo/db/commands/server_status_metric.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
ServerStatusMetric::ServerStatusMetric(const string& nameIn)
: _name( nameIn ),
_leafName( _parseLeafName( nameIn ) ) {
diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp
index 9401d555894..5bee0bf654c 100644
--- a/src/mongo/db/commands/test_commands.cpp
+++ b/src/mongo/db/commands/test_commands.cpp
@@ -45,6 +45,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+
/* For testing only, not for general use. Enabled via command-line */
class GodInsert : public Command {
public:
diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp
index d514a8ba69c..063d6225976 100644
--- a/src/mongo/db/commands/touch.cpp
+++ b/src/mongo/db/commands/touch.cpp
@@ -51,6 +51,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
class TouchCmd : public Command {
public:
virtual bool isWriteCommandForConfigServer() const { return false; }
diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp
index d4b09c365bc..23e9ac4cedf 100644
--- a/src/mongo/db/commands/user_management_commands.cpp
+++ b/src/mongo/db/commands/user_management_commands.cpp
@@ -68,6 +68,11 @@ namespace mongo {
namespace str = mongoutils::str;
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
static void redactPasswordData(mutablebson::Element parent) {
namespace mmb = mutablebson;
const StringData pwdFieldName("pwd", StringData::LiteralTag());
diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp
index 3e6a2dd3af0..51487d34512 100644
--- a/src/mongo/db/commands/validate.cpp
+++ b/src/mongo/db/commands/validate.cpp
@@ -40,6 +40,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+
class ValidateCmd : public Command {
public:
ValidateCmd() : Command( "validate" ) {}
diff --git a/src/mongo/db/commands/write_commands/batch_executor.cpp b/src/mongo/db/commands/write_commands/batch_executor.cpp
index b5727d28e7e..0b36db13b54 100644
--- a/src/mongo/db/commands/write_commands/batch_executor.cpp
+++ b/src/mongo/db/commands/write_commands/batch_executor.cpp
@@ -75,6 +75,10 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
namespace {
diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp
index db3e9e0f6d8..e5b2feeaa90 100644
--- a/src/mongo/db/commands/write_commands/write_commands.cpp
+++ b/src/mongo/db/commands/write_commands/write_commands.cpp
@@ -51,6 +51,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
namespace {
MONGO_INITIALIZER(RegisterWriteCommands)(InitializerContext* context) {
diff --git a/src/mongo/db/commands/writeback_compatibility_shim.cpp b/src/mongo/db/commands/writeback_compatibility_shim.cpp
index 48fe076974b..7441ed5d273 100644
--- a/src/mongo/db/commands/writeback_compatibility_shim.cpp
+++ b/src/mongo/db/commands/writeback_compatibility_shim.cpp
@@ -44,6 +44,8 @@
namespace mongo {
using std::string;
+ using std::stringstream;
+
using mongoutils::str::stream;
/**
diff --git a/src/mongo/db/concurrency/d_concurrency_test.cpp b/src/mongo/db/concurrency/d_concurrency_test.cpp
index 34a780b4afa..e449f3c88cd 100644
--- a/src/mongo/db/concurrency/d_concurrency_test.cpp
+++ b/src/mongo/db/concurrency/d_concurrency_test.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::string;
+
TEST(DConcurrency, GlobalRead) {
MMAPV1LockerImpl ls;
Lock::GlobalRead globalRead(&ls);
diff --git a/src/mongo/db/concurrency/lock_manager.cpp b/src/mongo/db/concurrency/lock_manager.cpp
index 01fe903b6e1..b721451ba6d 100644
--- a/src/mongo/db/concurrency/lock_manager.cpp
+++ b/src/mongo/db/concurrency/lock_manager.cpp
@@ -41,6 +41,9 @@
#include "mongo/util/timer.h"
namespace mongo {
+
+ using std::string;
+
namespace {
/**
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index dc1dda73aa0..3bb42e4d1e7 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -43,6 +43,8 @@
namespace mongo {
+ using std::string;
+
// Enabling the maxTimeAlwaysTimeOut fail point will cause any query or command run with a valid
// non-zero max time to fail immediately. Any getmore operation on a cursor already created
// with a valid non-zero max time will also fail immediately.
diff --git a/src/mongo/db/currentop_command.cpp b/src/mongo/db/currentop_command.cpp
index 0ff88ae479c..1dd1b784201 100644
--- a/src/mongo/db/currentop_command.cpp
+++ b/src/mongo/db/currentop_command.cpp
@@ -46,6 +46,8 @@
namespace mongo {
+ using std::stringstream;
+
void inProgCmd(OperationContext* txn, Message &message, DbResponse &dbresponse) {
DbMessage d(message);
QueryMessage q(d);
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 10139e33a45..3911ddecbef 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -118,6 +118,15 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::cout;
+ using std::cerr;
+ using std::endl;
+ using std::list;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
using logger::LogComponent;
void (*snmpInit)() = NULL;
@@ -734,7 +743,7 @@ static void startupConfigActions(const std::vector<std::string>& args) {
string procPath;
if (!failed){
try {
- ifstream f (name.c_str());
+ std::ifstream f (name.c_str());
f >> pid;
procPath = (str::stream() << "/proc/" << pid);
if (!boost::filesystem::exists(procPath))
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index fcf2acb90cf..aaf368c2729 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -88,7 +88,11 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::ostringstream;
using std::string;
+ using std::stringstream;
CmdShutdown cmdShutdown;
diff --git a/src/mongo/db/dbcommands_generic.cpp b/src/mongo/db/dbcommands_generic.cpp
index 4f2251dd061..4e3a4e0b06c 100644
--- a/src/mongo/db/dbcommands_generic.cpp
+++ b/src/mongo/db/dbcommands_generic.cpp
@@ -68,6 +68,11 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
#if 0
namespace cloud {
SimpleMutex mtx("cloud");
diff --git a/src/mongo/db/dbdirectclient.cpp b/src/mongo/db/dbdirectclient.cpp
index 9d683ed176e..b0d673b5de1 100644
--- a/src/mongo/db/dbdirectclient.cpp
+++ b/src/mongo/db/dbdirectclient.cpp
@@ -37,6 +37,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+
// Called from scripting/engine.cpp and scripting/v8_db.cpp.
DBClientBase* createDirectClient(OperationContext* txn) {
return new DBDirectClient(txn);
diff --git a/src/mongo/db/dbeval.cpp b/src/mongo/db/dbeval.cpp
index 711b2df7777..6aafa0f9079 100644
--- a/src/mongo/db/dbeval.cpp
+++ b/src/mongo/db/dbeval.cpp
@@ -49,6 +49,10 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::dec;
+ using std::endl;
+ using std::string;
+ using std::stringstream;
const int edebug=0;
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index 4bf272478ad..2d211d94eae 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -66,6 +66,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::ios_base;
+ using std::ofstream;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+
using logger::LogComponent;
const BSONObj reverseNaturalObj = BSON( "$natural" << -1 );
diff --git a/src/mongo/db/dbmessage.cpp b/src/mongo/db/dbmessage.cpp
index 54c4edab7af..bf38e1a94e5 100644
--- a/src/mongo/db/dbmessage.cpp
+++ b/src/mongo/db/dbmessage.cpp
@@ -36,6 +36,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
string Message::toString() const {
stringstream ss;
ss << "op: " << opToString( operation() ) << " len: " << size();
diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp
index d2ce63e9c40..5f4dc6b7426 100644
--- a/src/mongo/db/dbwebserver.cpp
+++ b/src/mongo/db/dbwebserver.cpp
@@ -65,6 +65,10 @@
namespace mongo {
+ using std::map;
+ using std::stringstream;
+ using std::vector;
+
using namespace html;
struct Timing {
diff --git a/src/mongo/db/driverHelpers.cpp b/src/mongo/db/driverHelpers.cpp
index 24f133686dd..9c3046a57f3 100644
--- a/src/mongo/db/driverHelpers.cpp
+++ b/src/mongo/db/driverHelpers.cpp
@@ -53,6 +53,8 @@
namespace mongo {
+ using std::string;
+
class BasicDriverHelper : public Command {
public:
BasicDriverHelper( const char * name ) : Command( name ) {}
diff --git a/src/mongo/db/exec/and_hash.cpp b/src/mongo/db/exec/and_hash.cpp
index 8c8ef9e2980..10271666d47 100644
--- a/src/mongo/db/exec/and_hash.cpp
+++ b/src/mongo/db/exec/and_hash.cpp
@@ -46,6 +46,7 @@ namespace {
namespace mongo {
using std::auto_ptr;
+ using std::vector;
const size_t AndHashStage::kLookAheadWorks = 10;
diff --git a/src/mongo/db/exec/and_sorted.cpp b/src/mongo/db/exec/and_sorted.cpp
index 362a12fdbab..5641f52a048 100644
--- a/src/mongo/db/exec/and_sorted.cpp
+++ b/src/mongo/db/exec/and_sorted.cpp
@@ -36,6 +36,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::numeric_limits;
+ using std::vector;
+
// static
const char* AndSortedStage::kStageType = "AND_SORTED";
diff --git a/src/mongo/db/exec/cached_plan.cpp b/src/mongo/db/exec/cached_plan.cpp
index 1996fab826a..f4e026f740c 100644
--- a/src/mongo/db/exec/cached_plan.cpp
+++ b/src/mongo/db/exec/cached_plan.cpp
@@ -41,6 +41,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* CachedPlanStage::kStageType = "CACHED_PLAN";
diff --git a/src/mongo/db/exec/collection_scan.cpp b/src/mongo/db/exec/collection_scan.cpp
index 088fa9fab75..ac708ca13b7 100644
--- a/src/mongo/db/exec/collection_scan.cpp
+++ b/src/mongo/db/exec/collection_scan.cpp
@@ -44,6 +44,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* CollectionScan::kStageType = "COLLSCAN";
diff --git a/src/mongo/db/exec/count.cpp b/src/mongo/db/exec/count.cpp
index cc31f30898b..a6bd76382d4 100644
--- a/src/mongo/db/exec/count.cpp
+++ b/src/mongo/db/exec/count.cpp
@@ -36,6 +36,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* CountStage::kStageType = "COUNT";
diff --git a/src/mongo/db/exec/count_scan.cpp b/src/mongo/db/exec/count_scan.cpp
index 00fa2da47e9..355534fe29b 100644
--- a/src/mongo/db/exec/count_scan.cpp
+++ b/src/mongo/db/exec/count_scan.cpp
@@ -34,6 +34,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* CountScan::kStageType = "COUNT_SCAN";
diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp
index 085ba16c10b..232edd27416 100644
--- a/src/mongo/db/exec/delete.cpp
+++ b/src/mongo/db/exec/delete.cpp
@@ -41,6 +41,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* DeleteStage::kStageType = "DELETE";
diff --git a/src/mongo/db/exec/distinct_scan.cpp b/src/mongo/db/exec/distinct_scan.cpp
index 93fefed5c16..a0b4e4e0271 100644
--- a/src/mongo/db/exec/distinct_scan.cpp
+++ b/src/mongo/db/exec/distinct_scan.cpp
@@ -37,6 +37,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* DistinctScan::kStageType = "DISTINCT";
diff --git a/src/mongo/db/exec/eof.cpp b/src/mongo/db/exec/eof.cpp
index c21e6cf6668..3b9b3528b2f 100644
--- a/src/mongo/db/exec/eof.cpp
+++ b/src/mongo/db/exec/eof.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::vector;
+
// static
const char* EOFStage::kStageType = "EOF";
diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp
index f6e0dd7094b..ac0cb291ab7 100644
--- a/src/mongo/db/exec/fetch.cpp
+++ b/src/mongo/db/exec/fetch.cpp
@@ -38,6 +38,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* FetchStage::kStageType = "FETCH";
diff --git a/src/mongo/db/exec/geo_near.cpp b/src/mongo/db/exec/geo_near.cpp
index 29ed167bd2d..f45fa051d08 100644
--- a/src/mongo/db/exec/geo_near.cpp
+++ b/src/mongo/db/exec/geo_near.cpp
@@ -1,3 +1,4 @@
+
/**
* Copyright (C) 2014 10gen Inc.
*
@@ -52,6 +53,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::abs;
+ using std::auto_ptr;
//
// Shared GeoNear search functionality
diff --git a/src/mongo/db/exec/group.cpp b/src/mongo/db/exec/group.cpp
index 1a7d5b174ac..c6f8c1267b7 100644
--- a/src/mongo/db/exec/group.cpp
+++ b/src/mongo/db/exec/group.cpp
@@ -38,6 +38,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
namespace {
// Helper function that extracts the group key from a BSONObj.
diff --git a/src/mongo/db/exec/idhack.cpp b/src/mongo/db/exec/idhack.cpp
index f3d97f16527..ff3e02b6187 100644
--- a/src/mongo/db/exec/idhack.cpp
+++ b/src/mongo/db/exec/idhack.cpp
@@ -41,6 +41,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* IDHackStage::kStageType = "IDHACK";
diff --git a/src/mongo/db/exec/index_scan.cpp b/src/mongo/db/exec/index_scan.cpp
index 2a8ab64305b..4bcfaecd115 100644
--- a/src/mongo/db/exec/index_scan.cpp
+++ b/src/mongo/db/exec/index_scan.cpp
@@ -51,6 +51,9 @@ namespace {
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* IndexScan::kStageType = "IXSCAN";
diff --git a/src/mongo/db/exec/keep_mutations.cpp b/src/mongo/db/exec/keep_mutations.cpp
index c35793c4300..adc1c69e5a4 100644
--- a/src/mongo/db/exec/keep_mutations.cpp
+++ b/src/mongo/db/exec/keep_mutations.cpp
@@ -33,6 +33,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* KeepMutationsStage::kStageType = "KEEP_MUTATIONS";
diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp
index 0d0dfcb596a..a098206f8db 100644
--- a/src/mongo/db/exec/limit.cpp
+++ b/src/mongo/db/exec/limit.cpp
@@ -34,6 +34,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* LimitStage::kStageType = "LIMIT";
diff --git a/src/mongo/db/exec/merge_sort.cpp b/src/mongo/db/exec/merge_sort.cpp
index f6e0e735a08..aaf0b9ac962 100644
--- a/src/mongo/db/exec/merge_sort.cpp
+++ b/src/mongo/db/exec/merge_sort.cpp
@@ -35,6 +35,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::list;
+ using std::string;
+ using std::vector;
+
// static
const char* MergeSortStage::kStageType = "SORT_MERGE";
diff --git a/src/mongo/db/exec/multi_iterator.cpp b/src/mongo/db/exec/multi_iterator.cpp
index 676f64f7e92..20f2c3a734b 100644
--- a/src/mongo/db/exec/multi_iterator.cpp
+++ b/src/mongo/db/exec/multi_iterator.cpp
@@ -35,6 +35,8 @@
namespace mongo {
+ using std::vector;
+
MultiIteratorStage::MultiIteratorStage(OperationContext* txn,
WorkingSet* ws,
Collection* collection)
diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp
index 1cd5ead1ca0..384469a137b 100644
--- a/src/mongo/db/exec/multi_plan.cpp
+++ b/src/mongo/db/exec/multi_plan.cpp
@@ -51,6 +51,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::vector;
+
// static
const char* MultiPlanStage::kStageType = "MULTI_PLAN";
diff --git a/src/mongo/db/exec/near.cpp b/src/mongo/db/exec/near.cpp
index 9c0e8d43ec6..cb10955e4ec 100644
--- a/src/mongo/db/exec/near.cpp
+++ b/src/mongo/db/exec/near.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::vector;
+
NearStage::NearStage(OperationContext* txn,
WorkingSet* workingSet,
Collection* collection,
@@ -234,7 +236,7 @@ namespace mongo {
// Store the member's RecordId, if available, for quick invalidation
if (nextMember->hasLoc()) {
- _nextIntervalSeen.insert(make_pair(nextMember->loc, nextMemberID));
+ _nextIntervalSeen.insert(std::make_pair(nextMember->loc, nextMemberID));
}
if (!distanceStatus.isOK()) {
diff --git a/src/mongo/db/exec/oplogstart.cpp b/src/mongo/db/exec/oplogstart.cpp
index 1edc3bc2b94..5d4a3296f92 100644
--- a/src/mongo/db/exec/oplogstart.cpp
+++ b/src/mongo/db/exec/oplogstart.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::vector;
+
// Does not take ownership.
OplogStart::OplogStart(OperationContext* txn,
const Collection* collection,
diff --git a/src/mongo/db/exec/or.cpp b/src/mongo/db/exec/or.cpp
index 91364d9807e..b9c1c8f3170 100644
--- a/src/mongo/db/exec/or.cpp
+++ b/src/mongo/db/exec/or.cpp
@@ -35,6 +35,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* OrStage::kStageType = "OR";
diff --git a/src/mongo/db/exec/pipeline_proxy.cpp b/src/mongo/db/exec/pipeline_proxy.cpp
index ca97e7a962b..5369429cd07 100644
--- a/src/mongo/db/exec/pipeline_proxy.cpp
+++ b/src/mongo/db/exec/pipeline_proxy.cpp
@@ -39,6 +39,7 @@ namespace mongo {
using boost::intrusive_ptr;
using boost::shared_ptr;
+ using std::vector;
PipelineProxyStage::PipelineProxyStage(intrusive_ptr<Pipeline> pipeline,
const boost::shared_ptr<PlanExecutor>& child,
diff --git a/src/mongo/db/exec/projection.cpp b/src/mongo/db/exec/projection.cpp
index 9d13644f1a7..8043c1546a0 100644
--- a/src/mongo/db/exec/projection.cpp
+++ b/src/mongo/db/exec/projection.cpp
@@ -41,6 +41,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::vector;
+
static const char* kIdField = "_id";
// static
diff --git a/src/mongo/db/exec/projection_exec.cpp b/src/mongo/db/exec/projection_exec.cpp
index 6a66ccfa1ee..8ae16dc515d 100644
--- a/src/mongo/db/exec/projection_exec.cpp
+++ b/src/mongo/db/exec/projection_exec.cpp
@@ -36,6 +36,9 @@
namespace mongo {
+ using std::max;
+ using std::string;
+
ProjectionExec::ProjectionExec()
: _include(true),
_special(false),
diff --git a/src/mongo/db/exec/queued_data_stage.cpp b/src/mongo/db/exec/queued_data_stage.cpp
index 3d3ab327601..1e40b87d21a 100644
--- a/src/mongo/db/exec/queued_data_stage.cpp
+++ b/src/mongo/db/exec/queued_data_stage.cpp
@@ -33,6 +33,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
const char* QueuedDataStage::kStageType = "QUEUED_DATA";
QueuedDataStage::QueuedDataStage(WorkingSet* ws)
diff --git a/src/mongo/db/exec/queued_data_stage_test.cpp b/src/mongo/db/exec/queued_data_stage_test.cpp
index 98d74ce894c..26bc5962a8a 100644
--- a/src/mongo/db/exec/queued_data_stage_test.cpp
+++ b/src/mongo/db/exec/queued_data_stage_test.cpp
@@ -38,6 +38,8 @@ using namespace mongo;
namespace {
+ using std::auto_ptr;
+
//
// Basic test that we get out valid stats objects.
//
diff --git a/src/mongo/db/exec/shard_filter.cpp b/src/mongo/db/exec/shard_filter.cpp
index d5344af6dc2..60d31990be0 100644
--- a/src/mongo/db/exec/shard_filter.cpp
+++ b/src/mongo/db/exec/shard_filter.cpp
@@ -38,6 +38,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* ShardFilterStage::kStageType = "SHARDING_FILTER";
diff --git a/src/mongo/db/exec/skip.cpp b/src/mongo/db/exec/skip.cpp
index 34d4e07c9f3..f20f4a90935 100644
--- a/src/mongo/db/exec/skip.cpp
+++ b/src/mongo/db/exec/skip.cpp
@@ -33,6 +33,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::vector;
+
// static
const char* SkipStage::kStageType = "SKIP";
diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp
index aaa2b852206..3ccafbdb318 100644
--- a/src/mongo/db/exec/sort.cpp
+++ b/src/mongo/db/exec/sort.cpp
@@ -43,6 +43,8 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
using std::vector;
// static
diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp
index fb0ea1619d4..d93a4637a41 100644
--- a/src/mongo/db/exec/stagedebug_cmd.cpp
+++ b/src/mongo/db/exec/stagedebug_cmd.cpp
@@ -51,6 +51,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
+
/**
* A command for manually constructing a query tree and running it.
*
diff --git a/src/mongo/db/exec/subplan.cpp b/src/mongo/db/exec/subplan.cpp
index e436fe8e01a..ec155e3bdb8 100644
--- a/src/mongo/db/exec/subplan.cpp
+++ b/src/mongo/db/exec/subplan.cpp
@@ -43,6 +43,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::vector;
+
// static
const char* SubplanStage::kStageType = "SUBPLAN";
diff --git a/src/mongo/db/exec/text.cpp b/src/mongo/db/exec/text.cpp
index 95053c8c8da..ee1c733f955 100644
--- a/src/mongo/db/exec/text.cpp
+++ b/src/mongo/db/exec/text.cpp
@@ -39,6 +39,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
+
// static
const char* TextStage::kStageType = "TEXT";
diff --git a/src/mongo/db/exec/update.cpp b/src/mongo/db/exec/update.cpp
index 016fe231ecd..96f23972ffe 100644
--- a/src/mongo/db/exec/update.cpp
+++ b/src/mongo/db/exec/update.cpp
@@ -44,6 +44,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
+
namespace mb = mutablebson;
namespace {
diff --git a/src/mongo/db/exec/working_set.cpp b/src/mongo/db/exec/working_set.cpp
index 6fd3a37a0b6..c35b39d7c94 100644
--- a/src/mongo/db/exec/working_set.cpp
+++ b/src/mongo/db/exec/working_set.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
WorkingSet::MemberHolder::MemberHolder() : member(NULL) { }
WorkingSet::MemberHolder::~MemberHolder() {}
diff --git a/src/mongo/db/exec/working_set_test.cpp b/src/mongo/db/exec/working_set_test.cpp
index 120e74a89ab..c2c7f88a474 100644
--- a/src/mongo/db/exec/working_set_test.cpp
+++ b/src/mongo/db/exec/working_set_test.cpp
@@ -42,6 +42,8 @@ using namespace mongo;
namespace {
+ using std::string;
+
class WorkingSetFixture : public mongo::unittest::Test {
protected:
void setUp() {
diff --git a/src/mongo/db/field_parser.cpp b/src/mongo/db/field_parser.cpp
index 47b5b8cf1c0..a53714afadb 100644
--- a/src/mongo/db/field_parser.cpp
+++ b/src/mongo/db/field_parser.cpp
@@ -31,6 +31,7 @@
namespace mongo {
+ using std::string;
using mongoutils::str::stream;
FieldParser::FieldState FieldParser::extract( BSONObj doc,
diff --git a/src/mongo/db/fts/fts_element_iterator.cpp b/src/mongo/db/fts/fts_element_iterator.cpp
index 477822371a4..f57e1097c14 100644
--- a/src/mongo/db/fts/fts_element_iterator.cpp
+++ b/src/mongo/db/fts/fts_element_iterator.cpp
@@ -39,6 +39,8 @@ namespace mongo {
namespace fts {
+ using std::string;
+
extern const double DEFAULT_WEIGHT;
extern const double MAX_WEIGHT;
diff --git a/src/mongo/db/fts/fts_element_iterator_test.cpp b/src/mongo/db/fts/fts_element_iterator_test.cpp
index 5666084c2e1..312f9e783d7 100644
--- a/src/mongo/db/fts/fts_element_iterator_test.cpp
+++ b/src/mongo/db/fts/fts_element_iterator_test.cpp
@@ -39,6 +39,8 @@
namespace mongo {
namespace fts {
+ using std::string;
+
TEST( FTSElementIterator, Test1 ) {
BSONObj obj = fromjson(
diff --git a/src/mongo/db/fts/fts_index_format.cpp b/src/mongo/db/fts/fts_index_format.cpp
index 09519005292..871f4e29d03 100644
--- a/src/mongo/db/fts/fts_index_format.cpp
+++ b/src/mongo/db/fts/fts_index_format.cpp
@@ -44,6 +44,9 @@ namespace mongo {
namespace fts {
+ using std::string;
+ using std::vector;
+
namespace {
BSONObj nullObj;
BSONElement nullElt;
diff --git a/src/mongo/db/fts/fts_matcher.cpp b/src/mongo/db/fts/fts_matcher.cpp
index 1497bc41af4..e079c057a8e 100644
--- a/src/mongo/db/fts/fts_matcher.cpp
+++ b/src/mongo/db/fts/fts_matcher.cpp
@@ -41,6 +41,8 @@ namespace mongo {
namespace fts {
+ using std::string;
+
FTSMatcher::FTSMatcher( const FTSQuery& query, const FTSSpec& spec )
: _query( query ),
_spec( spec ) {
diff --git a/src/mongo/db/fts/fts_query.cpp b/src/mongo/db/fts/fts_query.cpp
index c1378a0dd72..29034e3753e 100644
--- a/src/mongo/db/fts/fts_query.cpp
+++ b/src/mongo/db/fts/fts_query.cpp
@@ -45,6 +45,11 @@ namespace mongo {
using namespace mongoutils;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
Status FTSQuery::parse(const string& query, const StringData& language,
TextIndexVersion textIndexVersion) {
_search = query;
diff --git a/src/mongo/db/fts/fts_query.h b/src/mongo/db/fts/fts_query.h
index 4a0ca4735ce..0bee769172c 100644
--- a/src/mongo/db/fts/fts_query.h
+++ b/src/mongo/db/fts/fts_query.h
@@ -42,10 +42,6 @@ namespace mongo {
namespace fts {
- using std::string;
- using std::vector;
- using std::set;
-
class FTSQuery {
public:
diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp
index e02674d6bd0..3e0cb344128 100644
--- a/src/mongo/db/fts/fts_spec.cpp
+++ b/src/mongo/db/fts/fts_spec.cpp
@@ -44,6 +44,8 @@ namespace mongo {
namespace fts {
+ using std::map;
+ using std::string;
using namespace mongoutils;
const double DEFAULT_WEIGHT = 1;
diff --git a/src/mongo/db/fts/fts_spec_legacy.cpp b/src/mongo/db/fts/fts_spec_legacy.cpp
index 556cac1e091..5f958f97b38 100644
--- a/src/mongo/db/fts/fts_spec_legacy.cpp
+++ b/src/mongo/db/fts/fts_spec_legacy.cpp
@@ -39,6 +39,8 @@ namespace mongo {
// text indexes.
//
+ using std::map;
+ using std::string;
using namespace mongoutils;
namespace {
diff --git a/src/mongo/db/fts/fts_spec_test.cpp b/src/mongo/db/fts/fts_spec_test.cpp
index d69c39951b3..aa0d659ed4b 100644
--- a/src/mongo/db/fts/fts_spec_test.cpp
+++ b/src/mongo/db/fts/fts_spec_test.cpp
@@ -38,6 +38,10 @@
#include "mongo/unittest/unittest.h"
namespace mongo {
+
+ using std::set;
+ using std::string;
+
namespace fts {
/**
diff --git a/src/mongo/db/fts/stemmer.cpp b/src/mongo/db/fts/stemmer.cpp
index a86cfda8015..dd260f92305 100644
--- a/src/mongo/db/fts/stemmer.cpp
+++ b/src/mongo/db/fts/stemmer.cpp
@@ -38,6 +38,8 @@ namespace mongo {
namespace fts {
+ using std::string;
+
Stemmer::Stemmer( const FTSLanguage& language ) {
_stemmer = NULL;
if ( language.str() != "none" )
diff --git a/src/mongo/db/geo/geoparser.cpp b/src/mongo/db/geo/geoparser.cpp
index ce385a051f5..12fee4b7917 100644
--- a/src/mongo/db/geo/geoparser.cpp
+++ b/src/mongo/db/geo/geoparser.cpp
@@ -43,6 +43,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::stringstream;
+
// This field must be present, and...
static const string GEOJSON_TYPE = "type";
// Have one of these values:
diff --git a/src/mongo/db/geo/hash.cpp b/src/mongo/db/geo/hash.cpp
index 53d56f84fa5..318a1cfdcab 100644
--- a/src/mongo/db/geo/hash.cpp
+++ b/src/mongo/db/geo/hash.cpp
@@ -40,6 +40,8 @@ using namespace mongoutils;
namespace mongo {
+ using std::stringstream;
+
std::ostream& operator<<(std::ostream &s, const GeoHash &h) {
return s << h.toString();
}
@@ -242,7 +244,7 @@ namespace mongo {
string GeoHash::toStringHex1() const {
stringstream ss;
- ss << hex << _hash;
+ ss << std::hex << _hash;
return ss.str();
}
diff --git a/src/mongo/db/geo/haystack.cpp b/src/mongo/db/geo/haystack.cpp
index 6d416721530..cf2c218fa35 100644
--- a/src/mongo/db/geo/haystack.cpp
+++ b/src/mongo/db/geo/haystack.cpp
@@ -51,6 +51,9 @@
*/
namespace mongo {
+ using std::string;
+ using std::vector;
+
class GeoHaystackSearchCommand : public Command {
public:
GeoHaystackSearchCommand() : Command("geoSearch") {}
diff --git a/src/mongo/db/geo/r2_region_coverer.cpp b/src/mongo/db/geo/r2_region_coverer.cpp
index 6af5df2c507..c5ee989f85e 100644
--- a/src/mongo/db/geo/r2_region_coverer.cpp
+++ b/src/mongo/db/geo/r2_region_coverer.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::less;
+
// Definition
int const R2RegionCoverer::kDefaultMaxCells = 8;
diff --git a/src/mongo/db/geo/r2_region_coverer_test.cpp b/src/mongo/db/geo/r2_region_coverer_test.cpp
index 5f61d40357a..470d6208e37 100644
--- a/src/mongo/db/geo/r2_region_coverer_test.cpp
+++ b/src/mongo/db/geo/r2_region_coverer_test.cpp
@@ -38,6 +38,7 @@
namespace {
+ using std::auto_ptr;
using namespace mongo;
using mongo::Polygon; // "windows.h" has another Polygon for Windows GDI.
diff --git a/src/mongo/db/geo/shapes.cpp b/src/mongo/db/geo/shapes.cpp
index 562e35a46fc..d87cb9334ce 100644
--- a/src/mongo/db/geo/shapes.cpp
+++ b/src/mongo/db/geo/shapes.cpp
@@ -30,6 +30,8 @@
#include "mongo/db/geo/shapes.h"
#include "mongo/util/mongoutils/str.h"
+using std::abs;
+
// So we can get at the str namespace.
using namespace mongoutils;
diff --git a/src/mongo/db/index/btree_access_method.cpp b/src/mongo/db/index/btree_access_method.cpp
index 1002903b921..dcd40fe386c 100644
--- a/src/mongo/db/index/btree_access_method.cpp
+++ b/src/mongo/db/index/btree_access_method.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+ using std::vector;
+
// Standard Btree implementation below.
BtreeAccessMethod::BtreeAccessMethod(IndexCatalogEntry* btreeState, SortedDataInterface* btree )
: BtreeBasedAccessMethod(btreeState, btree) {
diff --git a/src/mongo/db/index/btree_based_access_method.cpp b/src/mongo/db/index/btree_based_access_method.cpp
index 78762b607fa..e94208462ac 100644
--- a/src/mongo/db/index/btree_based_access_method.cpp
+++ b/src/mongo/db/index/btree_based_access_method.cpp
@@ -47,6 +47,10 @@
namespace mongo {
+ using std::endl;
+ using std::set;
+ using std::vector;
+
MONGO_EXPORT_SERVER_PARAMETER(failIndexKeyTooLong, bool, true);
BtreeBasedAccessMethod::BtreeBasedAccessMethod(IndexCatalogEntry* btreeState,
diff --git a/src/mongo/db/index/btree_based_bulk_access_method.cpp b/src/mongo/db/index/btree_based_bulk_access_method.cpp
index 073db4c1d92..12fcd1bfbd2 100644
--- a/src/mongo/db/index/btree_based_bulk_access_method.cpp
+++ b/src/mongo/db/index/btree_based_bulk_access_method.cpp
@@ -43,6 +43,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::set;
//
// Comparison for external sorter interface
diff --git a/src/mongo/db/index/btree_index_cursor.cpp b/src/mongo/db/index/btree_index_cursor.cpp
index 32bad4caed9..ed8d1935826 100644
--- a/src/mongo/db/index/btree_index_cursor.cpp
+++ b/src/mongo/db/index/btree_index_cursor.cpp
@@ -39,6 +39,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
BtreeIndexCursor::BtreeIndexCursor(SortedDataInterface::Cursor* cursor) : _cursor(cursor) { }
bool BtreeIndexCursor::isEOF() const { return _cursor->isEOF(); }
diff --git a/src/mongo/db/index/btree_key_generator.cpp b/src/mongo/db/index/btree_key_generator.cpp
index 6049b588fcf..464c39dd486 100644
--- a/src/mongo/db/index/btree_key_generator.cpp
+++ b/src/mongo/db/index/btree_key_generator.cpp
@@ -31,6 +31,11 @@
namespace mongo {
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
// Used in scanandorder.cpp to inforatively error when we try to sort keys with parallel arrays.
const int BtreeKeyGenerator::ParallelArraysCode = 10088;
diff --git a/src/mongo/db/index/btree_key_generator_test.cpp b/src/mongo/db/index/btree_key_generator_test.cpp
index 8b162eca82d..a3e6b582f16 100644
--- a/src/mongo/db/index/btree_key_generator_test.cpp
+++ b/src/mongo/db/index/btree_key_generator_test.cpp
@@ -36,6 +36,9 @@
using namespace mongo;
using boost::scoped_ptr;
+using std::cout;
+using std::endl;
+using std::vector;
namespace {
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp
index 95413374f4b..3b03a2270a9 100644
--- a/src/mongo/db/index_builder.cpp
+++ b/src/mongo/db/index_builder.cpp
@@ -45,6 +45,8 @@
namespace mongo {
+ using std::endl;
+
AtomicUInt32 IndexBuilder::_indexBuildCount;
namespace {
diff --git a/src/mongo/db/index_names.cpp b/src/mongo/db/index_names.cpp
index d3f79886e36..6f0b3f095ab 100644
--- a/src/mongo/db/index_names.cpp
+++ b/src/mongo/db/index_names.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
const string IndexNames::GEO_2D = "2d";
const string IndexNames::GEO_HAYSTACK = "geoHaystack";
const string IndexNames::GEO_2DSPHERE = "2dsphere";
diff --git a/src/mongo/db/index_names.h b/src/mongo/db/index_names.h
index 728906ed701..817fce2dcf6 100644
--- a/src/mongo/db/index_names.h
+++ b/src/mongo/db/index_names.h
@@ -32,8 +32,6 @@
namespace mongo {
- using std::string;
-
class BSONObj;
/**
diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp
index 3c8e93bdb79..8c741066979 100644
--- a/src/mongo/db/index_rebuilder.cpp
+++ b/src/mongo/db/index_rebuilder.cpp
@@ -51,6 +51,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::vector;
+
namespace {
void checkNS(OperationContext* txn, const std::list<std::string>& nsToCheck) {
bool firstTime = true;
diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp
index 3b7716ceb83..7dab5365d40 100644
--- a/src/mongo/db/initialize_server_global_state.cpp
+++ b/src/mongo/db/initialize_server_global_state.cpp
@@ -73,6 +73,10 @@ namespace fs = boost::filesystem;
namespace mongo {
+ using std::cerr;
+ using std::cout;
+ using std::endl;
+
#ifndef _WIN32
// support for exit value propagation with fork
void launchSignal( int sig ) {
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index 125ff0fe362..9fa8426e6ad 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -97,6 +97,14 @@ namespace mongo {
using boost::scoped_ptr;
using logger::LogComponent;
+ using std::auto_ptr;
+ using std::endl;
+ using std::hex;
+ using std::ios;
+ using std::ofstream;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
// for diaglog
inline void opread(Message& m) {
diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp
index 69389bb6ecf..eb6588c06ef 100644
--- a/src/mongo/db/introspect.cpp
+++ b/src/mongo/db/introspect.cpp
@@ -52,6 +52,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::string;
namespace {
void _appendUserInfo(const CurOp& c,
diff --git a/src/mongo/db/json.cpp b/src/mongo/db/json.cpp
index 2edca737b0b..9f418790ab7 100644
--- a/src/mongo/db/json.cpp
+++ b/src/mongo/db/json.cpp
@@ -44,6 +44,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::ostringstream;
+ using std::string;
#if 0
#define MONGO_JSON_DEBUG(message) log() << "JSON DEBUG @ " << __FILE__\
diff --git a/src/mongo/db/lasterror.cpp b/src/mongo/db/lasterror.cpp
index 70dd6ddb10c..5e2d34ed41e 100644
--- a/src/mongo/db/lasterror.cpp
+++ b/src/mongo/db/lasterror.cpp
@@ -39,6 +39,8 @@
namespace mongo {
+ using std::endl;
+
LastError LastError::noError;
LastErrorHolder lastError;
diff --git a/src/mongo/db/log_process_details.cpp b/src/mongo/db/log_process_details.cpp
index e20e726c9c0..d6898ef95e9 100644
--- a/src/mongo/db/log_process_details.cpp
+++ b/src/mongo/db/log_process_details.cpp
@@ -45,6 +45,9 @@
namespace mongo {
+ using std::cout;
+ using std::endl;
+
bool is32bit() {
return ( sizeof(int*) == 4 );
}
diff --git a/src/mongo/db/matcher/expression.cpp b/src/mongo/db/matcher/expression.cpp
index 098c049c6e8..e4778bb75d9 100644
--- a/src/mongo/db/matcher/expression.cpp
+++ b/src/mongo/db/matcher/expression.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::string;
+
MatchExpression::MatchExpression( MatchType type )
: _matchType( type ) { }
diff --git a/src/mongo/db/matcher/expression_array_test.cpp b/src/mongo/db/matcher/expression_array_test.cpp
index 626ac72409e..96a89254a34 100644
--- a/src/mongo/db/matcher/expression_array_test.cpp
+++ b/src/mongo/db/matcher/expression_array_test.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::auto_ptr;
+
TEST( ElemMatchObjectMatchExpression, MatchesElementSingle ) {
BSONObj baseOperand = BSON( "b" << 5 );
BSONObj match = BSON( "a" << BSON_ARRAY( BSON( "b" << 5.0 ) ) );
diff --git a/src/mongo/db/matcher/expression_geo_test.cpp b/src/mongo/db/matcher/expression_geo_test.cpp
index ab1546e012d..21ec6785b60 100644
--- a/src/mongo/db/matcher/expression_geo_test.cpp
+++ b/src/mongo/db/matcher/expression_geo_test.cpp
@@ -40,6 +40,8 @@
namespace mongo {
+ using std::auto_ptr;
+
TEST( ExpressionGeoTest, Geo1 ) {
BSONObj query = fromjson("{loc:{$within:{$box:[{x: 4, y:4},[6,6]]}}}");
diff --git a/src/mongo/db/matcher/expression_leaf_test.cpp b/src/mongo/db/matcher/expression_leaf_test.cpp
index b28f3f13713..ed2f7b259d9 100644
--- a/src/mongo/db/matcher/expression_leaf_test.cpp
+++ b/src/mongo/db/matcher/expression_leaf_test.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::string;
+
TEST( EqOp, MatchesElement ) {
BSONObj operand = BSON( "a" << 5 );
BSONObj match = BSON( "a" << 5.0 );
diff --git a/src/mongo/db/matcher/expression_parser.cpp b/src/mongo/db/matcher/expression_parser.cpp
index 8c7ac2e588f..40fd48e5ea2 100644
--- a/src/mongo/db/matcher/expression_parser.cpp
+++ b/src/mongo/db/matcher/expression_parser.cpp
@@ -63,6 +63,8 @@ namespace {
namespace mongo {
+ using std::string;
+
StatusWithMatchExpression MatchExpressionParser::_parseComparison( const char* name,
ComparisonMatchExpression* cmp,
const BSONElement& e ) {
diff --git a/src/mongo/db/matcher/expression_parser_array_test.cpp b/src/mongo/db/matcher/expression_parser_array_test.cpp
index 1d4bdf54ee8..e58bb4683d5 100644
--- a/src/mongo/db/matcher/expression_parser_array_test.cpp
+++ b/src/mongo/db/matcher/expression_parser_array_test.cpp
@@ -39,6 +39,8 @@
namespace mongo {
+ using std::string;
+
TEST( MatchExpressionParserArrayTest, Size1 ) {
BSONObj query = BSON( "x" << BSON( "$size" << 2 ) );
StatusWithMatchExpression result = MatchExpressionParser::parse( query );
diff --git a/src/mongo/db/matcher/expression_parser_geo.cpp b/src/mongo/db/matcher/expression_parser_geo.cpp
index 346b7a148d4..72145c029b1 100644
--- a/src/mongo/db/matcher/expression_parser_geo.cpp
+++ b/src/mongo/db/matcher/expression_parser_geo.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+ using std::auto_ptr;
+
StatusWithMatchExpression expressionParserGeoCallbackReal( const char* name,
int type,
const BSONObj& section ) {
diff --git a/src/mongo/db/matcher/expression_parser_leaf_test.cpp b/src/mongo/db/matcher/expression_parser_leaf_test.cpp
index 507b781fdd9..ad28bfd6641 100644
--- a/src/mongo/db/matcher/expression_parser_leaf_test.cpp
+++ b/src/mongo/db/matcher/expression_parser_leaf_test.cpp
@@ -42,6 +42,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
TEST( MatchExpressionParserLeafTest, SimpleEQ2 ) {
BSONObj query = BSON( "x" << BSON( "$eq" << 2 ) );
StatusWithMatchExpression result = MatchExpressionParser::parse( query );
diff --git a/src/mongo/db/matcher/expression_parser_text.cpp b/src/mongo/db/matcher/expression_parser_text.cpp
index 86b16e71130..ad8114c88e8 100644
--- a/src/mongo/db/matcher/expression_parser_text.cpp
+++ b/src/mongo/db/matcher/expression_parser_text.cpp
@@ -37,6 +37,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
StatusWithMatchExpression expressionParserTextCallbackReal( const BSONObj& queryObj ) {
// Validate queryObj, but defer construction of FTSQuery (which requires access to the
// target namespace) until stage building time.
diff --git a/src/mongo/db/matcher/expression_text.cpp b/src/mongo/db/matcher/expression_text.cpp
index c77217d2d10..760491b97c5 100644
--- a/src/mongo/db/matcher/expression_text.cpp
+++ b/src/mongo/db/matcher/expression_text.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::string;
+
Status TextMatchExpression::init( const string& query, const string& language ) {
_query = query;
_language = language;
diff --git a/src/mongo/db/matcher/expression_tree_test.cpp b/src/mongo/db/matcher/expression_tree_test.cpp
index c0ba4cead87..27516ff4344 100644
--- a/src/mongo/db/matcher/expression_tree_test.cpp
+++ b/src/mongo/db/matcher/expression_tree_test.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::auto_ptr;
+
TEST( NotMatchExpression, MatchesScalar ) {
BSONObj baseOperand = BSON( "$lt" << 5 );
auto_ptr<ComparisonMatchExpression> lt( new LTMatchExpression() );
diff --git a/src/mongo/db/matcher/expression_where.cpp b/src/mongo/db/matcher/expression_where.cpp
index f52d5c77f23..01a9e5b0aac 100644
--- a/src/mongo/db/matcher/expression_where.cpp
+++ b/src/mongo/db/matcher/expression_where.cpp
@@ -42,6 +42,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+
class WhereMatchExpression : public MatchExpression {
public:
WhereMatchExpression(OperationContext* txn)
diff --git a/src/mongo/db/matcher/expression_where_noop.cpp b/src/mongo/db/matcher/expression_where_noop.cpp
index 5347493f12c..af1fed42521 100644
--- a/src/mongo/db/matcher/expression_where_noop.cpp
+++ b/src/mongo/db/matcher/expression_where_noop.cpp
@@ -38,6 +38,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
/**
* Bogus no-op $where match expression to parse $where in mongos,
* since mongos doesn't have script engine to compile JS functions.
@@ -117,6 +120,7 @@ namespace mongo {
StatusWithMatchExpression WhereCallbackNoop::parseWhere(const BSONElement& where) const {
+
auto_ptr<WhereNoOpMatchExpression> exp( new WhereNoOpMatchExpression() );
if ( where.type() == String || where.type() == Code ) {
Status s = exp->init( where.valuestr() );
diff --git a/src/mongo/db/matcher/match_details.cpp b/src/mongo/db/matcher/match_details.cpp
index 1c437129adc..6adcfcdd910 100644
--- a/src/mongo/db/matcher/match_details.cpp
+++ b/src/mongo/db/matcher/match_details.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::string;
+
MatchDetails::MatchDetails() :
_elemMatchKeyRequested() {
resetOutput();
diff --git a/src/mongo/db/matcher/path_test.cpp b/src/mongo/db/matcher/path_test.cpp
index 3bd3b0f4568..12091c4749c 100644
--- a/src/mongo/db/matcher/path_test.cpp
+++ b/src/mongo/db/matcher/path_test.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+ using std::string;
+
TEST( Path, Root1 ) {
ElementPath p;
ASSERT( p.init( "a" ).isOK() );
diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp
index 09826f6c5ce..3fb50aa61a1 100644
--- a/src/mongo/db/mongod_options.cpp
+++ b/src/mongo/db/mongod_options.cpp
@@ -56,6 +56,10 @@
namespace mongo {
+ using std::cout;
+ using std::endl;
+ using std::string;
+
MongodGlobalParams mongodGlobalParams;
extern DiagLog _diaglog;
diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp
index afdb6f70c62..e1c3273d3ce 100644
--- a/src/mongo/db/namespace_string.cpp
+++ b/src/mongo/db/namespace_string.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
bool legalClientSystemNS( const StringData& ns , bool write ) {
if( ns == "local.system.replset" ) return true;
diff --git a/src/mongo/db/namespace_string_test.cpp b/src/mongo/db/namespace_string_test.cpp
index 0a062e28922..64ee9d230ae 100644
--- a/src/mongo/db/namespace_string_test.cpp
+++ b/src/mongo/db/namespace_string_test.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
TEST( NamespaceStringTest, Normal ) {
ASSERT( NamespaceString::normal( "a" ) );
ASSERT( NamespaceString::normal( "a.b" ) );
diff --git a/src/mongo/db/operation_context_impl.cpp b/src/mongo/db/operation_context_impl.cpp
index d8b4e443b27..5292caee5b5 100644
--- a/src/mongo/db/operation_context_impl.cpp
+++ b/src/mongo/db/operation_context_impl.cpp
@@ -45,6 +45,8 @@
namespace mongo {
+ using std::string;
+
OperationContextImpl::OperationContextImpl()
: _client(currentClient.get()),
_locker(_client->getLocker()) {
diff --git a/src/mongo/db/ops/insert.cpp b/src/mongo/db/ops/insert.cpp
index 22613fdaf04..131ebbc67b7 100644
--- a/src/mongo/db/ops/insert.cpp
+++ b/src/mongo/db/ops/insert.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
using namespace mongoutils;
StatusWith<BSONObj> fixDocumentForInsert( const BSONObj& doc ) {
diff --git a/src/mongo/db/ops/modifier_pull_all.cpp b/src/mongo/db/ops/modifier_pull_all.cpp
index 2a3cbb855eb..af595d6cd74 100644
--- a/src/mongo/db/ops/modifier_pull_all.cpp
+++ b/src/mongo/db/ops/modifier_pull_all.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::vector;
+
namespace mb = mutablebson;
namespace str = mongoutils::str;
diff --git a/src/mongo/db/ops/modifier_push.cpp b/src/mongo/db/ops/modifier_push.cpp
index f7b4d2285be..68b3ae82cff 100644
--- a/src/mongo/db/ops/modifier_push.cpp
+++ b/src/mongo/db/ops/modifier_push.cpp
@@ -44,6 +44,9 @@
namespace mongo {
+ using std::abs;
+ using std::numeric_limits;
+
namespace mb = mutablebson;
namespace str = mongoutils::str;
diff --git a/src/mongo/db/ops/modifier_table.cpp b/src/mongo/db/ops/modifier_table.cpp
index 31d4095160a..2f4f2bd418d 100644
--- a/src/mongo/db/ops/modifier_table.cpp
+++ b/src/mongo/db/ops/modifier_table.cpp
@@ -48,6 +48,10 @@
#include "mongo/platform/unordered_map.h"
namespace mongo {
+
+ using std::make_pair;
+ using std::string;
+
namespace modifiertable {
namespace {
diff --git a/src/mongo/db/ops/path_support.cpp b/src/mongo/db/ops/path_support.cpp
index fa72a4aceae..857a54c4b52 100644
--- a/src/mongo/db/ops/path_support.cpp
+++ b/src/mongo/db/ops/path_support.cpp
@@ -38,6 +38,7 @@
namespace mongo {
namespace pathsupport {
+ using std::string;
using mongoutils::str::stream;
namespace {
@@ -414,7 +415,7 @@ namespace pathsupport {
if (!status.isOK())
return status;
- equalities->insert(make_pair(eqChild.path(), &eqChild));
+ equalities->insert(std::make_pair(eqChild.path(), &eqChild));
}
else if (root.matchType() == MatchExpression::AND) {
diff --git a/src/mongo/db/ops/path_support_test.cpp b/src/mongo/db/ops/path_support_test.cpp
index 686d4b46094..f65cebabf6d 100644
--- a/src/mongo/db/ops/path_support_test.cpp
+++ b/src/mongo/db/ops/path_support_test.cpp
@@ -53,6 +53,7 @@ namespace {
using namespace mutablebson;
using namespace pathsupport;
using mongoutils::str::stream;
+ using std::auto_ptr;
using std::string;
class EmptyDoc : public mongo::unittest::Test {
diff --git a/src/mongo/db/ops/update_driver.cpp b/src/mongo/db/ops/update_driver.cpp
index d23a91a38f9..20a25d9c792 100644
--- a/src/mongo/db/ops/update_driver.cpp
+++ b/src/mongo/db/ops/update_driver.cpp
@@ -49,6 +49,9 @@ namespace mongo {
namespace mb = mongo::mutablebson;
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::vector;
+
using pathsupport::EqualityMatches;
UpdateDriver::UpdateDriver(const Options& opts)
diff --git a/src/mongo/db/pipeline/accumulator_add_to_set.cpp b/src/mongo/db/pipeline/accumulator_add_to_set.cpp
index b4003d17c9a..81ad8e85679 100644
--- a/src/mongo/db/pipeline/accumulator_add_to_set.cpp
+++ b/src/mongo/db/pipeline/accumulator_add_to_set.cpp
@@ -38,6 +38,7 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::vector;
void AccumulatorAddToSet::processInternal(const Value& input, bool merging) {
if (!merging) {
diff --git a/src/mongo/db/pipeline/accumulator_push.cpp b/src/mongo/db/pipeline/accumulator_push.cpp
index f2a62792252..b474acc940d 100644
--- a/src/mongo/db/pipeline/accumulator_push.cpp
+++ b/src/mongo/db/pipeline/accumulator_push.cpp
@@ -38,6 +38,7 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::vector;
void AccumulatorPush::processInternal(const Value& input, bool merging) {
if (!merging) {
diff --git a/src/mongo/db/pipeline/dependencies.cpp b/src/mongo/db/pipeline/dependencies.cpp
index 1b48ed2de12..063ac83725d 100644
--- a/src/mongo/db/pipeline/dependencies.cpp
+++ b/src/mongo/db/pipeline/dependencies.cpp
@@ -37,6 +37,11 @@
#include "mongo/util/mongoutils/str.h"
namespace mongo {
+
+ using std::set;
+ using std::string;
+ using std::vector;
+
namespace str = mongoutils::str;
BSONObj DepsTracker::toProjection() const {
diff --git a/src/mongo/db/pipeline/document.cpp b/src/mongo/db/pipeline/document.cpp
index 12315636b4d..432a15f55c8 100644
--- a/src/mongo/db/pipeline/document.cpp
+++ b/src/mongo/db/pipeline/document.cpp
@@ -43,6 +43,8 @@
namespace mongo {
using namespace mongoutils;
using boost::intrusive_ptr;
+ using std::string;
+ using std::vector;
Position DocumentStorage::findField(StringData requested) const {
int reqSize = requested.size(); // get size calculation out of the way if needed
diff --git a/src/mongo/db/pipeline/document_source.cpp b/src/mongo/db/pipeline/document_source.cpp
index 00a2b0a626d..d26cc5b1014 100644
--- a/src/mongo/db/pipeline/document_source.cpp
+++ b/src/mongo/db/pipeline/document_source.cpp
@@ -38,6 +38,7 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::vector;
DocumentSource::DocumentSource(const intrusive_ptr<ExpressionContext> &pCtx)
: pSource(NULL)
diff --git a/src/mongo/db/pipeline/document_source_command_shards.cpp b/src/mongo/db/pipeline/document_source_command_shards.cpp
index cdabe701d3e..12a12defd29 100644
--- a/src/mongo/db/pipeline/document_source_command_shards.cpp
+++ b/src/mongo/db/pipeline/document_source_command_shards.cpp
@@ -37,6 +37,7 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::vector;
void DocumentSourceCommandShards::setSource(DocumentSource *pSource) {
/* this doesn't take a source */
diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp
index 5c17b373a01..c2cd4ddb539 100644
--- a/src/mongo/db/pipeline/document_source_cursor.cpp
+++ b/src/mongo/db/pipeline/document_source_cursor.cpp
@@ -46,6 +46,7 @@ namespace mongo {
using boost::intrusive_ptr;
using boost::shared_ptr;
+ using std::string;
DocumentSourceCursor::~DocumentSourceCursor() {
dispose();
diff --git a/src/mongo/db/pipeline/document_source_geo_near.cpp b/src/mongo/db/pipeline/document_source_geo_near.cpp
index 36d2eb93d5c..b9615e87abe 100644
--- a/src/mongo/db/pipeline/document_source_geo_near.cpp
+++ b/src/mongo/db/pipeline/document_source_geo_near.cpp
@@ -37,6 +37,7 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::min;
char DocumentSourceGeoNear::geoNearName[] = "$geoNear";
const char *DocumentSourceGeoNear::getSourceName() const { return geoNearName; }
diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp
index 42116be2be3..b5a4443f609 100644
--- a/src/mongo/db/pipeline/document_source_group.cpp
+++ b/src/mongo/db/pipeline/document_source_group.cpp
@@ -44,6 +44,8 @@ namespace mongo {
using boost::intrusive_ptr;
using boost::shared_ptr;
+ using std::pair;
+ using std::vector;
const char DocumentSourceGroup::groupName[] = "$group";
diff --git a/src/mongo/db/pipeline/document_source_match.cpp b/src/mongo/db/pipeline/document_source_match.cpp
index b68b998e8a5..95b707e949a 100644
--- a/src/mongo/db/pipeline/document_source_match.cpp
+++ b/src/mongo/db/pipeline/document_source_match.cpp
@@ -43,6 +43,8 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::string;
+ using std::vector;
const char DocumentSourceMatch::matchName[] = "$match";
diff --git a/src/mongo/db/pipeline/document_source_merge_cursors.cpp b/src/mongo/db/pipeline/document_source_merge_cursors.cpp
index ca21082da7e..d5d3ce1bf1e 100644
--- a/src/mongo/db/pipeline/document_source_merge_cursors.cpp
+++ b/src/mongo/db/pipeline/document_source_merge_cursors.cpp
@@ -38,6 +38,9 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::make_pair;
+ using std::string;
+ using std::vector;
const char DocumentSourceMergeCursors::name[] = "$mergeCursors";
diff --git a/src/mongo/db/pipeline/document_source_out.cpp b/src/mongo/db/pipeline/document_source_out.cpp
index 93990b19260..b046ebe8d53 100644
--- a/src/mongo/db/pipeline/document_source_out.cpp
+++ b/src/mongo/db/pipeline/document_source_out.cpp
@@ -36,6 +36,7 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::vector;
const char DocumentSourceOut::outName[] = "$out";
diff --git a/src/mongo/db/pipeline/document_source_project.cpp b/src/mongo/db/pipeline/document_source_project.cpp
index 8dc3136524f..78e661f44ff 100644
--- a/src/mongo/db/pipeline/document_source_project.cpp
+++ b/src/mongo/db/pipeline/document_source_project.cpp
@@ -42,6 +42,8 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::string;
+ using std::vector;
const char DocumentSourceProject::projectName[] = "$project";
diff --git a/src/mongo/db/pipeline/document_source_redact.cpp b/src/mongo/db/pipeline/document_source_redact.cpp
index fd166d7cf0b..21046432156 100644
--- a/src/mongo/db/pipeline/document_source_redact.cpp
+++ b/src/mongo/db/pipeline/document_source_redact.cpp
@@ -43,6 +43,7 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::vector;
const char DocumentSourceRedact::redactName[] = "$redact";
diff --git a/src/mongo/db/pipeline/document_source_sort.cpp b/src/mongo/db/pipeline/document_source_sort.cpp
index 2af962abafe..0a1ea7a82bf 100644
--- a/src/mongo/db/pipeline/document_source_sort.cpp
+++ b/src/mongo/db/pipeline/document_source_sort.cpp
@@ -46,6 +46,9 @@ namespace mongo {
using boost::intrusive_ptr;
using boost::scoped_ptr;
+ using std::make_pair;
+ using std::string;
+ using std::vector;
const char DocumentSourceSort::sortName[] = "$sort";
diff --git a/src/mongo/db/pipeline/document_source_unwind.cpp b/src/mongo/db/pipeline/document_source_unwind.cpp
index 687d815abb4..b94a15e4e2d 100644
--- a/src/mongo/db/pipeline/document_source_unwind.cpp
+++ b/src/mongo/db/pipeline/document_source_unwind.cpp
@@ -40,6 +40,8 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::string;
+ using std::vector;
/** Helper class to unwind array from a single document. */
class DocumentSourceUnwind::Unwinder {
diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp
index ed0c8cbde12..5d61245b8ec 100644
--- a/src/mongo/db/pipeline/expression.cpp
+++ b/src/mongo/db/pipeline/expression.cpp
@@ -48,7 +48,11 @@
namespace mongo {
using namespace mongoutils;
+
using boost::intrusive_ptr;
+ using std::set;
+ using std::string;
+ using std::vector;
/// Helper function to easily wrap constants with $const.
static Value serializeConstant(Value val) {
diff --git a/src/mongo/db/pipeline/field_path.cpp b/src/mongo/db/pipeline/field_path.cpp
index bbb6dd9b5f8..d68bc2e2fc7 100644
--- a/src/mongo/db/pipeline/field_path.cpp
+++ b/src/mongo/db/pipeline/field_path.cpp
@@ -37,6 +37,11 @@
namespace mongo {
+ using std::ostream;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
using namespace mongoutils;
const char FieldPath::prefix[] = "$";
diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp
index 8dd7d9e0267..6b38dec714d 100644
--- a/src/mongo/db/pipeline/pipeline.cpp
+++ b/src/mongo/db/pipeline/pipeline.cpp
@@ -49,6 +49,10 @@
namespace mongo {
using boost::intrusive_ptr;
+ using std::endl;
+ using std::ostringstream;
+ using std::string;
+ using std::vector;
const char Pipeline::commandName[] = "aggregate";
const char Pipeline::pipelineName[] = "pipeline";
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp
index 21c075ba1c6..b11e0ede71e 100644
--- a/src/mongo/db/pipeline/pipeline_d.cpp
+++ b/src/mongo/db/pipeline/pipeline_d.cpp
@@ -47,6 +47,7 @@ namespace mongo {
using boost::intrusive_ptr;
using boost::shared_ptr;
+ using std::string;
namespace {
class MongodImplementation : public DocumentSourceNeedsMongod::MongodInterface {
diff --git a/src/mongo/db/pipeline/value.cpp b/src/mongo/db/pipeline/value.cpp
index 22fb3d90fd0..9077c49b5d6 100644
--- a/src/mongo/db/pipeline/value.cpp
+++ b/src/mongo/db/pipeline/value.cpp
@@ -44,6 +44,12 @@
namespace mongo {
using namespace mongoutils;
using boost::intrusive_ptr;
+ using std::min;
+ using std::numeric_limits;
+ using std::ostream;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
void ValueStorage::verifyRefCountingIfShould() const {
switch (type) {
@@ -620,7 +626,7 @@ namespace mongo {
const vector<Value>& lArr = rL.getArray();
const vector<Value>& rArr = rR.getArray();
- const size_t elems = min(lArr.size(), rArr.size());
+ const size_t elems = std::min(lArr.size(), rArr.size());
for (size_t i = 0; i < elems; i++ ) {
// compare the two corresponding elements
ret = Value::compare(lArr[i], rArr[i]);
diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp
index f25c73da946..1de1d565c47 100644
--- a/src/mongo/db/prefetch.cpp
+++ b/src/mongo/db/prefetch.cpp
@@ -47,6 +47,10 @@
#include "mongo/util/mmap.h"
namespace mongo {
+
+ using std::endl;
+ using std::string;
+
namespace repl {
namespace {
// todo / idea: the prefetcher, when it fetches _id, on an upsert, will see if the record exists. if it does not,
diff --git a/src/mongo/db/projection.cpp b/src/mongo/db/projection.cpp
index 1e13dae4e30..abdba593da1 100644
--- a/src/mongo/db/projection.cpp
+++ b/src/mongo/db/projection.cpp
@@ -43,6 +43,10 @@
namespace mongo {
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::max;
+ using std::string;
void Projection::init(const BSONObj& o,
const MatchExpressionParser::WhereCallback& whereCallback) {
diff --git a/src/mongo/db/query/canonical_query_test.cpp b/src/mongo/db/query/canonical_query_test.cpp
index 73127fbd34f..af3f705ca05 100644
--- a/src/mongo/db/query/canonical_query_test.cpp
+++ b/src/mongo/db/query/canonical_query_test.cpp
@@ -35,6 +35,9 @@ using namespace mongo;
namespace {
+ using std::auto_ptr;
+ using std::string;
+
static const char* ns = "somebogusns";
/**
diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp
index ecce742a307..40b091cdc87 100644
--- a/src/mongo/db/query/explain.cpp
+++ b/src/mongo/db/query/explain.cpp
@@ -49,6 +49,9 @@ namespace {
using namespace mongo;
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
/**
* Traverse the tree rooted at 'root', and add all tree nodes into the list 'flattened'.
diff --git a/src/mongo/db/query/expression_index.cpp b/src/mongo/db/query/expression_index.cpp
index 13cd25e07b0..51cc439da23 100644
--- a/src/mongo/db/query/expression_index.cpp
+++ b/src/mongo/db/query/expression_index.cpp
@@ -39,6 +39,8 @@
namespace mongo {
+ using std::set;
+
BSONObj ExpressionMapping::hash(const BSONElement& value) {
BSONObjBuilder bob;
bob.append("", BSONElementHasher::hash64(value, BSONElementHasher::DEFAULT_HASH_SEED));
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index 74e58268b68..7e176e2c7f5 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -63,6 +63,8 @@
#include "mongo/util/mongoutils/str.h"
using boost::scoped_ptr;
+using std::auto_ptr;
+using std::endl;
namespace mongo {
// The .h for this in find_constants.h.
diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp
index 7e3b6087998..32fe3525c75 100644
--- a/src/mongo/db/query/get_executor.cpp
+++ b/src/mongo/db/query/get_executor.cpp
@@ -74,6 +74,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
// static
void filterAllowedIndexEntries(const AllowedIndices& allowedIndices,
std::vector<IndexEntry>* indexEntries) {
diff --git a/src/mongo/db/query/index_bounds.cpp b/src/mongo/db/query/index_bounds.cpp
index 664b2245613..b88bbe67f42 100644
--- a/src/mongo/db/query/index_bounds.cpp
+++ b/src/mongo/db/query/index_bounds.cpp
@@ -33,6 +33,7 @@
namespace mongo {
+ using std::string;
using std::vector;
namespace {
diff --git a/src/mongo/db/query/index_bounds_builder_test.cpp b/src/mongo/db/query/index_bounds_builder_test.cpp
index 92231ba7a32..accf74f06fa 100644
--- a/src/mongo/db/query/index_bounds_builder_test.cpp
+++ b/src/mongo/db/query/index_bounds_builder_test.cpp
@@ -43,6 +43,9 @@ using namespace mongo;
namespace {
using std::auto_ptr;
+ using std::numeric_limits;
+ using std::string;
+ using std::vector;
double numberMin = -numeric_limits<double>::max();
double numberMax = numeric_limits<double>::max();
diff --git a/src/mongo/db/query/interval.cpp b/src/mongo/db/query/interval.cpp
index c42feefa2c2..cdbb7abbb6d 100644
--- a/src/mongo/db/query/interval.cpp
+++ b/src/mongo/db/query/interval.cpp
@@ -30,6 +30,8 @@
namespace mongo {
+ using std::string;
+
Interval::Interval()
: _intervalData(BSONObj()), start(BSONElement()), startInclusive(false), end(BSONElement()),
endInclusive(false) { }
diff --git a/src/mongo/db/query/lite_parsed_query.cpp b/src/mongo/db/query/lite_parsed_query.cpp
index d002850122b..dae741b59c1 100644
--- a/src/mongo/db/query/lite_parsed_query.cpp
+++ b/src/mongo/db/query/lite_parsed_query.cpp
@@ -36,6 +36,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
const string LiteParsedQuery::cmdOptionMaxTimeMS("maxTimeMS");
const string LiteParsedQuery::queryOptionMaxTimeMS("$maxTimeMS");
diff --git a/src/mongo/db/query/parsed_projection.cpp b/src/mongo/db/query/parsed_projection.cpp
index 0fa92ed8951..c18ddd4135e 100644
--- a/src/mongo/db/query/parsed_projection.cpp
+++ b/src/mongo/db/query/parsed_projection.cpp
@@ -32,6 +32,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
/**
* Parses the projection 'spec' and checks its validity with respect to the query 'query'.
* Puts covering information into 'out'.
diff --git a/src/mongo/db/query/plan_cache.cpp b/src/mongo/db/query/plan_cache.cpp
index bc3fff29458..d1b16dc209c 100644
--- a/src/mongo/db/query/plan_cache.cpp
+++ b/src/mongo/db/query/plan_cache.cpp
@@ -47,6 +47,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
//
// Cache-related functions for CanonicalQuery
//
diff --git a/src/mongo/db/query/plan_cache_test.cpp b/src/mongo/db/query/plan_cache_test.cpp
index 19b44fd46a5..e10f112134a 100644
--- a/src/mongo/db/query/plan_cache_test.cpp
+++ b/src/mongo/db/query/plan_cache_test.cpp
@@ -54,6 +54,8 @@ namespace {
using boost::scoped_ptr;
using std::auto_ptr;
+ using std::string;
+ using std::vector;
static const char* ns = "somebogusns";
diff --git a/src/mongo/db/query/plan_enumerator.cpp b/src/mongo/db/query/plan_enumerator.cpp
index ae485a7386f..7f60f5d1eaf 100644
--- a/src/mongo/db/query/plan_enumerator.cpp
+++ b/src/mongo/db/query/plan_enumerator.cpp
@@ -40,6 +40,11 @@
namespace {
using namespace mongo;
+ using std::auto_ptr;
+ using std::endl;
+ using std::set;
+ using std::string;
+ using std::vector;
std::string getPathPrefix(std::string path) {
if (mongoutils::str::contains(path, '.')) {
diff --git a/src/mongo/db/query/plan_executor.cpp b/src/mongo/db/query/plan_executor.cpp
index 2a9e1009aad..cb1c5fcb19e 100644
--- a/src/mongo/db/query/plan_executor.cpp
+++ b/src/mongo/db/query/plan_executor.cpp
@@ -47,6 +47,8 @@
namespace mongo {
using boost::shared_ptr;
+ using std::string;
+ using std::vector;
namespace {
diff --git a/src/mongo/db/query/plan_ranker.cpp b/src/mongo/db/query/plan_ranker.cpp
index 12c9bfef5b7..54075c2f16a 100644
--- a/src/mongo/db/query/plan_ranker.cpp
+++ b/src/mongo/db/query/plan_ranker.cpp
@@ -63,6 +63,7 @@ namespace {
namespace mongo {
+ using std::endl;
using std::vector;
// static
diff --git a/src/mongo/db/query/planner_access.cpp b/src/mongo/db/query/planner_access.cpp
index 0e73da652cf..bb79362aad3 100644
--- a/src/mongo/db/query/planner_access.cpp
+++ b/src/mongo/db/query/planner_access.cpp
@@ -60,6 +60,7 @@ namespace {
namespace mongo {
+ using std::auto_ptr;
using std::vector;
// static
diff --git a/src/mongo/db/query/planner_analysis.cpp b/src/mongo/db/query/planner_analysis.cpp
index a1ba92b8c70..24f5af7279b 100644
--- a/src/mongo/db/query/planner_analysis.cpp
+++ b/src/mongo/db/query/planner_analysis.cpp
@@ -37,6 +37,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
//
// Helpers for bounds explosion AKA quick-and-dirty SERVER-1205.
//
diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp
index 8f5880ab467..324cdbd07dd 100644
--- a/src/mongo/db/query/query_planner.cpp
+++ b/src/mongo/db/query/query_planner.cpp
@@ -50,6 +50,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::numeric_limits;
+
// Copied verbatim from db/index.h
static bool isIdIndex( const BSONObj &pattern ) {
BSONObjIterator i(pattern);
diff --git a/src/mongo/db/query/query_planner_test.cpp b/src/mongo/db/query/query_planner_test.cpp
index cb493541032..5f67c114a99 100644
--- a/src/mongo/db/query/query_planner_test.cpp
+++ b/src/mongo/db/query/query_planner_test.cpp
@@ -49,6 +49,10 @@ using namespace mongo;
namespace {
+ using std::map;
+ using std::string;
+ using std::vector;
+
static const char* ns = "somebogusns";
class QueryPlannerTest : public mongo::unittest::Test {
diff --git a/src/mongo/db/query/query_planner_test_lib.cpp b/src/mongo/db/query/query_planner_test_lib.cpp
index a95f406721e..cf315f2908a 100644
--- a/src/mongo/db/query/query_planner_test_lib.cpp
+++ b/src/mongo/db/query/query_planner_test_lib.cpp
@@ -46,6 +46,8 @@ namespace {
using namespace mongo;
+ using std::string;
+
bool filterMatches(const BSONObj& testFilter,
const QuerySolutionNode* trueFilterNode) {
if (NULL == trueFilterNode->filter) { return false; }
diff --git a/src/mongo/db/query/query_planner_text_test.cpp b/src/mongo/db/query/query_planner_text_test.cpp
index 422163fb72a..f88f9bb16dc 100644
--- a/src/mongo/db/query/query_planner_text_test.cpp
+++ b/src/mongo/db/query/query_planner_text_test.cpp
@@ -44,6 +44,10 @@
#include "mongo/util/assert_util.h"
using namespace mongo;
+using std::cout;
+using std::endl;
+using std::string;
+using std::vector;
namespace {
diff --git a/src/mongo/db/query/query_solution.cpp b/src/mongo/db/query/query_solution.cpp
index 7b11ade8dbc..877e58612c3 100644
--- a/src/mongo/db/query/query_solution.cpp
+++ b/src/mongo/db/query/query_solution.cpp
@@ -35,6 +35,8 @@
namespace mongo {
+ using std::set;
+
string QuerySolutionNode::toString() const {
mongoutils::str::stream ss;
appendToString(&ss, 0);
diff --git a/src/mongo/db/query/stage_builder.cpp b/src/mongo/db/query/stage_builder.cpp
index 549a8f461d9..097b4f71e61 100644
--- a/src/mongo/db/query/stage_builder.cpp
+++ b/src/mongo/db/query/stage_builder.cpp
@@ -55,6 +55,8 @@
namespace mongo {
+ using std::auto_ptr;
+
PlanStage* buildStages(OperationContext* txn,
Collection* collection,
const QuerySolution& qsol,
diff --git a/src/mongo/db/range_deleter.cpp b/src/mongo/db/range_deleter.cpp
index 02a2dc02da9..28e8ab08e94 100644
--- a/src/mongo/db/range_deleter.cpp
+++ b/src/mongo/db/range_deleter.cpp
@@ -46,6 +46,7 @@
#include "mongo/util/timer.h"
using std::auto_ptr;
+using std::endl;
using std::set;
using std::pair;
using std::string;
@@ -413,7 +414,7 @@ namespace {
stats->reserve(kDeleteJobsHistory);
scoped_lock sl(_statsHistoryMutex);
- for (deque<DeleteJobStats*>::const_iterator it = _statsHistory.begin();
+ for (std::deque<DeleteJobStats*>::const_iterator it = _statsHistory.begin();
it != _statsHistory.end(); ++it) {
stats->push_back(new DeleteJobStats(**it));
}
diff --git a/src/mongo/db/range_deleter_db_env.cpp b/src/mongo/db/range_deleter_db_env.cpp
index b79f0dbb714..25f3ce65ed4 100644
--- a/src/mongo/db/range_deleter_db_env.cpp
+++ b/src/mongo/db/range_deleter_db_env.cpp
@@ -45,6 +45,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
void RangeDeleterDBEnv::initThread() {
if ( currentClient.get() == NULL )
Client::initThread( "RangeDeleter" );
diff --git a/src/mongo/db/range_deleter_mock_env.cpp b/src/mongo/db/range_deleter_mock_env.cpp
index 4e51da8a50b..d4d8ad17112 100644
--- a/src/mongo/db/range_deleter_mock_env.cpp
+++ b/src/mongo/db/range_deleter_mock_env.cpp
@@ -33,6 +33,9 @@
namespace mongo {
+ using std::set;
+ using std::string;
+
bool DeletedRangeCmp::operator()(const DeletedRange& lhs,
const DeletedRange& rhs) const {
const int nsComp = lhs.ns.compare(rhs.ns);
diff --git a/src/mongo/db/repair_database.cpp b/src/mongo/db/repair_database.cpp
index 6dab35b1fbb..26f4dc5382e 100644
--- a/src/mongo/db/repair_database.cpp
+++ b/src/mongo/db/repair_database.cpp
@@ -50,6 +50,10 @@
#include "mongo/util/log.h"
namespace mongo {
+
+ using std::endl;
+ using std::string;
+
namespace {
Status rebuildIndexesOnCollection(OperationContext* txn,
DatabaseCatalogEntry* dbce,
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index 8b4166a7476..9a1a10ddd8c 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -51,6 +51,8 @@
namespace mongo {
+ using std::string;
+
namespace repl {
namespace {
diff --git a/src/mongo/db/repl/isself_test.cpp b/src/mongo/db/repl/isself_test.cpp
index b54f32c0b9f..b3af1721e62 100644
--- a/src/mongo/db/repl/isself_test.cpp
+++ b/src/mongo/db/repl/isself_test.cpp
@@ -40,6 +40,8 @@ namespace repl {
namespace {
+ using std::string;
+
TEST(IsSelf, DetectsSameHostIPv4) {
#if defined(_WIN32) || defined(__linux__) || defined(__APPLE__)
bool wasEnabled = IPv6Enabled();
diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
index cdc2b77d867..bc527e3935c 100644
--- a/src/mongo/db/repl/master_slave.cpp
+++ b/src/mongo/db/repl/master_slave.cpp
@@ -69,6 +69,14 @@
#include "mongo/util/log.h"
using boost::scoped_ptr;
+using std::auto_ptr;
+using std::cout;
+using std::endl;
+using std::max;
+using std::min;
+using std::set;
+using std::stringstream;
+using std::vector;
namespace mongo {
namespace repl {
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index b7cb638e335..65579567d2d 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -70,6 +70,10 @@
#include "mongo/util/startup_test.h"
namespace mongo {
+
+ using std::endl;
+ using std::stringstream;
+
namespace repl {
namespace {
diff --git a/src/mongo/db/repl/oplogreader.cpp b/src/mongo/db/repl/oplogreader.cpp
index 0f10e516963..a3d2bca8e7f 100644
--- a/src/mongo/db/repl/oplogreader.cpp
+++ b/src/mongo/db/repl/oplogreader.cpp
@@ -53,6 +53,8 @@
namespace mongo {
using boost::shared_ptr;
+ using std::endl;
+ using std::string;
namespace repl {
diff --git a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp
index 3b4fe4ac8a0..71003ab4fec 100644
--- a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp
+++ b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp
@@ -39,6 +39,7 @@ namespace repl {
namespace {
using boost::scoped_ptr;
+ using std::auto_ptr;
bool stringContains(const std::string &haystack, const std::string& needle) {
return haystack.find(needle) != std::string::npos;
diff --git a/src/mongo/db/repl/repl_set_seed_list.cpp b/src/mongo/db/repl/repl_set_seed_list.cpp
index aef6277eb46..861a2398711 100644
--- a/src/mongo/db/repl/repl_set_seed_list.cpp
+++ b/src/mongo/db/repl/repl_set_seed_list.cpp
@@ -40,6 +40,8 @@ namespace mongo {
namespace repl {
+ using std::string;
+
/** @param cfgString <setname>/<seedhost1>,<seedhost2> */
void parseReplSetSeedList(ReplicationCoordinatorExternalState* externalState,
const std::string& cfgString,
diff --git a/src/mongo/db/repl/replication_coordinator_mock.cpp b/src/mongo/db/repl/replication_coordinator_mock.cpp
index ef8bebcf235..6b806b46719 100644
--- a/src/mongo/db/repl/replication_coordinator_mock.cpp
+++ b/src/mongo/db/repl/replication_coordinator_mock.cpp
@@ -37,6 +37,8 @@
namespace mongo {
namespace repl {
+ using std::vector;
+
ReplicationCoordinatorMock::ReplicationCoordinatorMock(const ReplSettings& settings) :
_settings(settings) {}
ReplicationCoordinatorMock::~ReplicationCoordinatorMock() {}
diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp
index 4559424cac7..cf7ff0faabb 100644
--- a/src/mongo/db/repl/replication_info.cpp
+++ b/src/mongo/db/repl/replication_info.cpp
@@ -48,6 +48,12 @@
#include "mongo/s/write_ops/batched_command_request.h"
namespace mongo {
+
+ using std::auto_ptr;
+ using std::list;
+ using std::string;
+ using std::stringstream;
+
namespace repl {
void appendReplicationInfo(OperationContext* txn, BSONObjBuilder& result, int level) {
diff --git a/src/mongo/db/repl/replset_commands.cpp b/src/mongo/db/repl/replset_commands.cpp
index 1821e55e98b..a46ab9b474b 100644
--- a/src/mongo/db/repl/replset_commands.cpp
+++ b/src/mongo/db/repl/replset_commands.cpp
@@ -60,6 +60,10 @@
namespace mongo {
namespace repl {
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
unsigned replSetForceInitialSyncFailure = 0;
// Testing only, enabled via command-line.
diff --git a/src/mongo/db/repl/resync.cpp b/src/mongo/db/repl/resync.cpp
index d2039fcd4e5..16e385c9b48 100644
--- a/src/mongo/db/repl/resync.cpp
+++ b/src/mongo/db/repl/resync.cpp
@@ -34,6 +34,10 @@
#include "mongo/db/operation_context.h"
namespace mongo {
+
+ using std::string;
+ using std::stringstream;
+
namespace repl {
// operator requested resynchronization of replication (on a slave or secondary). {resync: 1}
diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp
index b33d096a167..c1fa5efe18d 100644
--- a/src/mongo/db/repl/rs_initialsync.cpp
+++ b/src/mongo/db/repl/rs_initialsync.cpp
@@ -55,6 +55,9 @@ namespace mongo {
namespace repl {
namespace {
+ using std::list;
+ using std::string;
+
/**
* Truncates the oplog (removes any documents) and resets internal variables that were
* originally initialized or affected by using values from the oplog at startup time. These
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp
index 30e5863f397..aa8a8facfec 100644
--- a/src/mongo/db/repl/rs_rollback.cpp
+++ b/src/mongo/db/repl/rs_rollback.cpp
@@ -97,6 +97,13 @@
namespace mongo {
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::pair;
namespace repl {
namespace {
diff --git a/src/mongo/db/repl/sync.cpp b/src/mongo/db/repl/sync.cpp
index 0530c719eac..bdfc676a63f 100644
--- a/src/mongo/db/repl/sync.cpp
+++ b/src/mongo/db/repl/sync.cpp
@@ -45,6 +45,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
namespace repl {
void Sync::setHostname(const string& hostname) {
diff --git a/src/mongo/db/repl/sync_source_feedback.cpp b/src/mongo/db/repl/sync_source_feedback.cpp
index 6f606e2fe24..57c747163e5 100644
--- a/src/mongo/db/repl/sync_source_feedback.cpp
+++ b/src/mongo/db/repl/sync_source_feedback.cpp
@@ -50,6 +50,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
namespace repl {
// used in replAuthenticate
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp
index 966bf144136..5b72fc86d1a 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -59,6 +59,8 @@
namespace mongo {
+ using std::endl;
+
namespace repl {
#if defined(MONGO_PLATFORM_64)
const int replWriterThreadCount = 16;
@@ -143,7 +145,7 @@ namespace repl {
// equal numbers and is still likely to be different for different numbers.
const double dbl = elem.numberDouble();
if (isNaN(dbl)) {
- boost::hash_combine(hash, numeric_limits<double>::quiet_NaN());
+ boost::hash_combine(hash, std::numeric_limits<double>::quiet_NaN());
}
else {
boost::hash_combine(hash, dbl);
diff --git a/src/mongo/db/repl/topology_coordinator_impl.cpp b/src/mongo/db/repl/topology_coordinator_impl.cpp
index ff83fee57fc..e624fb2407e 100644
--- a/src/mongo/db/repl/topology_coordinator_impl.cpp
+++ b/src/mongo/db/repl/topology_coordinator_impl.cpp
@@ -51,6 +51,8 @@
namespace mongo {
namespace repl {
+ using std::vector;
+
const Seconds TopologyCoordinatorImpl::LastVote::leaseTime = Seconds(30);
namespace {
diff --git a/src/mongo/db/restapi.cpp b/src/mongo/db/restapi.cpp
index e4e6a561757..db6f7b6db7e 100644
--- a/src/mongo/db/restapi.cpp
+++ b/src/mongo/db/restapi.cpp
@@ -57,6 +57,12 @@ namespace mongo {
bool getInitialSyncCompleted();
+ using std::auto_ptr;
+ using std::string;
+ using std::stringstream;
+ using std::endl;
+ using std::vector;
+
using namespace html;
class RESTHandler : public DbWebHandler {
diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp
index d13f74b03f3..38b7d87ee74 100644
--- a/src/mongo/db/server_options_helpers.cpp
+++ b/src/mongo/db/server_options_helpers.cpp
@@ -55,6 +55,7 @@
#include "mongo/util/net/ssl_options.h"
#include "mongo/util/options_parser/startup_options.h"
+using std::endl;
using std::string;
namespace mongo {
diff --git a/src/mongo/db/server_parameters.cpp b/src/mongo/db/server_parameters.cpp
index fefdee6f4a1..f57c8750678 100644
--- a/src/mongo/db/server_parameters.cpp
+++ b/src/mongo/db/server_parameters.cpp
@@ -39,6 +39,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
namespace {
ServerParameterSet* GLOBAL = NULL;
}
diff --git a/src/mongo/db/server_parameters_test.cpp b/src/mongo/db/server_parameters_test.cpp
index c2a6f56156c..6e74cde215d 100644
--- a/src/mongo/db/server_parameters_test.cpp
+++ b/src/mongo/db/server_parameters_test.cpp
@@ -35,6 +35,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
TEST( ServerParameters, Simple1 ) {
int f = 5;
ExportedServerParameter<int> ff( NULL, "ff", &f, true, true );
diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp
index d3225a5ef4e..8cb5048c2fc 100644
--- a/src/mongo/db/sorter/sorter.cpp
+++ b/src/mongo/db/sorter/sorter.cpp
@@ -114,7 +114,7 @@ namespace mongo {
/** Ensures a named file is deleted when this object goes out of scope */
class FileDeleter {
public:
- FileDeleter(const string& fileName) :_fileName(fileName) {}
+ FileDeleter(const std::string& fileName) :_fileName(fileName) {}
~FileDeleter() {
DESTRUCTOR_GUARD(
boost::filesystem::remove(_fileName);
@@ -160,7 +160,7 @@ namespace mongo {
> Settings;
typedef std::pair<Key, Value> Data;
- FileIterator(const string& fileName,
+ FileIterator(const std::string& fileName,
const Settings& settings,
boost::shared_ptr<FileDeleter> fileDeleter)
: _settings(settings)
@@ -257,7 +257,7 @@ namespace mongo {
bool _done;
boost::scoped_array<char> _buffer;
boost::scoped_ptr<BufReader> _reader;
- string _fileName;
+ std::string _fileName;
boost::shared_ptr<FileDeleter> _fileDeleter; // Must outlive _file
std::ifstream _file;
};
@@ -274,7 +274,7 @@ namespace mongo {
const SortOptions& opts,
const Comparator& comp)
: _opts(opts)
- , _remaining(opts.limit ? opts.limit : numeric_limits<unsigned long long>::max())
+ , _remaining(opts.limit ? opts.limit : std::numeric_limits<unsigned long long>::max())
, _first(true)
, _greater(comp)
{
diff --git a/src/mongo/db/sorter/sorter_test.cpp b/src/mongo/db/sorter/sorter_test.cpp
index fb4cdf8a8c0..fdab37d69b8 100644
--- a/src/mongo/db/sorter/sorter_test.cpp
+++ b/src/mongo/db/sorter/sorter_test.cpp
@@ -45,6 +45,7 @@
namespace mongo {
using namespace mongo::sorter;
using boost::make_shared;
+ using std::pair;
// Stub to avoid including the server_options library
// TODO: This should go away once we can do these checks at compile time
diff --git a/src/mongo/db/startup_warnings_mongod.cpp b/src/mongo/db/startup_warnings_mongod.cpp
index abcf096f3c3..e81ed1f24b3 100644
--- a/src/mongo/db/startup_warnings_mongod.cpp
+++ b/src/mongo/db/startup_warnings_mongod.cpp
@@ -46,6 +46,9 @@
namespace mongo {
+ using std::ios_base;
+ using std::string;
+
void logMongodStartupWarnings() {
logCommonStartupWarnings();
diff --git a/src/mongo/db/stats/counters.cpp b/src/mongo/db/stats/counters.cpp
index 87a3d462e9d..78b3178be2f 100644
--- a/src/mongo/db/stats/counters.cpp
+++ b/src/mongo/db/stats/counters.cpp
@@ -40,6 +40,9 @@
#include "mongo/util/log.h"
namespace mongo {
+
+ using std::endl;
+
OpCounters::OpCounters() {}
void OpCounters::incInsertInWriteLock(int n) {
diff --git a/src/mongo/db/stats/snapshots.cpp b/src/mongo/db/stats/snapshots.cpp
index 8cfac6860fa..f36bce434c2 100644
--- a/src/mongo/db/stats/snapshots.cpp
+++ b/src/mongo/db/stats/snapshots.cpp
@@ -47,6 +47,9 @@
*/
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+
void SnapshotData::takeSnapshot() {
_created = curTimeMicros64();
Top::global.cloneMap(_usage);
diff --git a/src/mongo/db/stats/snapshots_webplugins.cpp b/src/mongo/db/stats/snapshots_webplugins.cpp
index 53dd5896e70..281ed1dbf5c 100644
--- a/src/mongo/db/stats/snapshots_webplugins.cpp
+++ b/src/mongo/db/stats/snapshots_webplugins.cpp
@@ -38,6 +38,12 @@ namespace {
using namespace html;
+ using std::auto_ptr;
+ using std::fixed;
+ using std::setprecision;
+ using std::string;
+ using std::stringstream;
+
class WriteLockStatus : public WebStatusPlugin {
public:
WriteLockStatus() : WebStatusPlugin( "write lock" , 51 , "% time in write lock, by 4 sec periods" ) {}
diff --git a/src/mongo/db/stats/top.cpp b/src/mongo/db/stats/top.cpp
index 7c1be88a76b..a95f1ae7dc6 100644
--- a/src/mongo/db/stats/top.cpp
+++ b/src/mongo/db/stats/top.cpp
@@ -46,6 +46,11 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
Top::UsageData::UsageData( const UsageData& older, const UsageData& newer ) {
// this won't be 100% accurate on rollovers and drop(), but at least it won't be negative
time = (newer.time >= older.time) ? (newer.time - older.time) : newer.time;
diff --git a/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp b/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp
index 3260b9ab391..ea303575bf5 100644
--- a/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp
+++ b/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp
@@ -44,6 +44,8 @@
namespace mongo {
using boost::shared_ptr;
+ using std::string;
+ using std::vector;
namespace {
diff --git a/src/mongo/db/storage/key_string.cpp b/src/mongo/db/storage/key_string.cpp
index 4089525cb3c..381d7795abf 100644
--- a/src/mongo/db/storage/key_string.cpp
+++ b/src/mongo/db/storage/key_string.cpp
@@ -44,6 +44,8 @@
namespace mongo {
+ using std::string;
+
namespace {
typedef KeyString::TypeBits TypeBits;
diff --git a/src/mongo/db/storage/key_string_test.cpp b/src/mongo/db/storage/key_string_test.cpp
index ed5d7c7f4a1..f132645703a 100644
--- a/src/mongo/db/storage/key_string_test.cpp
+++ b/src/mongo/db/storage/key_string_test.cpp
@@ -36,6 +36,7 @@
#include "mongo/util/hex.h"
#include "mongo/util/log.h"
+using std::string;
using namespace mongo;
BSONObj toBson(const KeyString& ks, Ordering ord) {
diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp
index 3f5c4c85be3..81490a90e80 100644
--- a/src/mongo/db/storage/kv/kv_catalog.cpp
+++ b/src/mongo/db/storage/kv/kv_catalog.cpp
@@ -54,6 +54,7 @@ namespace {
}
using boost::scoped_ptr;
+ using std::string;
class KVCatalog::AddIdentChange : public RecoveryUnit::Change {
public:
diff --git a/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp b/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp
index 65b5bd054d2..c32736bcf07 100644
--- a/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp
+++ b/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp
@@ -35,6 +35,9 @@
#include "mongo/db/storage/kv/kv_engine.h"
namespace mongo {
+
+ using std::string;
+
class KVCollectionCatalogEntry::AddIndexChange : public RecoveryUnit::Change {
public:
AddIndexChange(OperationContext* opCtx, KVCollectionCatalogEntry* cce,
diff --git a/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp b/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp
index abde589c5a3..f397c767dca 100644
--- a/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp
+++ b/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp
@@ -37,6 +37,10 @@
#include "mongo/db/storage/recovery_unit.h"
namespace mongo {
+
+ using std::string;
+ using std::vector;
+
class KVDatabaseCatalogEntry::AddCollectionChange : public RecoveryUnit::Change {
public:
AddCollectionChange(OperationContext* opCtx, KVDatabaseCatalogEntry* dce,
diff --git a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
index f1d721ede4a..f2438689f8e 100644
--- a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
+++ b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp
@@ -43,6 +43,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
namespace {
class MyOperationContext : public OperationContextNoop {
diff --git a/src/mongo/db/storage/kv/kv_storage_engine.cpp b/src/mongo/db/storage/kv/kv_storage_engine.cpp
index 6ded627f501..ef56ed40325 100644
--- a/src/mongo/db/storage/kv/kv_storage_engine.cpp
+++ b/src/mongo/db/storage/kv/kv_storage_engine.cpp
@@ -39,6 +39,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
namespace {
const std::string catalogInfo = "_mdb_catalog";
}
diff --git a/src/mongo/db/storage/mmap_v1/aligned_builder.cpp b/src/mongo/db/storage/mmap_v1/aligned_builder.cpp
index 8df70d47d41..d11e88611bd 100644
--- a/src/mongo/db/storage/mmap_v1/aligned_builder.cpp
+++ b/src/mongo/db/storage/mmap_v1/aligned_builder.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+ using std::endl;
+
AlignedBuilder::AlignedBuilder(unsigned initSize) {
_len = 0;
_malloc(initSize);
diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp
index d7765c6be99..fbd1e6ad063 100644
--- a/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp
@@ -39,6 +39,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
+ using std::vector;
template <class OnDiskFormat>
class BtreeBuilderInterfaceImpl : public SortedDataBuilderInterface {
diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp
index 7fcdb64c6cb..74458f3e5e7 100644
--- a/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp
@@ -35,6 +35,8 @@
namespace mongo {
+ using std::auto_ptr;
+
class MyHarnessHelper : public HarnessHelper {
public:
MyHarnessHelper()
diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
index 60537a80aa3..9ac587b376c 100644
--- a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp
@@ -42,6 +42,16 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::dec;
+ using std::endl;
+ using std::hex;
+ using std::make_pair;
+ using std::pair;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
// BtreeLogic::Builder algorithm
//
// Phase 1:
diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp
index a84b135091b..87bfd0a03db 100644
--- a/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp
@@ -43,6 +43,8 @@
namespace mongo {
+ using std::string;
+
/**
* This class is made friend of BtreeLogic so we can add whatever private method accesses we
* need to it, to be used by the tests.
diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp
index 9609177b0e7..fe0cdf7e82e 100644
--- a/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+ using std::string;
+
string bigNumString(long long n, int len) {
char sub[17];
sprintf(sub, "%.16llx", n);
diff --git a/src/mongo/db/storage/mmap_v1/btree/key.cpp b/src/mongo/db/storage/mmap_v1/btree/key.cpp
index 9e9c0728799..d1bae1d4b33 100644
--- a/src/mongo/db/storage/mmap_v1/btree/key.cpp
+++ b/src/mongo/db/storage/mmap_v1/btree/key.cpp
@@ -38,6 +38,10 @@
namespace mongo {
+ using std::endl;
+ using std::numeric_limits;
+ using std::min;
+
extern const Ordering nullOrdering = Ordering::make(BSONObj());
// KeyBson is for V0 (version #0) indexes
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp
index 4f18bc622d8..4a3d7c394bf 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp
@@ -37,6 +37,9 @@
#include "mongo/util/startup_test.h"
namespace mongo {
+
+ using std::string;
+
NamespaceDetailsCollectionCatalogEntry::NamespaceDetailsCollectionCatalogEntry( const StringData& ns,
NamespaceDetails* details,
RecordStore* indexRecordStore,
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp
index 6faffcc6900..71d17417586 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp
@@ -38,6 +38,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::numeric_limits;
BOOST_STATIC_ASSERT(RecordStoreV1Base::Buckets
== NamespaceDetails::SmallBuckets + NamespaceDetails::LargeBuckets);
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp
index c4021faa522..ab2f441818b 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp
@@ -47,6 +47,10 @@
namespace mongo {
+ using std::endl;
+ using std::list;
+ using std::string;
+
NamespaceIndex::NamespaceIndex(const std::string& dir, const std::string& database)
: _dir(dir),
_database(database),
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp
index 7c50b86a5bf..6a0edb79ea4 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
TEST( NamespaceTest, Basics ) {
Namespace foo( "foo.bar" );
Namespace bar( "bar.foo" );
diff --git a/src/mongo/db/storage/mmap_v1/data_file.cpp b/src/mongo/db/storage/mmap_v1/data_file.cpp
index d6c4a8a794c..da66be40b8a 100644
--- a/src/mongo/db/storage/mmap_v1/data_file.cpp
+++ b/src/mongo/db/storage/mmap_v1/data_file.cpp
@@ -45,6 +45,9 @@
namespace mongo {
+
+ using std::endl;
+
namespace {
void data_file_check(void *_mb) {
diff --git a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp
index 74e64414467..46b682558bb 100644
--- a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp
+++ b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp
@@ -43,6 +43,8 @@
namespace mongo {
+ using std::endl;
+
DataFileSync dataFileSync;
DataFileSync::DataFileSync()
diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp
index 56f9f73d7a3..54fbb311eda 100644
--- a/src/mongo/db/storage/mmap_v1/dur.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur.cpp
@@ -96,6 +96,16 @@
#include "mongo/util/timer.h"
namespace mongo {
+
+ using std::endl;
+ using std::fixed;
+ using std::hex;
+ using std::set;
+ using std::setprecision;
+ using std::setw;
+ using std::string;
+ using std::stringstream;
+
namespace dur {
namespace {
diff --git a/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp b/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp
index 95a677ef991..480476d473f 100644
--- a/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp
@@ -47,6 +47,9 @@
namespace mongo {
using boost::shared_ptr;
+ using std::endl;
+ using std::max;
+ using std::min;
namespace dur {
diff --git a/src/mongo/db/storage/mmap_v1/dur_journal.cpp b/src/mongo/db/storage/mmap_v1/dur_journal.cpp
index d180e43726d..05a8a83fc2a 100644
--- a/src/mongo/db/storage/mmap_v1/dur_journal.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_journal.cpp
@@ -64,8 +64,11 @@ using namespace mongoutils;
namespace mongo {
- class AlignedBuilder;
+ using std::endl;
+ using std::hex;
+ using std::string;
+ class AlignedBuilder;
namespace dur {
// Rotate after reaching this data size in a journal (j._<n>) file
diff --git a/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp b/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp
index f32c4599177..1d1835f143a 100644
--- a/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp
@@ -54,6 +54,10 @@
namespace mongo {
+ using std::endl;
+ using std::min;
+ using std::stringstream;
+
namespace dur {
extern Journal j;
@@ -66,7 +70,7 @@ namespace mongo {
error() << "findMMF_inlock failed " << privateViews.numberOfViews_inlock() << endl;
printStackTrace(); // we want a stack trace and the assert below didn't print a trace once in the real world - not sure why
stringstream ss;
- ss << "view pointer cannot be resolved " << hex << (size_t) ptr;
+ ss << "view pointer cannot be resolved " << std::hex << (size_t) ptr;
journalingFailure(ss.str().c_str()); // asserts, which then abends
}
return f;
diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.cpp b/src/mongo/db/storage/mmap_v1/dur_recover.cpp
index 771726ce4b2..cedd7f3285b 100644
--- a/src/mongo/db/storage/mmap_v1/dur_recover.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_recover.cpp
@@ -63,6 +63,17 @@
namespace mongo {
+ using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::hex;
+ using std::map;
+ using std::pair;
+ using std::setw;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
/**
* Thrown when a journal section is corrupt. This is considered OK as long as it occurs while
* processing the last file. Processing stops at the first corrupt section.
diff --git a/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp b/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp
index 58b4d15daba..8c9bd195119 100644
--- a/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp
+++ b/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp
@@ -40,6 +40,8 @@ namespace mongo {
namespace dur {
+ using std::endl;
+
static void WRITETODATAFILES_Impl1(const JSectHeader& h,
const AlignedBuilder& uncompressed) {
LOG(3) << "journal WRITETODATAFILES 1" << endl;
diff --git a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
index f0546a63f35..603a5809861 100644
--- a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
+++ b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp
@@ -52,7 +52,13 @@
using namespace mongoutils;
namespace mongo {
+
+ using std::dec;
+ using std::endl;
+ using std::hex;
+ using std::map;
using std::pair;
+ using std::string;
void DurableMappedFile::remapThePrivateView() {
verify(storageGlobalParams.dur);
diff --git a/src/mongo/db/storage/mmap_v1/durop.cpp b/src/mongo/db/storage/mmap_v1/durop.cpp
index 3d6102588dc..aa70b169f32 100644
--- a/src/mongo/db/storage/mmap_v1/durop.cpp
+++ b/src/mongo/db/storage/mmap_v1/durop.cpp
@@ -50,6 +50,8 @@ namespace mongo {
using boost::scoped_array;
using boost::shared_ptr;
+ using std::endl;
+ using std::string;
namespace dur {
diff --git a/src/mongo/db/storage/mmap_v1/extent.cpp b/src/mongo/db/storage/mmap_v1/extent.cpp
index 4c880ee07d1..905e4d28a9e 100644
--- a/src/mongo/db/storage/mmap_v1/extent.cpp
+++ b/src/mongo/db/storage/mmap_v1/extent.cpp
@@ -36,6 +36,10 @@
namespace mongo {
+ using std::iostream;
+ using std::string;
+ using std::vector;
+
BOOST_STATIC_ASSERT( sizeof(Extent)-4 == 48+128 );
BSONObj Extent::dump() const {
diff --git a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
index 4be8ac12c06..6f82110b5d3 100644
--- a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
+++ b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp
@@ -54,6 +54,11 @@
namespace mongo {
+ using std::max;
+ using std::min;
+ using std::string;
+ using std::stringstream;
+
namespace dur {
boost::filesystem::path getJournalDir();
}
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp
index 529c46b37c6..6554adc5322 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp
@@ -57,6 +57,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
namespace {
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
index 926e65b4740..090d0c87f8d 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
@@ -53,6 +53,12 @@
namespace mongo {
+ using std::endl;
+ using std::ifstream;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
namespace {
#if !defined(__sunos__)
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp
index 7f1d873b369..99039a50049 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp
@@ -54,6 +54,12 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::max;
+ using std::string;
+ using std::stringstream;
+
// Turn on this failpoint to force the system to yield for a fetch. Setting to "alwaysOn"
// will cause yields for fetching to occur on every 'kNeedsFetchFailFreq'th call to
// recordNeedsFetch().
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
index 733042390ec..d3ad195cfdf 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp
@@ -48,6 +48,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::set;
+ using std::string;
/* Deleted list buckets are used to quickly locate free space based on size. Each bucket
contains records up to that size (meaning a record with a size exactly equal to
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp
index e0093f3a4c8..98adeed89a9 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp
@@ -61,6 +61,11 @@
namespace mongo {
+ using std::dec;
+ using std::endl;
+ using std::hex;
+ using std::vector;
+
CappedRecordStoreV1::CappedRecordStoreV1( OperationContext* txn,
CappedDocumentDeleteCallback* collection,
const StringData& ns,
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp
index cdd20a5da44..951164b214a 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp
@@ -42,6 +42,9 @@ using namespace mongo;
namespace {
+ using std::string;
+ using std::vector;
+
// Provides data to be inserted. Must be large enough for largest possible record.
// Should be in BSS so unused portions should be free.
char zeros[20*1024*1024] = {};
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp
index b5a9d155759..7f8151dce81 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::endl;
+
RecordStoreV1RepairIterator::RecordStoreV1RepairIterator(OperationContext* txn,
const RecordStoreV1Base* recordStore)
: _txn(txn), _recordStore(recordStore), _stage(FORWARD_SCAN) {
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
index eb718322a2f..1ede42c7f5f 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp
@@ -51,6 +51,9 @@
namespace mongo {
+ using std::endl;
+ using std::vector;
+
static Counter64 freelistAllocs;
static Counter64 freelistBucketExhausted;
static Counter64 freelistIterations;
@@ -229,7 +232,7 @@ namespace mongo {
void SimpleRecordStoreV1::addDeletedRec( OperationContext* txn, const DiskLoc& dloc ) {
DeletedRecord* d = drec( dloc );
- DEBUGGING log() << "TEMP: add deleted rec " << dloc.toString() << ' ' << hex << d->extentOfs() << endl;
+ DEBUGGING log() << "TEMP: add deleted rec " << dloc.toString() << ' ' << std::hex << d->extentOfs() << endl;
int b = bucket(d->lengthWithHeaders());
*txn->recoveryUnit()->writing(&d->nextDeleted()) = _details->deletedListEntry(b);
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
index 2f1b0181ec8..58a5ceeb317 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp
@@ -39,6 +39,9 @@
using namespace mongo;
namespace {
+
+ using std::string;
+
TEST(SimpleRecordStoreV1, ChangeNoPaddingSetting) {
OperationContextNoop txn;
DummyExtentManager em;
diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp
index 0cf7dc3f3fa..af789cc747b 100644
--- a/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp
+++ b/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp
@@ -46,6 +46,8 @@
namespace mongo {
+ using std::numeric_limits;
+
DummyRecordStoreV1MetaData::DummyRecordStoreV1MetaData( bool capped, int userFlags ) {
_dataSize = 0;
_numRecords = 0;
diff --git a/src/mongo/db/storage/mmap_v1/repair_database.cpp b/src/mongo/db/storage/mmap_v1/repair_database.cpp
index afd4c08a546..33992f4ccbc 100644
--- a/src/mongo/db/storage/mmap_v1/repair_database.cpp
+++ b/src/mongo/db/storage/mmap_v1/repair_database.cpp
@@ -56,6 +56,11 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::map;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
typedef boost::filesystem::path Path;
diff --git a/src/mongo/db/storage/record_store_test_docwriter.h b/src/mongo/db/storage/record_store_test_docwriter.h
index e026e942f9b..b52cfd97335 100644
--- a/src/mongo/db/storage/record_store_test_docwriter.h
+++ b/src/mongo/db/storage/record_store_test_docwriter.h
@@ -32,8 +32,6 @@
#include "mongo/db/storage/record_store.h"
-using std::string;
-
namespace mongo {
namespace {
diff --git a/src/mongo/db/storage/record_store_test_harness.cpp b/src/mongo/db/storage/record_store_test_harness.cpp
index fd5ecbea1cc..466c0891251 100644
--- a/src/mongo/db/storage/record_store_test_harness.cpp
+++ b/src/mongo/db/storage/record_store_test_harness.cpp
@@ -38,6 +38,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
TEST( RecordStoreTestHarness, Simple1 ) {
scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() );
diff --git a/src/mongo/db/storage/record_store_test_updaterecord.h b/src/mongo/db/storage/record_store_test_updaterecord.h
index 4ff21ae0e1c..ad1141671c0 100644
--- a/src/mongo/db/storage/record_store_test_updaterecord.h
+++ b/src/mongo/db/storage/record_store_test_updaterecord.h
@@ -35,8 +35,6 @@
#include "mongo/db/storage/record_store.h"
#include "mongo/unittest/unittest.h"
-using std::string;
-
namespace mongo {
namespace {
diff --git a/src/mongo/db/storage/record_store_test_validate.h b/src/mongo/db/storage/record_store_test_validate.h
index 6682649f5da..c342e43dfda 100644
--- a/src/mongo/db/storage/record_store_test_validate.h
+++ b/src/mongo/db/storage/record_store_test_validate.h
@@ -37,10 +37,6 @@
#include "mongo/db/storage/record_store_test_harness.h"
#include "mongo/unittest/unittest.h"
-using std::set;
-using std::string;
-using std::stringstream;
-
namespace mongo {
namespace {
diff --git a/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp b/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp
index b2d59de5ec1..b9802b763b3 100644
--- a/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp
+++ b/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp
@@ -38,6 +38,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::vector;
// Insert multiple single-field keys and advance to each of them
// using a forward cursor by specifying their exact key. When
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
index d6b2766c02c..82d77b08746 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp
@@ -59,6 +59,10 @@
namespace mongo {
namespace {
+
+ using std::string;
+ using std::vector;
+
static const int TempKeyMaxSize = 1024; // this goes away with SERVER-3372
static const WiredTigerItem emptyItem(NULL, 0);
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp
index f070ee361d1..11e14e6b33e 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp
@@ -47,6 +47,8 @@
namespace mongo {
+ using std::string;
+
class MyHarnessHelper : public HarnessHelper {
public:
MyHarnessHelper() : _dbpath( "wt_test" ), _conn( NULL ) {
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 921847f1992..84543d3d439 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -55,6 +55,9 @@
namespace mongo {
+ using std::set;
+ using std::string;
+
namespace {
int mdb_handle_error(WT_EVENT_HANDLER *handler, WT_SESSION *session,
int errorCode, const char *message) {
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp
index 07df199cfcc..5be812178dc 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+using std::string;
+
WiredTigerEngineRuntimeConfigParameter::WiredTigerEngineRuntimeConfigParameter(
WiredTigerKVEngine* engine)
: ServerParameter(ServerParameterSet::getGlobal(),
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index bc5b647b4a1..e1fe44de5b1 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -59,6 +59,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::string;
namespace {
static const int kMinimumRecordStoreVersion = 1;
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
index fb324881312..aad21c18eaa 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp
@@ -43,6 +43,8 @@
namespace mongo {
+ using std::string;
+
namespace {
int MAGIC = 123123;
}
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index 71fe57003dd..a73035b4f2b 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -56,6 +56,12 @@
namespace mongo {
+ using std::set;
+ using std::endl;
+ using std::list;
+ using std::string;
+ using std::vector;
+
Counter64 ttlPasses;
Counter64 ttlDeletedDocuments;
diff --git a/src/mongo/db/update_index_data.cpp b/src/mongo/db/update_index_data.cpp
index fa96b7cfa1a..45e9f90c90c 100644
--- a/src/mongo/db/update_index_data.cpp
+++ b/src/mongo/db/update_index_data.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
UpdateIndexData::UpdateIndexData() : _allPathsIndexed( false ) { }
void UpdateIndexData::addPath( const StringData& path ) {
diff --git a/src/mongo/db/update_index_data_test.cpp b/src/mongo/db/update_index_data_test.cpp
index b9b85023152..d011889e8fa 100644
--- a/src/mongo/db/update_index_data_test.cpp
+++ b/src/mongo/db/update_index_data_test.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
TEST( UpdateIndexDataTest, Simple1 ) {
UpdateIndexData a;
a.addPath( "a.b" );
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp
index ed4fb8ac3a3..97db25a5c5b 100644
--- a/src/mongo/db/write_concern.cpp
+++ b/src/mongo/db/write_concern.cpp
@@ -42,6 +42,8 @@
namespace mongo {
+ using std::string;
+
static TimerStats gleWtimeStats;
static ServerStatusMetricField<TimerStats> displayGleLatency("getLastError.wtime",
&gleWtimeStats );
diff --git a/src/mongo/db/write_concern_options.cpp b/src/mongo/db/write_concern_options.cpp
index 90690b87599..dd8b14cdb05 100644
--- a/src/mongo/db/write_concern_options.cpp
+++ b/src/mongo/db/write_concern_options.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
const BSONObj WriteConcernOptions::Default = BSONObj();
const BSONObj WriteConcernOptions::Acknowledged(BSON("w" << W_NORMAL));
const BSONObj WriteConcernOptions::AllConfigs = BSONObj();
diff --git a/src/mongo/dbtests/accumulatortests.cpp b/src/mongo/dbtests/accumulatortests.cpp
index b3729bcd071..ccc334d0095 100644
--- a/src/mongo/dbtests/accumulatortests.cpp
+++ b/src/mongo/dbtests/accumulatortests.cpp
@@ -41,6 +41,8 @@
namespace AccumulatorTests {
using boost::intrusive_ptr;
+ using std::numeric_limits;
+ using std::string;
class Base {
protected:
diff --git a/src/mongo/dbtests/basictests.cpp b/src/mongo/dbtests/basictests.cpp
index 4d1deb94167..f31b8021fe5 100644
--- a/src/mongo/dbtests/basictests.cpp
+++ b/src/mongo/dbtests/basictests.cpp
@@ -51,6 +51,13 @@ namespace BasicTests {
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::cout;
+ using std::dec;
+ using std::endl;
+ using std::hex;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
class Rarely {
public:
diff --git a/src/mongo/dbtests/chunktests.cpp b/src/mongo/dbtests/chunktests.cpp
index e9cb366f199..82862c6cfe8 100644
--- a/src/mongo/dbtests/chunktests.cpp
+++ b/src/mongo/dbtests/chunktests.cpp
@@ -39,6 +39,10 @@
namespace mongo {
+ using std::set;
+ using std::string;
+ using std::vector;
+
class TestableChunkManager : public ChunkManager {
public:
diff --git a/src/mongo/dbtests/clienttests.cpp b/src/mongo/dbtests/clienttests.cpp
index 29e5b95d47f..efd31f5e580 100644
--- a/src/mongo/dbtests/clienttests.cpp
+++ b/src/mongo/dbtests/clienttests.cpp
@@ -38,6 +38,10 @@
namespace ClientTests {
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
+
class Base {
public:
diff --git a/src/mongo/dbtests/commandtests.cpp b/src/mongo/dbtests/commandtests.cpp
index b90dd1ec399..f6e87de5885 100644
--- a/src/mongo/dbtests/commandtests.cpp
+++ b/src/mongo/dbtests/commandtests.cpp
@@ -36,6 +36,9 @@
using namespace mongo;
namespace CommandTests {
+
+ using std::string;
+
// one namespace per command
namespace FileMD5 {
struct Base {
diff --git a/src/mongo/dbtests/config_server_fixture.cpp b/src/mongo/dbtests/config_server_fixture.cpp
index 965ed3a6cfd..c92f521d433 100644
--- a/src/mongo/dbtests/config_server_fixture.cpp
+++ b/src/mongo/dbtests/config_server_fixture.cpp
@@ -48,7 +48,9 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
using std::list;
+ using std::string;
ConfigServerFixture::ConfigServerFixture()
: _client(&_txn),
diff --git a/src/mongo/dbtests/config_upgrade_tests.cpp b/src/mongo/dbtests/config_upgrade_tests.cpp
index 1a93c5c4a0a..841ce48343e 100644
--- a/src/mongo/dbtests/config_upgrade_tests.cpp
+++ b/src/mongo/dbtests/config_upgrade_tests.cpp
@@ -41,6 +41,8 @@
namespace mongo {
+ using std::string;
+
/**
* Specialization of the config server fixture with helpers for the tests below.
*/
diff --git a/src/mongo/dbtests/dbhelper_tests.cpp b/src/mongo/dbtests/dbhelper_tests.cpp
index ec695ece1d7..4593fd26e70 100644
--- a/src/mongo/dbtests/dbhelper_tests.cpp
+++ b/src/mongo/dbtests/dbhelper_tests.cpp
@@ -38,6 +38,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::set;
+
/**
* Unit tests related to DBHelpers
*/
diff --git a/src/mongo/dbtests/directclienttests.cpp b/src/mongo/dbtests/directclienttests.cpp
index 5c12d77fce0..2c79c26a082 100644
--- a/src/mongo/dbtests/directclienttests.cpp
+++ b/src/mongo/dbtests/directclienttests.cpp
@@ -46,6 +46,9 @@
namespace DirectClientTests {
+ using std::auto_ptr;
+ using std::vector;
+
class ClientBase {
public:
ClientBase() {
diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp
index 34cb050eaa2..059c48fe62d 100644
--- a/src/mongo/dbtests/documentsourcetests.cpp
+++ b/src/mongo/dbtests/documentsourcetests.cpp
@@ -51,6 +51,10 @@ namespace DocumentSourceTests {
using boost::intrusive_ptr;
using boost::shared_ptr;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::vector;
static const char* const ns = "unittests.documentsourcetests";
static const BSONObj metaTextScore = BSON("$meta" << "textScore");
diff --git a/src/mongo/dbtests/documenttests.cpp b/src/mongo/dbtests/documenttests.cpp
index f29b75fd7b2..c525cd412ad 100644
--- a/src/mongo/dbtests/documenttests.cpp
+++ b/src/mongo/dbtests/documenttests.cpp
@@ -41,6 +41,11 @@
namespace DocumentTests {
+ using std::endl;
+ using std::numeric_limits;
+ using std::string;
+ using std::vector;
+
mongo::Document::FieldPair getNthField(mongo::Document doc, size_t index) {
mongo::FieldIterator it (doc);
while (index--) // advance index times
diff --git a/src/mongo/dbtests/executor_registry.cpp b/src/mongo/dbtests/executor_registry.cpp
index 9af65a1b013..d526f5389ae 100644
--- a/src/mongo/dbtests/executor_registry.cpp
+++ b/src/mongo/dbtests/executor_registry.cpp
@@ -47,6 +47,8 @@
namespace ExecutorRegistry {
+ using std::auto_ptr;
+
class ExecutorRegistryBase {
public:
ExecutorRegistryBase()
diff --git a/src/mongo/dbtests/expressiontests.cpp b/src/mongo/dbtests/expressiontests.cpp
index 5dfc0befe42..ae160fa5f6a 100644
--- a/src/mongo/dbtests/expressiontests.cpp
+++ b/src/mongo/dbtests/expressiontests.cpp
@@ -40,6 +40,10 @@
namespace ExpressionTests {
using boost::intrusive_ptr;
+ using std::numeric_limits;
+ using std::set;
+ using std::string;
+ using std::vector;
/** Convert BSONObj to a BSONObj with our $const wrappings. */
static BSONObj constify(const BSONObj& obj, bool parentIsArray=false) {
diff --git a/src/mongo/dbtests/framework.cpp b/src/mongo/dbtests/framework.cpp
index c1e807aaea6..d8b1bb9c472 100644
--- a/src/mongo/dbtests/framework.cpp
+++ b/src/mongo/dbtests/framework.cpp
@@ -58,6 +58,9 @@ namespace moe = mongo::optionenvironment;
namespace mongo {
+ using std::endl;
+ using std::string;
+
namespace dbtests {
mutex globalCurrentTestNameMutex("globalCurrentTestNameMutex");
diff --git a/src/mongo/dbtests/framework_options.cpp b/src/mongo/dbtests/framework_options.cpp
index 6a78ef0a5fa..26b795e0893 100644
--- a/src/mongo/dbtests/framework_options.cpp
+++ b/src/mongo/dbtests/framework_options.cpp
@@ -46,6 +46,11 @@
namespace mongo {
+ using std::cout;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
FrameworkGlobalParams frameworkGlobalParams;
Status addTestFrameworkOptions(moe::OptionSection* options) {
diff --git a/src/mongo/dbtests/gle_test.cpp b/src/mongo/dbtests/gle_test.cpp
index b5f958671a6..4514971578b 100644
--- a/src/mongo/dbtests/gle_test.cpp
+++ b/src/mongo/dbtests/gle_test.cpp
@@ -37,6 +37,9 @@ using mongo::MsgAssertionException;
* Test getLastError client handling
*/
namespace {
+
+ using std::string;
+
static const char* const _ns = "unittests.gle";
/**
diff --git a/src/mongo/dbtests/jsobjtests.cpp b/src/mongo/dbtests/jsobjtests.cpp
index d769e66a043..4ffab7c0f41 100644
--- a/src/mongo/dbtests/jsobjtests.cpp
+++ b/src/mongo/dbtests/jsobjtests.cpp
@@ -50,6 +50,14 @@
#include "mongo/util/stringutils.h"
namespace mongo {
+
+ using std::cout;
+ using std::endl;
+ using std::numeric_limits;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
typedef std::map<std::string, BSONElement> BSONMap;
BSONMap bson2map(const BSONObj& obj) {
BSONMap m;
diff --git a/src/mongo/dbtests/jsontests.cpp b/src/mongo/dbtests/jsontests.cpp
index 567b7cabf47..5ea9cab5b81 100644
--- a/src/mongo/dbtests/jsontests.cpp
+++ b/src/mongo/dbtests/jsontests.cpp
@@ -45,6 +45,14 @@
namespace JsonTests {
+
+ using std::cout;
+ using std::endl;
+ using std::numeric_limits;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
namespace JsonStringTests {
class Empty {
diff --git a/src/mongo/dbtests/jstests.cpp b/src/mongo/dbtests/jstests.cpp
index d7cfa36bef6..67299420841 100644
--- a/src/mongo/dbtests/jstests.cpp
+++ b/src/mongo/dbtests/jstests.cpp
@@ -48,7 +48,12 @@
#include "mongo/util/timer.h"
using boost::scoped_ptr;
+using std::auto_ptr;
+using std::cout;
+using std::endl;
using std::string;
+using std::stringstream;
+using std::vector;
namespace JSTests {
diff --git a/src/mongo/dbtests/matchertests.cpp b/src/mongo/dbtests/matchertests.cpp
index 043f5f7688e..8d66896eb85 100644
--- a/src/mongo/dbtests/matchertests.cpp
+++ b/src/mongo/dbtests/matchertests.cpp
@@ -39,6 +39,10 @@
namespace MatcherTests {
+ using std::cout;
+ using std::endl;
+ using std::string;
+
class CollectionBase {
public:
CollectionBase() { }
diff --git a/src/mongo/dbtests/merge_chunk_tests.cpp b/src/mongo/dbtests/merge_chunk_tests.cpp
index 6cdb75cd177..47e233483cd 100644
--- a/src/mongo/dbtests/merge_chunk_tests.cpp
+++ b/src/mongo/dbtests/merge_chunk_tests.cpp
@@ -39,6 +39,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
/**
* Specialization of the config server fixture with helpers for the tests below.
*/
diff --git a/src/mongo/dbtests/mmaptests.cpp b/src/mongo/dbtests/mmaptests.cpp
index acf31062877..6f2cad63043 100644
--- a/src/mongo/dbtests/mmaptests.cpp
+++ b/src/mongo/dbtests/mmaptests.cpp
@@ -47,6 +47,9 @@
namespace MMapTests {
+ using std::endl;
+ using std::string;
+
class LeakTest {
const string fn;
const int optOld;
diff --git a/src/mongo/dbtests/mock/mock_conn_registry.cpp b/src/mongo/dbtests/mock/mock_conn_registry.cpp
index 148f8860679..c50e177667f 100644
--- a/src/mongo/dbtests/mock/mock_conn_registry.cpp
+++ b/src/mongo/dbtests/mock/mock_conn_registry.cpp
@@ -32,6 +32,9 @@
#include "mongo/dbtests/mock/mock_dbclient_connection.h"
namespace mongo {
+
+ using std::string;
+
boost::scoped_ptr<MockConnRegistry> MockConnRegistry::_instance;
MONGO_INITIALIZER(MockConnRegistry)(InitializerContext* context) {
diff --git a/src/mongo/dbtests/mock/mock_replica_set.cpp b/src/mongo/dbtests/mock/mock_replica_set.cpp
index 851d69e8a7e..ea1ebde067a 100644
--- a/src/mongo/dbtests/mock/mock_replica_set.cpp
+++ b/src/mongo/dbtests/mock/mock_replica_set.cpp
@@ -37,6 +37,10 @@
using namespace mongo::repl;
namespace mongo {
+
+ using std::string;
+ using std::vector;
+
MockReplicaSet::MockReplicaSet(const string& setName, size_t nodes):
_setName(setName) {
BSONObjBuilder configBuilder;
diff --git a/src/mongo/dbtests/namespacetests.cpp b/src/mongo/dbtests/namespacetests.cpp
index eb6c604c264..1017be597e5 100644
--- a/src/mongo/dbtests/namespacetests.cpp
+++ b/src/mongo/dbtests/namespacetests.cpp
@@ -57,6 +57,8 @@
namespace NamespaceTests {
+ using std::string;
+
const int MinExtentSize = 4096;
namespace MissingFieldTests {
diff --git a/src/mongo/dbtests/oplogstarttests.cpp b/src/mongo/dbtests/oplogstarttests.cpp
index c4da2f33bfb..2248391a5c5 100644
--- a/src/mongo/dbtests/oplogstarttests.cpp
+++ b/src/mongo/dbtests/oplogstarttests.cpp
@@ -38,6 +38,7 @@
namespace OplogStartTests {
using boost::scoped_ptr;
+ using std::string;
class Base {
public:
diff --git a/src/mongo/dbtests/perftests.cpp b/src/mongo/dbtests/perftests.cpp
index c009cf90fa7..1a5456191fe 100644
--- a/src/mongo/dbtests/perftests.cpp
+++ b/src/mongo/dbtests/perftests.cpp
@@ -75,6 +75,17 @@
namespace PerfTests {
using boost::shared_ptr;
+ using std::cout;
+ using std::endl;
+ using std::fixed;
+ using std::ifstream;
+ using std::left;
+ using std::min;
+ using std::right;
+ using std::setprecision;
+ using std::setw;
+ using std::string;
+ using std::vector;
const bool profiling = false;
diff --git a/src/mongo/dbtests/pipelinetests.cpp b/src/mongo/dbtests/pipelinetests.cpp
index b5d27da0edf..17b226ff061 100644
--- a/src/mongo/dbtests/pipelinetests.cpp
+++ b/src/mongo/dbtests/pipelinetests.cpp
@@ -43,6 +43,8 @@
namespace PipelineTests {
using boost::intrusive_ptr;
+ using std::string;
+ using std::vector;
namespace FieldPath {
diff --git a/src/mongo/dbtests/plan_ranking.cpp b/src/mongo/dbtests/plan_ranking.cpp
index 3429ed88f43..7ff4bc3ab8d 100644
--- a/src/mongo/dbtests/plan_ranking.cpp
+++ b/src/mongo/dbtests/plan_ranking.cpp
@@ -62,6 +62,7 @@ namespace mongo {
namespace PlanRankingTests {
using boost::scoped_ptr;
+ using std::vector;
static const char* ns = "unittests.PlanRankingTests";
diff --git a/src/mongo/dbtests/query_multi_plan_runner.cpp b/src/mongo/dbtests/query_multi_plan_runner.cpp
index 6ff4e66d060..aaf4cb94736 100644
--- a/src/mongo/dbtests/query_multi_plan_runner.cpp
+++ b/src/mongo/dbtests/query_multi_plan_runner.cpp
@@ -57,6 +57,8 @@ namespace mongo {
namespace QueryMultiPlanRunner {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::vector;
/**
* Create query solution.
diff --git a/src/mongo/dbtests/query_plan_executor.cpp b/src/mongo/dbtests/query_plan_executor.cpp
index 944e1aaeff3..f524c421df2 100644
--- a/src/mongo/dbtests/query_plan_executor.cpp
+++ b/src/mongo/dbtests/query_plan_executor.cpp
@@ -51,6 +51,8 @@ namespace QueryPlanExecutor {
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::string;
class PlanExecutorBase {
public:
diff --git a/src/mongo/dbtests/query_stage_and.cpp b/src/mongo/dbtests/query_stage_and.cpp
index 1574db01b07..670c3e4ef72 100644
--- a/src/mongo/dbtests/query_stage_and.cpp
+++ b/src/mongo/dbtests/query_stage_and.cpp
@@ -53,6 +53,8 @@ namespace QueryStageAnd {
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::set;
class QueryStageAndBase {
public:
diff --git a/src/mongo/dbtests/query_stage_collscan.cpp b/src/mongo/dbtests/query_stage_collscan.cpp
index 3e0f8b9aa54..17f761b13d8 100644
--- a/src/mongo/dbtests/query_stage_collscan.cpp
+++ b/src/mongo/dbtests/query_stage_collscan.cpp
@@ -49,6 +49,8 @@
namespace QueryStageCollectionScan {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::vector;
//
// Stage-specific tests.
diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp
index 31f7188b4de..63a4649ae83 100644
--- a/src/mongo/dbtests/query_stage_count.cpp
+++ b/src/mongo/dbtests/query_stage_count.cpp
@@ -43,6 +43,8 @@
namespace QueryStageCount {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::vector;
const int kDocuments = 100;
const int kInterjections = kDocuments;
diff --git a/src/mongo/dbtests/query_stage_delete.cpp b/src/mongo/dbtests/query_stage_delete.cpp
index 49513f6cffc..1c39f39795f 100644
--- a/src/mongo/dbtests/query_stage_delete.cpp
+++ b/src/mongo/dbtests/query_stage_delete.cpp
@@ -43,6 +43,7 @@
namespace QueryStageDelete {
using boost::scoped_ptr;
+ using std::vector;
//
// Stage-specific tests.
diff --git a/src/mongo/dbtests/query_stage_fetch.cpp b/src/mongo/dbtests/query_stage_fetch.cpp
index 8b55f57d51e..c7605f3b6a3 100644
--- a/src/mongo/dbtests/query_stage_fetch.cpp
+++ b/src/mongo/dbtests/query_stage_fetch.cpp
@@ -47,6 +47,8 @@
namespace QueryStageFetch {
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::set;
class QueryStageFetchBase {
public:
diff --git a/src/mongo/dbtests/query_stage_keep.cpp b/src/mongo/dbtests/query_stage_keep.cpp
index bc4f37c3ce2..1113fc42f7e 100644
--- a/src/mongo/dbtests/query_stage_keep.cpp
+++ b/src/mongo/dbtests/query_stage_keep.cpp
@@ -52,6 +52,7 @@
namespace QueryStageKeep {
using boost::shared_ptr;
+ using std::set;
class QueryStageKeepBase {
public:
diff --git a/src/mongo/dbtests/query_stage_limit_skip.cpp b/src/mongo/dbtests/query_stage_limit_skip.cpp
index edb745a2d69..46967226a10 100644
--- a/src/mongo/dbtests/query_stage_limit_skip.cpp
+++ b/src/mongo/dbtests/query_stage_limit_skip.cpp
@@ -46,6 +46,9 @@ using namespace mongo;
namespace {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::max;
+ using std::min;
static const int N = 50;
diff --git a/src/mongo/dbtests/query_stage_merge_sort.cpp b/src/mongo/dbtests/query_stage_merge_sort.cpp
index a157ef635c6..e2b0d9e44fb 100644
--- a/src/mongo/dbtests/query_stage_merge_sort.cpp
+++ b/src/mongo/dbtests/query_stage_merge_sort.cpp
@@ -45,6 +45,10 @@
namespace QueryStageMergeSortTests {
+ using std::auto_ptr;
+ using std::set;
+ using std::string;
+
class QueryStageMergeSortTestBase {
public:
QueryStageMergeSortTestBase() : _client(&_txn) {
diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp
index bb3ef814899..e4c42945f6f 100644
--- a/src/mongo/dbtests/query_stage_sort.cpp
+++ b/src/mongo/dbtests/query_stage_sort.cpp
@@ -45,6 +45,9 @@
namespace QueryStageSortTests {
+ using std::auto_ptr;
+ using std::set;
+
class QueryStageSortTestBase {
public:
QueryStageSortTestBase() : _client(&_txn) {
diff --git a/src/mongo/dbtests/query_stage_tests.cpp b/src/mongo/dbtests/query_stage_tests.cpp
index 2ed9925716c..71490621109 100644
--- a/src/mongo/dbtests/query_stage_tests.cpp
+++ b/src/mongo/dbtests/query_stage_tests.cpp
@@ -44,6 +44,8 @@
namespace QueryStageTests {
+ using std::auto_ptr;
+
class IndexScanBase {
public:
IndexScanBase() : _client(&_txn) {
diff --git a/src/mongo/dbtests/query_stage_update.cpp b/src/mongo/dbtests/query_stage_update.cpp
index 814a67e4e4f..eed2e5911ac 100644
--- a/src/mongo/dbtests/query_stage_update.cpp
+++ b/src/mongo/dbtests/query_stage_update.cpp
@@ -51,6 +51,8 @@
namespace QueryStageUpdate {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::vector;
class QueryStageUpdateBase {
public:
diff --git a/src/mongo/dbtests/querytests.cpp b/src/mongo/dbtests/querytests.cpp
index 80bb6c6f3b0..369a694240c 100644
--- a/src/mongo/dbtests/querytests.cpp
+++ b/src/mongo/dbtests/querytests.cpp
@@ -55,6 +55,12 @@ namespace mongo {
namespace QueryTests {
+ using std::auto_ptr;
+ using std::cout;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
class Base {
public:
Base() : _scopedXact(&_txn, MODE_X),
diff --git a/src/mongo/dbtests/repltests.cpp b/src/mongo/dbtests/repltests.cpp
index 9b72477905a..1daaae6ec71 100644
--- a/src/mongo/dbtests/repltests.cpp
+++ b/src/mongo/dbtests/repltests.cpp
@@ -54,6 +54,12 @@ using namespace mongo::repl;
namespace ReplTests {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
BSONObj f( const char *s ) {
return fromjson( s );
}
diff --git a/src/mongo/dbtests/sharding.cpp b/src/mongo/dbtests/sharding.cpp
index 6a70c2b0a9c..c0dd23a6306 100644
--- a/src/mongo/dbtests/sharding.cpp
+++ b/src/mongo/dbtests/sharding.cpp
@@ -48,6 +48,11 @@
namespace ShardingTests {
using boost::shared_ptr;
+ using std::make_pair;
+ using std::map;
+ using std::pair;
+ using std::set;
+ using std::string;
namespace serverandquerytests {
class test1 {
diff --git a/src/mongo/dbtests/threadedtests.cpp b/src/mongo/dbtests/threadedtests.cpp
index c317906edc6..62d8465e940 100644
--- a/src/mongo/dbtests/threadedtests.cpp
+++ b/src/mongo/dbtests/threadedtests.cpp
@@ -53,6 +53,11 @@
namespace ThreadedTests {
+ using std::auto_ptr;
+ using std::cout;
+ using std::endl;
+ using std::string;
+
template <int nthreads_param=10>
class ThreadedTest {
public:
diff --git a/src/mongo/dbtests/updatetests.cpp b/src/mongo/dbtests/updatetests.cpp
index 04968f6be05..1b579f1c0c6 100644
--- a/src/mongo/dbtests/updatetests.cpp
+++ b/src/mongo/dbtests/updatetests.cpp
@@ -48,6 +48,12 @@
namespace UpdateTests {
+ using std::auto_ptr;
+ using std::numeric_limits;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
class ClientBase {
public:
ClientBase() : _client(&_txn) {
diff --git a/src/mongo/logger/ramlog.cpp b/src/mongo/logger/ramlog.cpp
index 4b1efc81b0c..36ac1ef5023 100644
--- a/src/mongo/logger/ramlog.cpp
+++ b/src/mongo/logger/ramlog.cpp
@@ -39,6 +39,9 @@
#include "mongo/util/mongoutils/str.h"
namespace mongo {
+
+ using std::string;
+
namespace {
typedef std::map<string,RamLog*> RM;
mongo::mutex* _namedLock = NULL;
diff --git a/src/mongo/s/balance.cpp b/src/mongo/s/balance.cpp
index 6659c8e3f64..76e658b8ef6 100644
--- a/src/mongo/s/balance.cpp
+++ b/src/mongo/s/balance.cpp
@@ -62,6 +62,12 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::vector;
MONGO_FP_DECLARE(skipBalanceRound);
diff --git a/src/mongo/s/balancer_policy.cpp b/src/mongo/s/balancer_policy.cpp
index 58e0c32272a..651502d01bc 100644
--- a/src/mongo/s/balancer_policy.cpp
+++ b/src/mongo/s/balancer_policy.cpp
@@ -44,6 +44,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::map;
+ using std::numeric_limits;
+ using std::set;
+ using std::string;
+ using std::vector;
+
string TagRange::toString() const {
return str::stream() << min << " -->> " << max << " on " << tag;
}
diff --git a/src/mongo/s/balancer_policy_tests.cpp b/src/mongo/s/balancer_policy_tests.cpp
index 3d9a92c417f..08906b0accf 100644
--- a/src/mongo/s/balancer_policy_tests.cpp
+++ b/src/mongo/s/balancer_policy_tests.cpp
@@ -40,6 +40,12 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::map;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
namespace {
diff --git a/src/mongo/s/chunk.cpp b/src/mongo/s/chunk.cpp
index 61a6769320f..62a19e74213 100644
--- a/src/mongo/s/chunk.cpp
+++ b/src/mongo/s/chunk.cpp
@@ -73,6 +73,18 @@
namespace mongo {
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::cout;
+ using std::endl;
+ using std::pair;
+ using std::make_pair;
+ using std::map;
+ using std::max;
+ using std::ostringstream;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
inline bool allOfType(BSONType type, const BSONObj& o) {
BSONObjIterator it(o);
diff --git a/src/mongo/s/chunk_diff-inl.cpp b/src/mongo/s/chunk_diff-inl.cpp
index e53cbf4a197..e8f7575bcf4 100644
--- a/src/mongo/s/chunk_diff-inl.cpp
+++ b/src/mongo/s/chunk_diff-inl.cpp
@@ -41,6 +41,12 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::map;
+ using std::string;
+ using std::vector;
+
template < class ValType, class ShardType >
bool ConfigDiffTracker<ValType,ShardType>::
isOverlapping( const BSONObj& min, const BSONObj& max )
diff --git a/src/mongo/s/chunk_manager_targeter.cpp b/src/mongo/s/chunk_manager_targeter.cpp
index 11945efd0fd..7ae106245e6 100644
--- a/src/mongo/s/chunk_manager_targeter.cpp
+++ b/src/mongo/s/chunk_manager_targeter.cpp
@@ -37,6 +37,12 @@
namespace mongo {
+ using std::endl;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::vector;
+
using mongoutils::str::stream;
/**
diff --git a/src/mongo/s/chunk_manager_targeter_test.cpp b/src/mongo/s/chunk_manager_targeter_test.cpp
index 8e7ee9ef9a8..30bd0589cbd 100644
--- a/src/mongo/s/chunk_manager_targeter_test.cpp
+++ b/src/mongo/s/chunk_manager_targeter_test.cpp
@@ -40,6 +40,8 @@ namespace {
using namespace mongo;
+ using std::auto_ptr;
+ using std::make_pair;
/**
* ChunkManager targeting test
*
diff --git a/src/mongo/s/client_info.cpp b/src/mongo/s/client_info.cpp
index cefcdc9a137..758b8cb5936 100644
--- a/src/mongo/s/client_info.cpp
+++ b/src/mongo/s/client_info.cpp
@@ -56,6 +56,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
ClientInfo::ClientInfo(AbstractMessagingPort* messagingPort) : ClientBasic(messagingPort) {
_cur = &_a;
_prev = &_b;
diff --git a/src/mongo/s/cluster_client_internal.cpp b/src/mongo/s/cluster_client_internal.cpp
index 5a9b7c2a0e6..b0b4fc53f81 100644
--- a/src/mongo/s/cluster_client_internal.cpp
+++ b/src/mongo/s/cluster_client_internal.cpp
@@ -49,6 +49,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
using std::string;
using std::vector;
using mongoutils::str::stream;
diff --git a/src/mongo/s/cluster_explain.cpp b/src/mongo/s/cluster_explain.cpp
index 595786ee39d..75b63382540 100644
--- a/src/mongo/s/cluster_explain.cpp
+++ b/src/mongo/s/cluster_explain.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::vector;
+
const char* ClusterExplain::kSingleShard = "SINGLE_SHARD";
const char* ClusterExplain::kMergeFromShards = "SHARD_MERGE";
const char* ClusterExplain::kMergeSortFromShards = "SHARD_MERGE_SORT";
diff --git a/src/mongo/s/cluster_write.cpp b/src/mongo/s/cluster_write.cpp
index 62fdcce12bf..ec66e80b790 100644
--- a/src/mongo/s/cluster_write.cpp
+++ b/src/mongo/s/cluster_write.cpp
@@ -50,8 +50,12 @@
namespace mongo {
+ using std::auto_ptr;
using std::vector;
+ using std::endl;
+ using std::map;
using std::string;
+ using std::stringstream;
const int ConfigOpTimeoutMillis = 30 * 1000;
diff --git a/src/mongo/s/collection_metadata.cpp b/src/mongo/s/collection_metadata.cpp
index e4ec828caec..11663b072e4 100644
--- a/src/mongo/s/collection_metadata.cpp
+++ b/src/mongo/s/collection_metadata.cpp
@@ -36,6 +36,12 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::make_pair;
+ using std::string;
+ using std::vector;
+
using mongoutils::str::stream;
CollectionMetadata::CollectionMetadata() { }
diff --git a/src/mongo/s/commands/auth_schema_upgrade_s.cpp b/src/mongo/s/commands/auth_schema_upgrade_s.cpp
index 7ecaf85f9bd..bf6c33804a2 100644
--- a/src/mongo/s/commands/auth_schema_upgrade_s.cpp
+++ b/src/mongo/s/commands/auth_schema_upgrade_s.cpp
@@ -49,6 +49,10 @@
#include "mongo/util/log.h"
namespace mongo {
+
+ using std::endl;
+ using std::string;
+
namespace {
/**
diff --git a/src/mongo/s/commands/cluster_explain_cmd.cpp b/src/mongo/s/commands/cluster_explain_cmd.cpp
index d0b55d3e6af..ea80aa75d3b 100644
--- a/src/mongo/s/commands/cluster_explain_cmd.cpp
+++ b/src/mongo/s/commands/cluster_explain_cmd.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
static ClusterExplainCmd cmdExplainCluster;
Status ClusterExplainCmd::checkAuthForCommand(ClientBasic* client,
diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp
index f64816d2c03..4d819207f43 100644
--- a/src/mongo/s/commands/cluster_find_cmd.cpp
+++ b/src/mongo/s/commands/cluster_find_cmd.cpp
@@ -37,6 +37,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
+
static ClusterFindCmd cmdFindCluster;
Status ClusterFindCmd::checkAuthForCommand(ClientBasic* client,
diff --git a/src/mongo/s/commands/cluster_index_filter_cmd.cpp b/src/mongo/s/commands/cluster_index_filter_cmd.cpp
index c454e2bc385..c66e2802db9 100644
--- a/src/mongo/s/commands/cluster_index_filter_cmd.cpp
+++ b/src/mongo/s/commands/cluster_index_filter_cmd.cpp
@@ -40,6 +40,7 @@
namespace mongo {
using std::string;
+ using std::stringstream;
using std::vector;
/**
diff --git a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
index 57bca2b1fb5..5e872b5a80c 100644
--- a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
+++ b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp
@@ -40,6 +40,10 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
/**
* Mongos-side command for merging chunks, passes command to appropriate shard.
*/
diff --git a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp
index 5bd87f4eb8a..bd22961aa71 100644
--- a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp
+++ b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp
@@ -40,6 +40,7 @@
namespace mongo {
using std::string;
+ using std::stringstream;
using std::vector;
/**
diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp
index e25089e7413..940cc1bc5da 100644
--- a/src/mongo/s/commands/cluster_write_cmd.cpp
+++ b/src/mongo/s/commands/cluster_write_cmd.cpp
@@ -46,6 +46,10 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
/**
* Base class for mongos write commands. Cluster write commands support batch writes and write
* concern, and return per-item error information. All cluster write commands use the entry
diff --git a/src/mongo/s/commands_admin.cpp b/src/mongo/s/commands_admin.cpp
index 129e0039c6e..01d760ce407 100644
--- a/src/mongo/s/commands_admin.cpp
+++ b/src/mongo/s/commands_admin.cpp
@@ -84,6 +84,14 @@ namespace mongo {
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
namespace dbgrid_cmds {
diff --git a/src/mongo/s/commands_public.cpp b/src/mongo/s/commands_public.cpp
index 2b78a284e12..a0fd5392f80 100644
--- a/src/mongo/s/commands_public.cpp
+++ b/src/mongo/s/commands_public.cpp
@@ -76,6 +76,15 @@ namespace mongo {
using boost::intrusive_ptr;
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::endl;
+ using std::list;
+ using std::make_pair;
+ using std::map;
+ using std::multimap;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
namespace dbgrid_pub_cmds {
diff --git a/src/mongo/s/config.cpp b/src/mongo/s/config.cpp
index 9df7a847808..79e37898bc8 100644
--- a/src/mongo/s/config.cpp
+++ b/src/mongo/s/config.cpp
@@ -62,6 +62,12 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::pair;
+ using std::set;
+ using std::stringstream;
+ using std::vector;
int ConfigServer::VERSION = 3;
Shard Shard::EMPTY;
diff --git a/src/mongo/s/config_upgrade.cpp b/src/mongo/s/config_upgrade.cpp
index ff79ce482e2..58e0a239d0d 100644
--- a/src/mongo/s/config_upgrade.cpp
+++ b/src/mongo/s/config_upgrade.cpp
@@ -49,6 +49,12 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::make_pair;
+ using std::map;
+ using std::string;
+ using std::vector;
+
using mongoutils::str::stream;
//
diff --git a/src/mongo/s/config_upgrade_helpers.cpp b/src/mongo/s/config_upgrade_helpers.cpp
index b678052c7b1..8c5e10fd18c 100644
--- a/src/mongo/s/config_upgrade_helpers.cpp
+++ b/src/mongo/s/config_upgrade_helpers.cpp
@@ -45,6 +45,10 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+
using mongoutils::str::stream;
// Custom field used in upgrade state to determine if/where we failed on last upgrade
diff --git a/src/mongo/s/config_upgrade_v0_to_v6.cpp b/src/mongo/s/config_upgrade_v0_to_v6.cpp
index c928f9d7fa0..e27b85eebc8 100644
--- a/src/mongo/s/config_upgrade_v0_to_v6.cpp
+++ b/src/mongo/s/config_upgrade_v0_to_v6.cpp
@@ -40,6 +40,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
using mongo::str::stream;
/**
diff --git a/src/mongo/s/config_upgrade_v5_to_v6.cpp b/src/mongo/s/config_upgrade_v5_to_v6.cpp
index 4559cfa1f1e..7f3cda8dfa2 100644
--- a/src/mongo/s/config_upgrade_v5_to_v6.cpp
+++ b/src/mongo/s/config_upgrade_v5_to_v6.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
static const char* minMongoProcessVersion = "2.6";
static const char* cannotCleanupMessage =
diff --git a/src/mongo/s/cursors.cpp b/src/mongo/s/cursors.cpp
index 4e71c0a6ac9..0f2e97866f9 100644
--- a/src/mongo/s/cursors.cpp
+++ b/src/mongo/s/cursors.cpp
@@ -55,6 +55,9 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::string;
+ using std::stringstream;
const int ShardedClientCursor::INIT_REPLY_BUFFER_SIZE = 32768;
diff --git a/src/mongo/s/d_merge.cpp b/src/mongo/s/d_merge.cpp
index 87682902f8e..cf59ffafa11 100644
--- a/src/mongo/s/d_merge.cpp
+++ b/src/mongo/s/d_merge.cpp
@@ -41,6 +41,8 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
using std::string;
using mongoutils::str::stream;
diff --git a/src/mongo/s/d_split.cpp b/src/mongo/s/d_split.cpp
index c984f8c350f..56d59e4ffd1 100644
--- a/src/mongo/s/d_split.cpp
+++ b/src/mongo/s/d_split.cpp
@@ -62,6 +62,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::ostringstream;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
class CmdMedianKey : public Command {
public:
CmdMedianKey() : Command( "medianKey" ) {}
diff --git a/src/mongo/s/d_state.cpp b/src/mongo/s/d_state.cpp
index 88aee91fa74..4e60b4b2aeb 100644
--- a/src/mongo/s/d_state.cpp
+++ b/src/mongo/s/d_state.cpp
@@ -68,6 +68,11 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
// -----ShardingState START ----
ShardingState::ShardingState()
diff --git a/src/mongo/s/dbclient_multi_command.cpp b/src/mongo/s/dbclient_multi_command.cpp
index 286789e2c0d..8454b99067c 100644
--- a/src/mongo/s/dbclient_multi_command.cpp
+++ b/src/mongo/s/dbclient_multi_command.cpp
@@ -43,6 +43,8 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::deque;
+ using std::string;
DBClientMultiCommand::PendingCommand::PendingCommand( const ConnectionString& endpoint,
const StringData& dbName,
diff --git a/src/mongo/s/dbclient_shard_resolver.cpp b/src/mongo/s/dbclient_shard_resolver.cpp
index c3ed6da660f..9b86d5f0c6d 100644
--- a/src/mongo/s/dbclient_shard_resolver.cpp
+++ b/src/mongo/s/dbclient_shard_resolver.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::string;
+
Status DBClientShardResolver::chooseWriteHost( const string& shardName,
ConnectionString* shardHost ) const {
diff --git a/src/mongo/s/default_version.cpp b/src/mongo/s/default_version.cpp
index 03422e94995..fd9657a76ac 100644
--- a/src/mongo/s/default_version.cpp
+++ b/src/mongo/s/default_version.cpp
@@ -37,6 +37,8 @@
namespace mongo {
+ using std::string;
+
// Global version manager
VersionManager versionManager;
diff --git a/src/mongo/s/distlock.cpp b/src/mongo/s/distlock.cpp
index 0fcb83de97c..02a60a34fd1 100644
--- a/src/mongo/s/distlock.cpp
+++ b/src/mongo/s/distlock.cpp
@@ -46,6 +46,13 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
LabeledLevel DistributedLock::logLvl( 1 );
DistributedLock::LastPings DistributedLock::lastPings;
diff --git a/src/mongo/s/distlock_test.cpp b/src/mongo/s/distlock_test.cpp
index f8fe2c10edf..21e9711c4a3 100644
--- a/src/mongo/s/distlock_test.cpp
+++ b/src/mongo/s/distlock_test.cpp
@@ -77,6 +77,10 @@
namespace mongo {
using boost::shared_ptr;
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
class TestDistLockWithSync: public Command {
public:
diff --git a/src/mongo/s/grid.cpp b/src/mongo/s/grid.cpp
index 2701efefb2c..53873173070 100644
--- a/src/mongo/s/grid.cpp
+++ b/src/mongo/s/grid.cpp
@@ -57,6 +57,16 @@
namespace mongo {
+ using std::endl;
+ using std::istringstream;
+ using std::map;
+ using std::ostringstream;
+ using std::set;
+ using std::setfill;
+ using std::setw;
+ using std::stringstream;
+ using std::vector;
+
MONGO_FP_DECLARE(neverBalance);
DBConfigPtr Grid::getDBConfig( const StringData& ns , bool create , const string& shardNameHint ) {
diff --git a/src/mongo/s/metadata_loader.cpp b/src/mongo/s/metadata_loader.cpp
index ad4837ecb21..d09d51cd5f8 100644
--- a/src/mongo/s/metadata_loader.cpp
+++ b/src/mongo/s/metadata_loader.cpp
@@ -45,6 +45,11 @@
namespace mongo {
+ using std::make_pair;
+ using std::map;
+ using std::pair;
+ using std::string;
+
/**
* This is an adapter so we can use config diffs - mongos and mongod do them slightly
* differently.
diff --git a/src/mongo/s/mongos_options.cpp b/src/mongo/s/mongos_options.cpp
index f2cb244009d..b84cd44365f 100644
--- a/src/mongo/s/mongos_options.cpp
+++ b/src/mongo/s/mongos_options.cpp
@@ -50,6 +50,8 @@
namespace mongo {
+ using std::endl;
+
MongosGlobalParams mongosGlobalParams;
Status addMongosOptions(moe::OptionSection* options) {
diff --git a/src/mongo/s/multi_host_query.cpp b/src/mongo/s/multi_host_query.cpp
index d62f63e098c..451b764cde4 100644
--- a/src/mongo/s/multi_host_query.cpp
+++ b/src/mongo/s/multi_host_query.cpp
@@ -37,6 +37,10 @@
namespace mongo {
using boost::shared_ptr;
+ using std::make_pair;
+ using std::string;
+ using std::vector;
+
typedef boost::unique_lock<boost::mutex> boost_unique_lock;
HostThreadPool::HostThreadPool(int poolSize, bool scopeAllWork) :
diff --git a/src/mongo/s/multi_host_query_test.cpp b/src/mongo/s/multi_host_query_test.cpp
index e2dde9b3619..5c98bb0519e 100644
--- a/src/mongo/s/multi_host_query_test.cpp
+++ b/src/mongo/s/multi_host_query_test.cpp
@@ -39,7 +39,10 @@ namespace {
using namespace mongo;
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::make_pair;
using std::map;
+ using std::string;
+ using std::vector;
class CallbackCheck {
public:
diff --git a/src/mongo/s/request.cpp b/src/mongo/s/request.cpp
index 9926f5316a2..ac2a6781eae 100644
--- a/src/mongo/s/request.cpp
+++ b/src/mongo/s/request.cpp
@@ -50,6 +50,9 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+
Request::Request( Message& m, AbstractMessagingPort* p ) :
_m(m) , _d( m ) , _p(p) , _didInit(false) {
diff --git a/src/mongo/s/s_only.cpp b/src/mongo/s/s_only.cpp
index cfd590f03b7..e203cf23e6e 100644
--- a/src/mongo/s/s_only.cpp
+++ b/src/mongo/s/s_only.cpp
@@ -54,6 +54,10 @@
*/
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+
void* remapPrivateView(void *oldPrivateAddr) {
log() << "remapPrivateView called in mongos, aborting" << endl;
fassertFailed(16462);
diff --git a/src/mongo/s/scc_fast_query_handler.cpp b/src/mongo/s/scc_fast_query_handler.cpp
index c83017f46ef..0db1a4e4ad4 100644
--- a/src/mongo/s/scc_fast_query_handler.cpp
+++ b/src/mongo/s/scc_fast_query_handler.cpp
@@ -43,6 +43,11 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
/**
* This parameter turns on fastest config reads for auth data only - *.system.users collections
* and the "usersInfo" command. This should be enough to prevent a non-responsive config from
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp
index 8070e430177..491ac90eaa6 100644
--- a/src/mongo/s/server.cpp
+++ b/src/mongo/s/server.cpp
@@ -95,6 +95,11 @@
namespace mongo {
+ using std::cout;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
using logger::LogComponent;
#if defined(_WIN32)
diff --git a/src/mongo/s/shard.cpp b/src/mongo/s/shard.cpp
index 43bcb57c0a9..1eb082b7898 100644
--- a/src/mongo/s/shard.cpp
+++ b/src/mongo/s/shard.cpp
@@ -60,6 +60,15 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::list;
+ using std::map;
+ using std::ostream;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
static bool initWireVersion( DBClientBase* conn, std::string* errMsg ) {
BSONObj response;
if ( !conn->runCommand( "admin", BSON("isMaster" << 1), response )) {
diff --git a/src/mongo/s/shard_key_pattern.cpp b/src/mongo/s/shard_key_pattern.cpp
index 3f753a0e3ba..f413be24efa 100644
--- a/src/mongo/s/shard_key_pattern.cpp
+++ b/src/mongo/s/shard_key_pattern.cpp
@@ -48,6 +48,8 @@ namespace mongo {
using std::pair;
using std::make_pair;
using std::vector;
+ using std::string;
+
using pathsupport::EqualityMatches;
using mongoutils::str::stream;
diff --git a/src/mongo/s/shard_key_pattern_test.cpp b/src/mongo/s/shard_key_pattern_test.cpp
index 7410cc3dd60..c90e313ce26 100644
--- a/src/mongo/s/shard_key_pattern_test.cpp
+++ b/src/mongo/s/shard_key_pattern_test.cpp
@@ -33,6 +33,8 @@
namespace {
+ using std::string;
+
using namespace mongo;
TEST(ShardKeyPattern, ValidShardKeyPatternSingle) {
diff --git a/src/mongo/s/shardconnection.cpp b/src/mongo/s/shardconnection.cpp
index 2ba89122092..1500553a60a 100644
--- a/src/mongo/s/shardconnection.cpp
+++ b/src/mongo/s/shardconnection.cpp
@@ -56,6 +56,14 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::endl;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
DBConnectionPool shardConnectionPool;
class ClientConnections;
diff --git a/src/mongo/s/strategy.cpp b/src/mongo/s/strategy.cpp
index 9d2af5515f1..8b80c304c76 100644
--- a/src/mongo/s/strategy.cpp
+++ b/src/mongo/s/strategy.cpp
@@ -72,6 +72,11 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
static bool _isSystemIndexes( const char* ns ) {
return nsToCollectionSubstring(ns) == "system.indexes";
diff --git a/src/mongo/s/type_actionlog.cpp b/src/mongo/s/type_actionlog.cpp
index 0b4e7303a92..be661ac5a27 100644
--- a/src/mongo/s/type_actionlog.cpp
+++ b/src/mongo/s/type_actionlog.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongo::str::stream;
const std::string ActionLogType::ConfigNS = "config.actionlog";
diff --git a/src/mongo/s/type_changelog.cpp b/src/mongo/s/type_changelog.cpp
index 7dc3ded0ffe..b4e68dba532 100644
--- a/src/mongo/s/type_changelog.cpp
+++ b/src/mongo/s/type_changelog.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string ChangelogType::ConfigNS = "config.changelog";
diff --git a/src/mongo/s/type_chunk.cpp b/src/mongo/s/type_chunk.cpp
index fc592cb7b8a..4a1c1f9b3cd 100644
--- a/src/mongo/s/type_chunk.cpp
+++ b/src/mongo/s/type_chunk.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string ChunkType::ConfigNS = "config.chunks";
diff --git a/src/mongo/s/type_collection.cpp b/src/mongo/s/type_collection.cpp
index 59013b17716..7665b36b9be 100644
--- a/src/mongo/s/type_collection.cpp
+++ b/src/mongo/s/type_collection.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string CollectionType::ConfigNS = "config.collections";
diff --git a/src/mongo/s/type_config_version.cpp b/src/mongo/s/type_config_version.cpp
index 4d7418f98b3..8f9c47f8d77 100644
--- a/src/mongo/s/type_config_version.cpp
+++ b/src/mongo/s/type_config_version.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string VersionType::ConfigNS = "config.version";
diff --git a/src/mongo/s/type_database.cpp b/src/mongo/s/type_database.cpp
index e329caaed6c..cae63e92028 100644
--- a/src/mongo/s/type_database.cpp
+++ b/src/mongo/s/type_database.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string DatabaseType::ConfigNS = "config.databases";
diff --git a/src/mongo/s/type_lockpings.cpp b/src/mongo/s/type_lockpings.cpp
index 9752dbf70e5..853a76dd010 100644
--- a/src/mongo/s/type_lockpings.cpp
+++ b/src/mongo/s/type_lockpings.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string LockpingsType::ConfigNS = "config.lockpings";
diff --git a/src/mongo/s/type_locks.cpp b/src/mongo/s/type_locks.cpp
index 68f79b0e465..309b2efd89a 100644
--- a/src/mongo/s/type_locks.cpp
+++ b/src/mongo/s/type_locks.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string LocksType::ConfigNS = "config.locks";
diff --git a/src/mongo/s/type_mongos.cpp b/src/mongo/s/type_mongos.cpp
index 1dfc425ddad..0ff363cbc86 100644
--- a/src/mongo/s/type_mongos.cpp
+++ b/src/mongo/s/type_mongos.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string MongosType::ConfigNS = "config.mongos";
diff --git a/src/mongo/s/type_settings.cpp b/src/mongo/s/type_settings.cpp
index 2c2f12bc7bd..dc6f0deca50 100644
--- a/src/mongo/s/type_settings.cpp
+++ b/src/mongo/s/type_settings.cpp
@@ -34,6 +34,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
using mongoutils::str::stream;
const std::string SettingsType::ConfigNS = "config.settings";
diff --git a/src/mongo/s/type_shard.cpp b/src/mongo/s/type_shard.cpp
index 2b9a4012696..5e38406a2fe 100644
--- a/src/mongo/s/type_shard.cpp
+++ b/src/mongo/s/type_shard.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string ShardType::ConfigNS = "config.shards";
diff --git a/src/mongo/s/type_tags.cpp b/src/mongo/s/type_tags.cpp
index 15f72ed9208..a312052a72b 100644
--- a/src/mongo/s/type_tags.cpp
+++ b/src/mongo/s/type_tags.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string TagsType::ConfigNS = "config.tags";
diff --git a/src/mongo/s/version_manager.cpp b/src/mongo/s/version_manager.cpp
index 98b9d62ae34..7e8d34091e8 100644
--- a/src/mongo/s/version_manager.cpp
+++ b/src/mongo/s/version_manager.cpp
@@ -44,6 +44,10 @@
namespace mongo {
+ using std::endl;
+ using std::map;
+ using std::string;
+
// Global version manager
VersionManager versionManager;
diff --git a/src/mongo/s/write_ops/batch_downconvert.cpp b/src/mongo/s/write_ops/batch_downconvert.cpp
index 24958bce2e6..b6ca7bc6c44 100644
--- a/src/mongo/s/write_ops/batch_downconvert.cpp
+++ b/src/mongo/s/write_ops/batch_downconvert.cpp
@@ -39,6 +39,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::vector;
+
Status extractGLEErrors( const BSONObj& gleResponse, GLEErrors* errors ) {
// DRAGONS
diff --git a/src/mongo/s/write_ops/batch_upconvert.cpp b/src/mongo/s/write_ops/batch_upconvert.cpp
index abe12d9d7af..cdfd915fa33 100644
--- a/src/mongo/s/write_ops/batch_upconvert.cpp
+++ b/src/mongo/s/write_ops/batch_upconvert.cpp
@@ -44,6 +44,8 @@ namespace mongo {
using boost::scoped_ptr;
using mongoutils::str::stream;
+ using std::auto_ptr;
+ using std::string;
using std::vector;
void msgToBatchRequests( const Message& msg, vector<BatchedCommandRequest*>* requests ) {
diff --git a/src/mongo/s/write_ops/batch_upconvert_test.cpp b/src/mongo/s/write_ops/batch_upconvert_test.cpp
index 5b8da5293f2..12c60982da1 100644
--- a/src/mongo/s/write_ops/batch_upconvert_test.cpp
+++ b/src/mongo/s/write_ops/batch_upconvert_test.cpp
@@ -40,6 +40,9 @@
namespace {
+ using std::string;
+ using std::vector;
+
using namespace mongo;
TEST(WriteBatchUpconvert, BasicInsert) {
diff --git a/src/mongo/s/write_ops/batch_write_exec.cpp b/src/mongo/s/write_ops/batch_write_exec.cpp
index 1cd9c86446f..b46c70b1426 100644
--- a/src/mongo/s/write_ops/batch_write_exec.cpp
+++ b/src/mongo/s/write_ops/batch_write_exec.cpp
@@ -43,6 +43,11 @@
namespace mongo {
+ using std::endl;
+ using std::make_pair;
+ using std::stringstream;
+ using std::vector;
+
BatchWriteExec::BatchWriteExec( NSTargeter* targeter,
ShardResolver* resolver,
MultiCommandDispatch* dispatcher ) :
diff --git a/src/mongo/s/write_ops/batch_write_exec_test.cpp b/src/mongo/s/write_ops/batch_write_exec_test.cpp
index b0e069fd796..278d2bf4f8d 100644
--- a/src/mongo/s/write_ops/batch_write_exec_test.cpp
+++ b/src/mongo/s/write_ops/batch_write_exec_test.cpp
@@ -41,6 +41,9 @@
namespace {
using boost::scoped_ptr;
+ using std::string;
+ using std::vector;
+
using namespace mongo;
/**
diff --git a/src/mongo/s/write_ops/batch_write_op.cpp b/src/mongo/s/write_ops/batch_write_op.cpp
index 15de4a1fd6b..d695d93afb9 100644
--- a/src/mongo/s/write_ops/batch_write_op.cpp
+++ b/src/mongo/s/write_ops/batch_write_op.cpp
@@ -32,6 +32,12 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::make_pair;
+ using std::set;
+ using std::stringstream;
+ using std::vector;
+
/**
* Returns a new write concern that has the copy of every field from the original
* document but with a w set to 1. This is intended for upgrading { w: 0 } write
diff --git a/src/mongo/s/write_ops/batch_write_op_test.cpp b/src/mongo/s/write_ops/batch_write_op_test.cpp
index 7170b6f5ce7..4c55036627c 100644
--- a/src/mongo/s/write_ops/batch_write_op_test.cpp
+++ b/src/mongo/s/write_ops/batch_write_op_test.cpp
@@ -37,6 +37,10 @@
namespace {
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
+
using namespace mongo;
static void initTargeterFullRange( const NamespaceString& nss,
diff --git a/src/mongo/s/write_ops/batched_command_request.cpp b/src/mongo/s/write_ops/batched_command_request.cpp
index 4c3065a2643..bbf8dee717a 100644
--- a/src/mongo/s/write_ops/batched_command_request.cpp
+++ b/src/mongo/s/write_ops/batched_command_request.cpp
@@ -33,6 +33,10 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+ using std::vector;
+
const size_t BatchedCommandRequest::kMaxWriteBatchSize = 1000;
BatchedCommandRequest::BatchedCommandRequest( BatchType batchType ) :
diff --git a/src/mongo/s/write_ops/batched_command_response.cpp b/src/mongo/s/write_ops/batched_command_response.cpp
index 42f2b2f22d3..3928e1b4812 100644
--- a/src/mongo/s/write_ops/batched_command_response.cpp
+++ b/src/mongo/s/write_ops/batched_command_response.cpp
@@ -33,6 +33,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
using mongoutils::str::stream;
const BSONField<int> BatchedCommandResponse::ok("ok");
diff --git a/src/mongo/s/write_ops/batched_delete_document.cpp b/src/mongo/s/write_ops/batched_delete_document.cpp
index ace1611d77b..e12e5ad7a86 100644
--- a/src/mongo/s/write_ops/batched_delete_document.cpp
+++ b/src/mongo/s/write_ops/batched_delete_document.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const BSONField<BSONObj> BatchedDeleteDocument::query("q");
const BSONField<int> BatchedDeleteDocument::limit("limit");
diff --git a/src/mongo/s/write_ops/batched_delete_request.cpp b/src/mongo/s/write_ops/batched_delete_request.cpp
index d17dfc03a1e..eea7820d76e 100644
--- a/src/mongo/s/write_ops/batched_delete_request.cpp
+++ b/src/mongo/s/write_ops/batched_delete_request.cpp
@@ -33,6 +33,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
using mongoutils::str::stream;
const std::string BatchedDeleteRequest::BATCHED_DELETE_REQUEST = "delete";
diff --git a/src/mongo/s/write_ops/batched_insert_request.cpp b/src/mongo/s/write_ops/batched_insert_request.cpp
index 308298bef6f..7236b4418e5 100644
--- a/src/mongo/s/write_ops/batched_insert_request.cpp
+++ b/src/mongo/s/write_ops/batched_insert_request.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const std::string BatchedInsertRequest::BATCHED_INSERT_REQUEST = "insert";
diff --git a/src/mongo/s/write_ops/batched_request_metadata.cpp b/src/mongo/s/write_ops/batched_request_metadata.cpp
index 63b51e4ab95..cdd6ae55ffe 100644
--- a/src/mongo/s/write_ops/batched_request_metadata.cpp
+++ b/src/mongo/s/write_ops/batched_request_metadata.cpp
@@ -32,6 +32,7 @@
namespace mongo {
+ using std::auto_ptr;
using std::string;
const BSONField<string> BatchedRequestMetadata::shardName("shardName");
diff --git a/src/mongo/s/write_ops/batched_update_document.cpp b/src/mongo/s/write_ops/batched_update_document.cpp
index 792592df29f..ffebede8787 100644
--- a/src/mongo/s/write_ops/batched_update_document.cpp
+++ b/src/mongo/s/write_ops/batched_update_document.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const BSONField<BSONObj> BatchedUpdateDocument::query("q");
diff --git a/src/mongo/s/write_ops/batched_update_request.cpp b/src/mongo/s/write_ops/batched_update_request.cpp
index 5fe1ecb0978..fbb12af2038 100644
--- a/src/mongo/s/write_ops/batched_update_request.cpp
+++ b/src/mongo/s/write_ops/batched_update_request.cpp
@@ -33,6 +33,9 @@
namespace mongo {
+ using std::auto_ptr;
+ using std::string;
+
using mongoutils::str::stream;
const std::string BatchedUpdateRequest::BATCHED_UPDATE_REQUEST = "update";
diff --git a/src/mongo/s/write_ops/batched_upsert_detail.cpp b/src/mongo/s/write_ops/batched_upsert_detail.cpp
index b753c99a180..d6764a22c39 100644
--- a/src/mongo/s/write_ops/batched_upsert_detail.cpp
+++ b/src/mongo/s/write_ops/batched_upsert_detail.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const BSONField<int> BatchedUpsertDetail::index("index");
diff --git a/src/mongo/s/write_ops/config_coordinator.cpp b/src/mongo/s/write_ops/config_coordinator.cpp
index 131ac1ca980..ca36cbe1562 100644
--- a/src/mongo/s/write_ops/config_coordinator.cpp
+++ b/src/mongo/s/write_ops/config_coordinator.cpp
@@ -39,6 +39,8 @@
namespace mongo {
+ using std::string;
+ using std::vector;
ConfigCoordinator::ConfigCoordinator( MultiCommandDispatch* dispatcher,
const vector<ConnectionString>& configHosts ) :
diff --git a/src/mongo/s/write_ops/wc_error_detail.cpp b/src/mongo/s/write_ops/wc_error_detail.cpp
index bc6d6cf7f2e..04dde3a8346 100644
--- a/src/mongo/s/write_ops/wc_error_detail.cpp
+++ b/src/mongo/s/write_ops/wc_error_detail.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const BSONField<int> WCErrorDetail::errCode("code");
const BSONField<BSONObj> WCErrorDetail::errInfo("errInfo");
diff --git a/src/mongo/s/write_ops/write_error_detail.cpp b/src/mongo/s/write_ops/write_error_detail.cpp
index c9f323e2d97..65f949b411c 100644
--- a/src/mongo/s/write_ops/write_error_detail.cpp
+++ b/src/mongo/s/write_ops/write_error_detail.cpp
@@ -33,6 +33,8 @@
namespace mongo {
+ using std::string;
+
using mongoutils::str::stream;
const BSONField<int> WriteErrorDetail::index("index");
const BSONField<int> WriteErrorDetail::errCode("code");
diff --git a/src/mongo/s/write_ops/write_op.cpp b/src/mongo/s/write_ops/write_op.cpp
index f8097154ce2..9532922237f 100644
--- a/src/mongo/s/write_ops/write_op.cpp
+++ b/src/mongo/s/write_ops/write_op.cpp
@@ -34,6 +34,9 @@
namespace mongo {
+ using std::stringstream;
+ using std::vector;
+
static void clear( vector<ChildWriteOp*>* childOps ) {
for ( vector<ChildWriteOp*>::const_iterator it = childOps->begin(); it != childOps->end();
++it ) {
diff --git a/src/mongo/s/write_ops/write_op_test.cpp b/src/mongo/s/write_ops/write_op_test.cpp
index 5559b49d3ec..669220c6d24 100644
--- a/src/mongo/s/write_ops/write_op_test.cpp
+++ b/src/mongo/s/write_ops/write_op_test.cpp
@@ -41,6 +41,9 @@
namespace {
using boost::scoped_ptr;
+ using std::string;
+ using std::vector;
+
using namespace mongo;
WriteErrorDetail* buildError( int code, const BSONObj& info, const string& message ) {
diff --git a/src/mongo/scripting/bson_template_evaluator.cpp b/src/mongo/scripting/bson_template_evaluator.cpp
index 03a914994ae..8b6e42756a2 100644
--- a/src/mongo/scripting/bson_template_evaluator.cpp
+++ b/src/mongo/scripting/bson_template_evaluator.cpp
@@ -36,6 +36,8 @@
namespace mongo {
+ using std::string;
+
void BsonTemplateEvaluator::initializeEvaluator() {
addOperator("RAND_INT", &BsonTemplateEvaluator::evalRandInt);
addOperator("RAND_INT_PLUS_THREAD", &BsonTemplateEvaluator::evalRandPlusThread);
diff --git a/src/mongo/scripting/bson_template_evaluator_test.cpp b/src/mongo/scripting/bson_template_evaluator_test.cpp
index 5e4929a6bfe..5321ee02b7a 100644
--- a/src/mongo/scripting/bson_template_evaluator_test.cpp
+++ b/src/mongo/scripting/bson_template_evaluator_test.cpp
@@ -32,6 +32,8 @@
namespace mongo {
+ using std::string;
+
namespace {
void common_rand_tests(string op, BsonTemplateEvaluator *t) {
diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp
index 408beb4b2a8..fda84b41eec 100644
--- a/src/mongo/scripting/engine.cpp
+++ b/src/mongo/scripting/engine.cpp
@@ -51,6 +51,10 @@ namespace mongo {
using boost::scoped_ptr;
using boost::shared_ptr;
+ using std::auto_ptr;
+ using std::endl;
+ using std::set;
+ using std::string;
long long Scope::_lastVersion = 1;
@@ -356,7 +360,7 @@ namespace {
static const unsigned kMaxPoolSize = 10;
static const int kMaxScopeReuse = 10;
- typedef deque<ScopeAndPool> Pools; // More-recently used Scopes are kept at the front.
+ typedef std::deque<ScopeAndPool> Pools; // More-recently used Scopes are kept at the front.
Pools _pools; // protected by _mutex
mongo::mutex _mutex;
};
diff --git a/src/mongo/scripting/engine_v8.cpp b/src/mongo/scripting/engine_v8.cpp
index a5a61342e2d..559a2c29def 100644
--- a/src/mongo/scripting/engine_v8.cpp
+++ b/src/mongo/scripting/engine_v8.cpp
@@ -49,6 +49,12 @@ using namespace mongoutils;
namespace mongo {
+ using std::cout;
+ using std::endl;
+ using std::map;
+ using std::string;
+ using std::stringstream;
+
#ifndef _MSC_EXTENSIONS
const int V8Scope::objectDepthLimit;
#endif
diff --git a/src/mongo/scripting/v8_deadline_monitor_test.cpp b/src/mongo/scripting/v8_deadline_monitor_test.cpp
index dd052e8d0e9..4a9fe5a966d 100644
--- a/src/mongo/scripting/v8_deadline_monitor_test.cpp
+++ b/src/mongo/scripting/v8_deadline_monitor_test.cpp
@@ -42,6 +42,7 @@
namespace mongo {
using boost::shared_ptr;
+ using std::vector;
class TaskGroup {
public:
diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp
index 2bdaf2f1929..069af0ee7c7 100644
--- a/src/mongo/shell/bench.cpp
+++ b/src/mongo/shell/bench.cpp
@@ -76,6 +76,11 @@ namespace {
namespace mongo {
+ using std::auto_ptr;
+ using std::cout;
+ using std::endl;
+ using std::map;
+
BenchRunEventCounter::BenchRunEventCounter() {
reset();
}
diff --git a/src/mongo/shell/shell_options.cpp b/src/mongo/shell/shell_options.cpp
index a1faa1051ce..f428a6b9697 100644
--- a/src/mongo/shell/shell_options.cpp
+++ b/src/mongo/shell/shell_options.cpp
@@ -45,6 +45,11 @@
namespace mongo {
+ using std::cout;
+ using std::endl;
+ using std::string;
+ using std::vector;
+
ShellGlobalParams shellGlobalParams;
Status addMongoShellOptions(moe::OptionSection* options) {
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp
index 159199b8e49..ee489a75dd4 100644
--- a/src/mongo/shell/shell_utils.cpp
+++ b/src/mongo/shell/shell_utils.cpp
@@ -47,6 +47,10 @@
namespace mongo {
+ using std::set;
+ using std::map;
+ using std::string;
+
namespace JSFiles {
extern const JSFile servers;
extern const JSFile mongodtest;
diff --git a/src/mongo/shell/shell_utils_extended.cpp b/src/mongo/shell/shell_utils_extended.cpp
index 5080a37fddf..466c64940c2 100644
--- a/src/mongo/shell/shell_utils_extended.cpp
+++ b/src/mongo/shell/shell_utils_extended.cpp
@@ -50,6 +50,10 @@
namespace mongo {
+ using std::ifstream;
+ using std::string;
+ using std::stringstream;
+
/**
* These utilities are thread safe but do not provide mutually exclusive access to resources
* identified by the caller. Dependent filesystem paths should not be accessed by different
@@ -158,7 +162,7 @@ namespace mongo {
ifstream f(e.valuestrsafe());
uassert(CANT_OPEN_FILE, "couldn't open file", f.is_open() );
- streamsize sz = 0;
+ std::streamsize sz = 0;
while( 1 ) {
char ch = 0;
// slow...maybe change one day
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
index fde3da7b9eb..96f3c7bbdd3 100644
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -64,6 +64,14 @@
namespace mongo {
using boost::scoped_array;
+ using std::cout;
+ using std::endl;
+ using std::make_pair;
+ using std::map;
+ using std::pair;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
extern bool dbexitCalled;
diff --git a/src/mongo/unittest/temp_dir.cpp b/src/mongo/unittest/temp_dir.cpp
index ee21dcacf90..55850bad7bd 100644
--- a/src/mongo/unittest/temp_dir.cpp
+++ b/src/mongo/unittest/temp_dir.cpp
@@ -43,6 +43,9 @@
namespace mongo {
+
+ using std::string;
+
namespace unittest {
namespace str = mongoutils::str;
namespace moe = mongo::optionenvironment;
diff --git a/src/mongo/unittest/unittest.cpp b/src/mongo/unittest/unittest.cpp
index 91b334badd4..70bb590a3d1 100644
--- a/src/mongo/unittest/unittest.cpp
+++ b/src/mongo/unittest/unittest.cpp
@@ -52,6 +52,7 @@
namespace mongo {
using boost::shared_ptr;
+ using std::string;
namespace unittest {
diff --git a/src/mongo/util/base64.cpp b/src/mongo/util/base64.cpp
index cd7218c368f..04216eb0b64 100644
--- a/src/mongo/util/base64.cpp
+++ b/src/mongo/util/base64.cpp
@@ -36,6 +36,10 @@
#include "mongo/util/base64.h"
namespace mongo {
+
+ using std::string;
+ using std::stringstream;
+
namespace base64 {
Alphabet alphabet;
diff --git a/src/mongo/util/concurrency/task.cpp b/src/mongo/util/concurrency/task.cpp
index 8c33c5b7bfe..a991334c479 100644
--- a/src/mongo/util/concurrency/task.cpp
+++ b/src/mongo/util/concurrency/task.cpp
@@ -47,6 +47,9 @@
namespace mongo {
+ using std::cout;
+ using std::endl;
+
namespace task {
/*void foo() {
diff --git a/src/mongo/util/concurrency/thread_name.cpp b/src/mongo/util/concurrency/thread_name.cpp
index 87d4ec195f1..1d9fe2ff201 100644
--- a/src/mongo/util/concurrency/thread_name.cpp
+++ b/src/mongo/util/concurrency/thread_name.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
namespace {
boost::thread_specific_ptr<std::string> _threadName;
diff --git a/src/mongo/util/concurrency/thread_pool.cpp b/src/mongo/util/concurrency/thread_pool.cpp
index 137b7d6f3a5..bb01bc4c6d2 100644
--- a/src/mongo/util/concurrency/thread_pool.cpp
+++ b/src/mongo/util/concurrency/thread_pool.cpp
@@ -47,6 +47,8 @@
namespace mongo {
namespace threadpool {
+ using std::endl;
+
// Worker thread
class Worker : boost::noncopyable {
public:
diff --git a/src/mongo/util/fail_point.cpp b/src/mongo/util/fail_point.cpp
index 4e8a13dc483..424e2c27ad5 100644
--- a/src/mongo/util/fail_point.cpp
+++ b/src/mongo/util/fail_point.cpp
@@ -34,6 +34,8 @@
#include "mongo/util/log.h"
#include "mongo/util/time_support.h"
+using std::endl;
+
using mongoutils::str::stream;
namespace mongo {
diff --git a/src/mongo/util/fail_point_registry.cpp b/src/mongo/util/fail_point_registry.cpp
index f58f7a55af3..99ff384b8c0 100644
--- a/src/mongo/util/fail_point_registry.cpp
+++ b/src/mongo/util/fail_point_registry.cpp
@@ -34,6 +34,9 @@
using mongoutils::str::stream;
namespace mongo {
+
+ using std::string;
+
FailPointRegistry::FailPointRegistry(): _frozen(false) {
}
diff --git a/src/mongo/util/file_allocator.cpp b/src/mongo/util/file_allocator.cpp
index 319d6fddfd0..2adbba1a020 100644
--- a/src/mongo/util/file_allocator.cpp
+++ b/src/mongo/util/file_allocator.cpp
@@ -71,6 +71,11 @@ using namespace mongoutils;
namespace mongo {
+ using std::endl;
+ using std::list;
+ using std::string;
+ using std::stringstream;
+
// unique number for temporary file names
unsigned long long FileAllocator::_uniqueNumber = 0;
static SimpleMutex _uniqueNumberMutex( "uniqueNumberMutex" );
diff --git a/src/mongo/util/hex.cpp b/src/mongo/util/hex.cpp
index 3d6c1b45f86..d1170e5e768 100644
--- a/src/mongo/util/hex.cpp
+++ b/src/mongo/util/hex.cpp
@@ -70,7 +70,7 @@ namespace mongo {
template<> std::string integerToHex<unsigned long long>(unsigned long long val) { return integerToHexDef(val); }
- string hexdump(const char *data, unsigned len) {
+ std::string hexdump(const char *data, unsigned len) {
verify( len < 1000000 );
const unsigned char *p = (const unsigned char *) data;
std::stringstream ss;
diff --git a/src/mongo/util/logfile.cpp b/src/mongo/util/logfile.cpp
index 37064fba587..5e8f185bc4c 100644
--- a/src/mongo/util/logfile.cpp
+++ b/src/mongo/util/logfile.cpp
@@ -48,6 +48,9 @@
using namespace mongoutils;
+using std::endl;
+using std::string;
+
namespace mongo {
struct LogfileTest : public StartupTest {
LogfileTest() { }
@@ -140,7 +143,7 @@ namespace mongo {
const char *buf = (const char *) _buf;
size_t left = _len;
while( left ) {
- size_t toWrite = min(left, BlockSize);
+ size_t toWrite = std::min(left, BlockSize);
DWORD written;
if( !WriteFile(_fd, buf, toWrite, &written, NULL) ) {
DWORD e = GetLastError();
diff --git a/src/mongo/util/mmap.cpp b/src/mongo/util/mmap.cpp
index 917fff03327..6ccadbe7f6d 100644
--- a/src/mongo/util/mmap.cpp
+++ b/src/mongo/util/mmap.cpp
@@ -49,6 +49,13 @@
namespace mongo {
+ using std::endl;
+ using std::map;
+ using std::set;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
void minOSPageSizeBytesTest(size_t minOSPageSizeBytes) {
fassert( 16325, minOSPageSizeBytes > 0 );
fassert( 16326, minOSPageSizeBytes < 1000000 );
diff --git a/src/mongo/util/mmap_posix.cpp b/src/mongo/util/mmap_posix.cpp
index 6b840928f3e..8d9f2a11caf 100644
--- a/src/mongo/util/mmap_posix.cpp
+++ b/src/mongo/util/mmap_posix.cpp
@@ -49,6 +49,10 @@
#include "mongo/util/processinfo.h"
#include "mongo/util/startup_test.h"
+using std::endl;
+using std::numeric_limits;
+using std::vector;
+
using namespace mongoutils;
namespace {
diff --git a/src/mongo/util/mmap_win.cpp b/src/mongo/util/mmap_win.cpp
index c1f6492561e..c40bf9a876e 100644
--- a/src/mongo/util/mmap_win.cpp
+++ b/src/mongo/util/mmap_win.cpp
@@ -45,6 +45,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::vector;
+
namespace {
mongo::AtomicUInt64 mmfNextId(0);
}
diff --git a/src/mongo/util/net/httpclient.cpp b/src/mongo/util/net/httpclient.cpp
index cf64d5f7447..ecea9bbba56 100644
--- a/src/mongo/util/net/httpclient.cpp
+++ b/src/mongo/util/net/httpclient.cpp
@@ -43,6 +43,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
//#define HD(x) cout << x << endl;
#define HD(x)
diff --git a/src/mongo/util/net/listen.cpp b/src/mongo/util/net/listen.cpp
index ea20d07e4e6..d15161645ac 100644
--- a/src/mongo/util/net/listen.cpp
+++ b/src/mongo/util/net/listen.cpp
@@ -76,6 +76,9 @@
namespace mongo {
using boost::shared_ptr;
+ using std::endl;
+ using std::string;
+ using std::vector;
// ----- Listener -------
@@ -286,7 +289,7 @@ namespace mongo {
}
#if defined(__linux__)
- _elapsedTime += max(ret, (int)(( 10000 - maxSelectTime.tv_usec ) / 1000));
+ _elapsedTime += std::max(ret, (int)(( 10000 - maxSelectTime.tv_usec ) / 1000));
#else
_elapsedTime += ret; // assume 1ms to grab connection. very rough
#endif
diff --git a/src/mongo/util/net/message_port.cpp b/src/mongo/util/net/message_port.cpp
index 4fc33df7dc4..2748c61fa67 100644
--- a/src/mongo/util/net/message_port.cpp
+++ b/src/mongo/util/net/message_port.cpp
@@ -58,6 +58,7 @@
namespace mongo {
using boost::shared_ptr;
+ using std::string;
// if you want trace output:
#define mmm(x)
diff --git a/src/mongo/util/net/message_server_port.cpp b/src/mongo/util/net/message_server_port.cpp
index df4d4a1ec3d..afcce360db4 100644
--- a/src/mongo/util/net/message_server_port.cpp
+++ b/src/mongo/util/net/message_server_port.cpp
@@ -63,6 +63,7 @@
namespace mongo {
using boost::scoped_ptr;
+ using std::endl;
namespace {
diff --git a/src/mongo/util/net/miniwebserver.cpp b/src/mongo/util/net/miniwebserver.cpp
index 92700291944..2cbc24e099b 100644
--- a/src/mongo/util/net/miniwebserver.cpp
+++ b/src/mongo/util/net/miniwebserver.cpp
@@ -42,6 +42,9 @@
namespace mongo {
using boost::shared_ptr;
+ using std::endl;
+ using std::stringstream;
+ using std::vector;
MiniWebServer::MiniWebServer(const string& name, const string &ip, int port)
: Listener(name, ip, port, false)
diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp
index 51581136620..233ebf5d9a3 100644
--- a/src/mongo/util/net/sock.cpp
+++ b/src/mongo/util/net/sock.cpp
@@ -61,6 +61,12 @@
namespace mongo {
+ using std::endl;
+ using std::pair;
+ using std::string;
+ using std::stringstream;
+ using std::vector;
+
MONGO_FP_DECLARE(throwSockExcep);
static bool ipv6 = false;
diff --git a/src/mongo/util/net/ssl_options.cpp b/src/mongo/util/net/ssl_options.cpp
index f49397f49e4..c6e33a8a32a 100644
--- a/src/mongo/util/net/ssl_options.cpp
+++ b/src/mongo/util/net/ssl_options.cpp
@@ -40,6 +40,8 @@
namespace mongo {
+ using std::string;
+
Status addSSLServerOptions(moe::OptionSection* options) {
options->addOptionChaining("net.ssl.sslOnNormalPorts", "sslOnNormalPorts", moe::Switch,
"use ssl on configured ports")
diff --git a/src/mongo/util/ntservice.cpp b/src/mongo/util/ntservice.cpp
index 88ed53de62e..eb19146bc65 100644
--- a/src/mongo/util/ntservice.cpp
+++ b/src/mongo/util/ntservice.cpp
@@ -48,6 +48,7 @@
#include "mongo/util/text.h"
#include "mongo/util/winutil.h"
+using std::string;
using std::wstring;
namespace mongo {
diff --git a/src/mongo/util/options_parser/environment.cpp b/src/mongo/util/options_parser/environment.cpp
index c85989c4c7c..1178b6e356f 100644
--- a/src/mongo/util/options_parser/environment.cpp
+++ b/src/mongo/util/options_parser/environment.cpp
@@ -39,6 +39,8 @@ namespace mongo {
namespace optionenvironment {
using boost::shared_ptr;
+ using std::string;
+ using std::type_info;
// Environment implementation
diff --git a/src/mongo/util/safe_num.cpp b/src/mongo/util/safe_num.cpp
index 437a1818f2c..d6f7f99a3da 100644
--- a/src/mongo/util/safe_num.cpp
+++ b/src/mongo/util/safe_num.cpp
@@ -38,6 +38,8 @@
namespace mongo {
+ using std::ostringstream;
+
SafeNum::SafeNum(const BSONElement& element) {
switch (element.type()) {
case NumberInt:
diff --git a/src/mongo/util/signal_handlers.cpp b/src/mongo/util/signal_handlers.cpp
index 51f7af74baf..6217ae9bc7b 100644
--- a/src/mongo/util/signal_handlers.cpp
+++ b/src/mongo/util/signal_handlers.cpp
@@ -65,6 +65,8 @@ namespace {
namespace mongo {
+ using std::endl;
+
/*
* WARNING: PLEASE READ BEFORE CHANGING THIS MODULE
*
diff --git a/src/mongo/util/stringutils.cpp b/src/mongo/util/stringutils.cpp
index ad9e6021424..85c7e8c3a87 100644
--- a/src/mongo/util/stringutils.cpp
+++ b/src/mongo/util/stringutils.cpp
@@ -36,6 +36,9 @@
namespace mongo {
+ using std::string;
+ using std::vector;
+
void splitStringDelim( const string& str , vector<string>* res , char delim ) {
if ( str.empty() )
return;
diff --git a/src/mongo/util/stringutils_test.cpp b/src/mongo/util/stringutils_test.cpp
index fef78254d34..12a93c7c8f6 100644
--- a/src/mongo/util/stringutils_test.cpp
+++ b/src/mongo/util/stringutils_test.cpp
@@ -34,6 +34,8 @@
namespace mongo {
+ using std::string;
+
TEST(Comparison, Basic) {
//
diff --git a/src/mongo/util/version.cpp b/src/mongo/util/version.cpp
index 160cc485829..0c5454ea014 100644
--- a/src/mongo/util/version.cpp
+++ b/src/mongo/util/version.cpp
@@ -37,6 +37,9 @@
namespace mongo {
+ using std::string;
+ using std::stringstream;
+
/* Approved formats for versionString:
* 1.2.3
* 1.2.3-pre-
diff --git a/src/mongo/util/version_reporting.cpp b/src/mongo/util/version_reporting.cpp
index 4eb57619b31..a82c1556fb0 100644
--- a/src/mongo/util/version_reporting.cpp
+++ b/src/mongo/util/version_reporting.cpp
@@ -46,6 +46,10 @@
namespace mongo {
+ using std::endl;
+ using std::string;
+ using std::stringstream;
+
void printGitVersion() { log() << "git version: " << gitVersion() << endl; }
const std::string openSSLVersion(const std::string &prefix, const std::string &suffix) {