[CXX-608] Permit default construction of client/db/collection Created: 04/Jun/15  Updated: 11/Jan/16  Resolved: 21/Oct/15

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 3.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: C++11 Driver MongoDB 3.2

 Description   

Per this SO post:

http://stackoverflow.com/questions/30330349/how-do-you-declare-a-variable-for-a-class-whose-constructor-takes-an-rvalue

There may be situations where it is useful to default construct a database, collection, or client. Such an object is not in a valid state, and should be equivalent to a moved-from object of the same type.

We should probably also provide an explicit operator bool so that one can test whether these vocabulary types are in valid states.



 Comments   
Comment by Githook User [ 21/Oct/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: CXX-608 Allow default construction of client, collection, database
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/23432ebebd3cd35314f683d82060c8f5f65a9f1b

Comment by Andrew Morrow (Inactive) [ 19/Oct/15 ]

https://github.com/mongodb/mongo-cxx-driver/pull/341

Generated at Wed Feb 07 21:59:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.