[CXX-752] identical class names, method names, and parameter names cause painful ambiguity Created: 30/Nov/15  Updated: 14/Jan/16  Resolved: 14/Jan/16

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

Type: Improvement Priority: Major - P3
Reporter: Adam Midvidy Assignee: Andrew Morrow (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CXX-638 C++ Driver on master fails to compile... Closed
is depended on by CXX-777 Evergreen builds should use -Wall and... Closed
Duplicate
duplicates CXX-770 Add missing headers and fix enum typing Closed
is duplicated by CXX-772 Add get/set prefix to getters/setters... Closed
Epic Link: C++11 Driver MongoDB 3.2

 Description   

The C++11 driver employs significant technical acrobatics to disambiguate between types, functions, and parameters with the same name. As such, contributors are forced to learn esoteric features of the language like class qualifiers and other obscure techniques for disambiguating the overloaded names.

Given that the benefit of naming the related classes, methods, and parameters the same thing is mostly subjective (some aesthetic pleasantry) - and the downsides are fairly obvious (the driver is harder to contribute to), I think that we should change the types to end in _t (or adopt some other convention) to disambiguate.



 Comments   
Comment by Andrew Morrow (Inactive) [ 14/Jan/16 ]

We have decided not to pursue this work

Comment by Andrew Morrow (Inactive) [ 10/Jan/16 ]

This had become a blocking issue for rc0 because of the issue about how to name enumerations with VS2015, which disagreed with GCC and clang about how to write an elaborated type specifier for enum classes.

However, I was able to easily remove all need to write such elaborated type specifiers. I also removed all cases where an enum nested in a class shadowed a class member, which had given rise to the other complaint - that there was no sane way to name such enums.

The driver now builds on GCC, clang, and VS2015 without need for any changes.

Given that, I'm kicking this out to 'features we are not sure of', because if we don't need to do a huge renaming, that will be much better. At the very least, we don't need to do it for rc0.

Comment by Githook User [ 10/Jan/16 ]

Author:

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

Message: CXX-752 Disambiguate enums in a way VS2015 can handle
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/245fa152a6a7395b31c14a5fcced19fa43bebfc2

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