[CXX-506] Use MNMLSTC for polyfills Created: 30/Jan/15  Updated: 24/Apr/15  Resolved: 12/Feb/15

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

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

Issue Links:
Depends
is depended on by CXX-431 Polyfill stdx::string_view Closed
is depended on by CXX-432 Polyfill stdx::optional Closed
is depended on by CXX-434 Polyfill stdx::make_unique Closed
is depended on by CXX-530 remove all uses of string_or_literal Closed
Epic Link: PM-123

 Description   
  • In C++11, you must use MNMLSTC.
  • In C++14, you can choose to use MNMLSTC or not.

In both cases, you can choose to either use the system version of the library, or ours. For ours, we will obtain it with ExternalProjectAdd.

Note that when using the embedded version of MNMLSTC, we will need to install the MNMLSTC headers to somewhere within our installed include directory, so as to not conflict with a potential system copy.

This will require that we have a config.h header variable like LIBMONGOCXX_USING_PRIVATE_MNMLSTC, and then each polyfill header will need to look like:

#include <mongocxx/driver/config.h>
 
#if defined(LIBMONGOCXX_USING_MNMLSTC)
#if defined(LIBMONGOCXX_USING_PRIVATE_MNMLSTC)
#include <mongocxx/mnmlstc/foo.h>
#else
#include <core/foo.h>
#endif
 
namespace mongo {
namespace stdx {
    using foo = ::mnmlstc::foo;
} // namespace stdx
} // namespace mongo
 
#elif __cplusplus >= 201402L
 
#include <foo>
 
namespace mongo {
namespace stdx {
    using foo = ::std::foo;
} // namespace stdx
} // namespace mongo
 
#else
#error Cannot find a polyfill for "foo"
#endif



 Comments   
Comment by Githook User [ 12/Feb/15 ]

Author:

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

Message: CXX-506 CXX-431 CXX-432 CXX-434 Use MNMLSTC for 14 and TS polyfills
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/5ec1e11b370ea15b4647b816992317a2f378e269

Comment by Andrew Morrow (Inactive) [ 12/Feb/15 ]

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

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