Skip to content

Commit

Permalink
polyfills
Browse files Browse the repository at this point in the history
  • Loading branch information
norareidy committed Nov 15, 2024
1 parent e048746 commit aaa0d35
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ Overview

Welcome to the documentation site for the official {+driver-long+}.

C++17 Polyfill Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The {+driver-long+} uses C++17 features ``std::optional<T>`` and ``std::string_view``.
If you configure the driver with a pre-C++17 standard, the bsoncxx library provides
polyfill implementations for these C++17 features. To limit reliance on polyfill-specific
behavior, avoid using ``stdx::optional<T>`` and ``stdx::string_view`` for pre-C++17 configurations.
The driver uses the bsoncxx polyfill implementations when ``CMAKE_CXX_STANDARD`` is less than ``17``
(set to ``11`` by default).

We recommend using the C++17 standard library implementations whenever possible. To use
these implementations, set ``CMAKE_CXX_STANDARD`` to ``17`` during CMake configuration.

Get Started
-----------

Expand Down

0 comments on commit aaa0d35

Please sign in to comment.