##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# 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())

### [edit] Parameters

(none)

### [edit] Return value

A string view representing the entire contents of the string.

### [edit] Exceptions

`noexcept` specification:
noexcept

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

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

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