Skip to content

Commit c9596fb

Browse files
committed
CXX-938 Declare polyfills in the inline ABI namespace
1 parent 1d1055b commit c9596fb

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/bsoncxx/stdx/make_unique.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,41 @@
2525
#endif
2626

2727
namespace bsoncxx {
28+
BSONCXX_INLINE_NAMESPACE_BEGIN
2829
namespace stdx {
2930

3031
using ::core::make_unique;
3132

3233
} // namespace stdx
34+
BSONCXX_INLINE_NAMESPACE_END
3335
} // namespace bsoncxx
3436

3537
#elif defined(BSONCXX_POLY_USE_BOOST)
3638

3739
#include <boost/smart_ptr/make_unique.hpp>
3840

3941
namespace bsoncxx {
42+
BSONCXX_INLINE_NAMESPACE_BEGIN
4043
namespace stdx {
4144

4245
using ::boost::make_unique;
4346

4447
} // namespace stdx
48+
BSONCXX_INLINE_NAMESPACE_END
4549
} // namespace bsoncxx
4650

4751
#elif __cplusplus >= 201402L
4852

4953
#include <memory>
5054

5155
namespace bsoncxx {
56+
BSONCXX_INLINE_NAMESPACE_BEGIN
5257
namespace stdx {
5358

5459
using ::std::make_unique;
5560

5661
} // namespace stdx
62+
BSONCXX_INLINE_NAMESPACE_END
5763
} // namespace bsoncxx
5864

5965
#else

src/bsoncxx/stdx/optional.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
#endif
2626

2727
namespace bsoncxx {
28+
BSONCXX_INLINE_NAMESPACE_BEGIN
2829
namespace stdx {
2930

3031
using ::core::optional;
3132
using ::core::nullopt;
3233
using ::core::make_optional;
3334

3435
} // namespace stdx
36+
BSONCXX_INLINE_NAMESPACE_END
3537
} // namespace bsoncxx
3638

3739
#elif defined(BSONCXX_POLY_USE_BOOST)
@@ -40,6 +42,7 @@ using ::core::make_optional;
4042
#include <boost/optional/optional.hpp>
4143

4244
namespace bsoncxx {
45+
BSONCXX_INLINE_NAMESPACE_BEGIN
4346
namespace stdx {
4447

4548
using ::boost::optional;
@@ -50,20 +53,23 @@ const nullopt_t nullopt{::boost::none};
5053
using ::boost::make_optional;
5154

5255
} // namespace stdx
56+
BSONCXX_INLINE_NAMESPACE_END
5357
} // namespace bsoncxx
5458

5559
#elif defined(BSONCXX_POLY_USE_STD_EXPERIMENTAL)
5660

5761
#include <experimental/optional>
5862

5963
namespace bsoncxx {
64+
BSONCXX_INLINE_NAMESPACE_BEGIN
6065
namespace stdx {
6166

6267
using ::std::experimental::optional;
6368
using ::std::experimental::nullopt;
6469
using ::std::experimental::make_optional;
6570

6671
} // namespace stdx
72+
BSONCXX_INLINE_NAMESPACE_END
6773
} // namespace bsoncxx
6874

6975
#else

src/bsoncxx/stdx/string_view.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,41 @@
2525
#endif
2626

2727
namespace bsoncxx {
28+
BSONCXX_INLINE_NAMESPACE_BEGIN
2829
namespace stdx {
2930

3031
using ::core::string_view;
3132

3233
} // namespace stdx
34+
BSONCXX_INLINE_NAMESPACE_END
3335
} // namespace bsoncxx
3436

3537
#elif defined(BSONCXX_POLY_USE_BOOST)
3638

3739
#include <boost/utility/string_ref.hpp>
3840

3941
namespace bsoncxx {
42+
BSONCXX_INLINE_NAMESPACE_BEGIN
4043
namespace stdx {
4144

4245
using string_view = ::boost::string_ref;
4346

4447
} // namespace stdx
48+
BSONCXX_INLINE_NAMESPACE_END
4549
} // namespace bsoncxx
4650

4751
#elif defined(BSONCXX_POLY_USE_STD_EXPERIMENTAL)
4852

4953
#include <experimental/string_view>
5054

5155
namespace bsoncxx {
56+
BSONCXX_INLINE_NAMESPACE_BEGIN
5257
namespace stdx {
5358

5459
using ::std::experimental::string_view;
5560

5661
} // namespace stdx
62+
BSONCXX_INLINE_NAMESPACE_END
5763
} // namespace bsoncxx
5864

5965
#else

src/mongocxx/stdx.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace stdx {
2323
// We adopt all the bsoncxx polyfills
2424
using namespace ::bsoncxx::stdx;
2525

26-
} // namespace stdx;
26+
} // namespace stdx
2727
MONGOCXX_INLINE_NAMESPACE_END
2828
} // namespace mongocxx
2929

0 commit comments

Comments
 (0)