[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: |
|
| 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: |
| Comment by Jeff Abrahamson [ 11/Oct/18 ] |
|
Sure. Here's a patch produced with `git format-patch` and applyable with `git apply`. |
| 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? |