# std::basic_string::operator basic_string_view

From cppreference.com
< cpp‎ | string‎ | basic string

operator std::basic_string_view<CharT, Traits>() const; |  |

Returns a std::basic_string_view, constructed as if by std::basic_string_view<CharT, Traits>(data(), size())

### Parameters

(none)

### Return value

A string view representing the entire contents of the string.

### Exceptions

`noexcept` specification:
noexcept

### Example

| This section is incomplete Reason: no example

### See also

(constructor) | constructs a `basic_string_view` (public member function of `std::basic_string_view`)

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/string/basic_string/operator_basic_string_view&oldid=91786"
Categories:

- unconditionally noexcept
- Todo no example

Hidden categories:

- Pages with unreviewed unconditional noexcept template
- Pages with unreviewed noexcept template