19 #include <bsoncxx/stdx/string_view.hpp>
20 #include <bsoncxx/view_or_value.hpp>
22 #include <bsoncxx/config/prelude.hpp>
25 BSONCXX_INLINE_NAMESPACE_BEGIN
56 :
bsoncxx::view_or_value<stdx::string_view,
std::string>(stdx::string_view(str)) {
70 :
bsoncxx::view_or_value<stdx::string_view,
std::string>(stdx::string_view(str)) {
92 const char* data()
const;
103 return lhs.
view() == stdx::string_view(rhs);
106 BSONCXX_INLINE
bool operator!=(
const view_or_value& lhs,
const char* rhs) {
107 return !(lhs == rhs);
110 BSONCXX_INLINE
bool operator==(
const char* lhs,
const view_or_value& rhs) {
114 BSONCXX_INLINE
bool operator!=(
const char* lhs,
const view_or_value& rhs) {
115 return !(rhs == lhs);
122 BSONCXX_INLINE_NAMESPACE_END
125 #include <bsoncxx/config/postlude.hpp>
view_or_value(const char *str)
Construct a string::view_or_value using a null-terminated const char *.
Definition: view_or_value.hpp:55
Definition: error_code.hpp:67
view_or_value(const std::string &str)
Allow construction with an l-value reference to a std::string.
Definition: view_or_value.hpp:69
bool operator==(const view_or_value &lhs, const char *rhs)
Comparison operators for comparing string::view_or_value directly with const char *...
Definition: view_or_value.hpp:102
Class representing a view-or-value variant type.
Definition: view_or_value.hpp:30
Class representing a view-or-value variant type for strings.
Definition: view_or_value.hpp:36
const View & view() const
Get a View for the type.
Definition: view_or_value.hpp:135
Definition: element.hpp:24