[CXX-1666] improve documentation of element::bool() Created: 11/Oct/18  Updated: 28/Oct/23  Resolved: 15/Oct/18

Status: Closed
Project: C++ Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 3.4.0

Type: Improvement Priority: Minor - P4
Reporter: Jeff Abrahamson Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File 0001-Improve-comment-on-element-bool.patch    
Backwards Compatibility: Fully Compatible

 Description   

The documentation for `element::bool()` says

    Conversion operator to bool which is true for valid elements.

This might be clearer thus:

    Conversion operator to bool which is true for valid elements and false for invalid elements.

(Sadly, not all bool operators in the world really fully catch both sides of the condition.  Being clear that it does saves checking source to be certain, and so makes the library just a bit easier to use.)



 Comments   
Comment by A. Jesse Jiryu Davis [ 15/Oct/18 ]

Thanks for the patch!

Comment by Githook User [ 15/Oct/18 ]

Author:

{'name': 'Jeff Abrahamson', 'email': 'jeff@jellybooks.com', 'username': 'JeffAbrahamson'}

Message: CXX-1666 Improve comment on element::bool()
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/4ddfc583997daa03ce992844fb40152815847c09

Comment by Jeff Abrahamson [ 11/Oct/18 ]

Sure.  Here's a patch produced with `git format-patch` and applyable with `git apply`.

0001-Improve-comment-on-element-bool.patch

Comment by A. Jesse Jiryu Davis [ 11/Oct/18 ]

https://github.com/mongodb/mongo-cxx-driver/blob/master/src/bsoncxx/document/element.hpp

Comment by A. Jesse Jiryu Davis [ 11/Oct/18 ]

Thanks, would you like to make a pull request?

Generated at Wed Feb 07 22:03:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.