Skip to content

Instantly share code, notes, and snippets.

@danlark1
Last active January 11, 2020 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danlark1/f784b6feca2bc31a8ef23a7d81a3467a to your computer and use it in GitHub Desktop.
Save danlark1/f784b6feca2bc31a8ef23a7d81a3467a to your computer and use it in GitHub Desktop.
Brief absl::optional description
#if __cplusplus >= 201703 && __has_include(<optional>)
#include <optional>
namespace absl {
using std::bad_optional_access;
using std::optional;
using std::make_optional;
using std::nullopt_t;
using std::nullopt;
} // namespace absl
#else // __cplusplus >= 201703 && __has_include(<optional>)
// Internal abseil implementation.
// Under define not to generate more code to a compiler because std::optional
// and absl::optional claim to be compatible.
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment